Skip to content

Commit

Permalink
fix RECEIVER_NOT_EXPORTED crash
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r committed Oct 16, 2024
1 parent 1a13bdd commit 4bfc9c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
Expand Down Expand Up @@ -1260,7 +1261,7 @@ void attachLedger() {
if (usbManager.hasPermission(device)) {
connectLedger(usbManager, device);
} else {
registerReceiver(usbPermissionReceiver, new IntentFilter(ACTION_USB_PERMISSION));
ContextCompat.registerReceiver(this, usbPermissionReceiver, new IntentFilter(ACTION_USB_PERMISSION), ContextCompat.RECEIVER_NOT_EXPORTED);
usbManager.requestPermission(device,
PendingIntent.getBroadcast(this, 0,
new Intent(ACTION_USB_PERMISSION),
Expand Down Expand Up @@ -1379,8 +1380,7 @@ public void onReceive(Context context, Intent intent) {
}
}
};

registerReceiver(detachReceiver, new IntentFilter(UsbManager.ACTION_USB_DEVICE_DETACHED));
ContextCompat.registerReceiver(this, detachReceiver, new IntentFilter(UsbManager.ACTION_USB_DEVICE_DETACHED), ContextCompat.RECEIVER_NOT_EXPORTED);
}

public void onLedgerAction() {
Expand Down

0 comments on commit 4bfc9c1

Please sign in to comment.