Skip to content

Commit

Permalink
[fix] fix Android S+ PendingIntent exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangdg committed Jul 28, 2022
1 parent 3621226 commit 9c29f6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libuvc/src/main/java/com/serenegiant/usb/USBMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public synchronized void register() throws IllegalStateException {
if (DEBUG) XLogWrapper.i(TAG, "register:");
final Context context = mWeakContext.get();
if (context != null) {
if (Build.VERSION.SDK_INT >= 23) {
if (Build.VERSION.SDK_INT >= 31) {
mPermissionIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), PendingIntent.FLAG_IMMUTABLE);
} else {
mPermissionIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);
Expand Down

0 comments on commit 9c29f6a

Please sign in to comment.