Skip to content

Commit

Permalink
attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jvde-github committed Dec 9, 2024
1 parent 91d44b8 commit 9311649
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/jni/JNI/AIScatcherNDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9311649

Please sign in to comment.