From 687bc1c52ac040e2b1de62e7b3331c79ae3ca7c7 Mon Sep 17 00:00:00 2001 From: Akira Kurosawa Date: Wed, 5 Oct 2022 17:44:42 +0900 Subject: [PATCH 1/2] Android 12 support Behavior changes: Apps targeting Android 12 - Safer component exporting https://developer.android.com/about/versions/12/behavior-changes-12#exported --- wrappers/android/librealsense/src/main/AndroidManifest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wrappers/android/librealsense/src/main/AndroidManifest.xml b/wrappers/android/librealsense/src/main/AndroidManifest.xml index 198955690c..b4bb3b94e9 100644 --- a/wrappers/android/librealsense/src/main/AndroidManifest.xml +++ b/wrappers/android/librealsense/src/main/AndroidManifest.xml @@ -2,7 +2,8 @@ + android:directBootAware="true" + android:exported="true"> From d03493a0ee4e62de8543ac169bdaa02f22c54371 Mon Sep 17 00:00:00 2001 From: Akira Kurosawa Date: Wed, 5 Oct 2022 17:45:32 +0900 Subject: [PATCH 2/2] Android 12 support Behavior changes: Apps targeting Android 12 - Pending intents mutability https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability --- .../java/com/intel/realsense/librealsense/UsbUtilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/UsbUtilities.java b/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/UsbUtilities.java index 0208e703c4..78cdcd8c2b 100644 --- a/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/UsbUtilities.java +++ b/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/UsbUtilities.java @@ -68,7 +68,7 @@ private static void grantUsbPermissions(Context context, UsbDevice usbDevice){ if(!permission) { Log.i(TAG, "grantUsbPermissions:\ndevice: " + usbDevice.toString()); - PendingIntent pi = PendingIntent.getBroadcast(context, 0, new Intent(UsbUtilities.ACTION_USB_PERMISSION), 0); + PendingIntent pi = PendingIntent.getBroadcast(context, 0, new Intent(UsbUtilities.ACTION_USB_PERMISSION), PendingIntent.FLAG_IMMUTABLE); usbManager.requestPermission(usbDevice, pi); } }