diff --git a/app/src/main/java/com/jvdegithub/aiscatcher/DeviceManager.java b/app/src/main/java/com/jvdegithub/aiscatcher/DeviceManager.java index 54eda80..3fc619e 100644 --- a/app/src/main/java/com/jvdegithub/aiscatcher/DeviceManager.java +++ b/app/src/main/java/com/jvdegithub/aiscatcher/DeviceManager.java @@ -322,13 +322,7 @@ public static void registerUSBBroadCast() { filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); filter.addAction(ACTION_USB_PERMISSION); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - // Use ContextCompat.registerReceiver with RECEIVER_NOT_EXPORTED - ContextCompat.registerReceiver(context, mUsbReceiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED); - } else { - // Older Android versions do not require these flags - context.registerReceiver(mUsbReceiver, filter); - } + ContextCompat.registerReceiver(context, mUsbReceiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED); } public static void unregisterUSBBroadCast() { diff --git a/app/src/main/jni/JNI/AIScatcherNDK.cpp b/app/src/main/jni/JNI/AIScatcherNDK.cpp index a76f500..74af1cf 100644 --- a/app/src/main/jni/JNI/AIScatcherNDK.cpp +++ b/app/src/main/jni/JNI/AIScatcherNDK.cpp @@ -393,9 +393,6 @@ Java_com_jvdegithub_aiscatcher_AisCatcherJava_Run(JNIEnv *env, jclass) { catch (std::exception& e) { callbackError(env, e.what()); } - catch (const std::exception &e) { - callbackError(env, e.what()); - } try { device->Stop();