Skip to content

Commit 16c440c

Browse files
committed
Update USBPermissionManager.kt
1 parent feec055 commit 16c440c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Transmission/src/main/java/org/operatorfoundation/transmission/USBPermissionManager.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ class USBPermissionManager(private val activityContext: Context)
128128
val pendingIntent = PendingIntent.getBroadcast(
129129
activityContext,
130130
device.deviceId,
131-
Intent(ACTION_USB_PERMISSION),
132-
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
131+
Intent(ACTION_USB_PERMISSION).apply {
132+
`package` = activityContext.packageName // make the intent explicit
133+
},
134+
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
133135
)
134136

135137
usbManager.requestPermission(device, pendingIntent)

0 commit comments

Comments
 (0)