-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix error on hw usb connection - Add timer to dispatch error by time LedgerHQ/ledger-live#7786
- Loading branch information
1 parent
fb8d1cc
commit 891622c
Showing
2 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
diff --git a/node_modules/@ledgerhq/react-native-hid/android/src/main/java/com/ledgerwallet/hid/ReactHIDModule.java b/node_modules/@ledgerhq/react-native-hid/android/src/main/java/com/ledgerwallet/hid/ReactHIDModule.java | ||
index 349bf3982c..7ead607ea7 100755 | ||
--- a/node_modules/@ledgerhq/react-native-hid/android/src/main/java/com/ledgerwallet/hid/ReactHIDModule.java | ||
+++ b/node_modules/@ledgerhq/react-native-hid/android/src/main/java/com/ledgerwallet/hid/ReactHIDModule.java | ||
@@ -7,6 +7,7 @@ import android.content.Intent; | ||
import android.content.IntentFilter; | ||
import android.hardware.usb.UsbDevice; | ||
import android.hardware.usb.UsbManager; | ||
+import android.os.Build; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
@@ -58,7 +59,11 @@ public class ReactHIDModule extends ReactContextBaseJavaModule { | ||
.emit(event, buildMapFromDevice(device)); | ||
} | ||
}; | ||
- getReactApplicationContext().registerReceiver(receiver, filter); | ||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
+ getReactApplicationContext().registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED); | ||
+ } else { | ||
+ getReactApplicationContext().registerReceiver(receiver, filter); | ||
+ } | ||
} | ||
|
||
private WritableMap buildMapFromDevice(UsbDevice device) { | ||
@@ -213,7 +218,11 @@ public class ReactHIDModule extends ReactContextBaseJavaModule { | ||
unregisterReceiver(this); | ||
} | ||
}; | ||
- getReactApplicationContext().registerReceiver(receiver, intFilter); | ||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
+ getReactApplicationContext().registerReceiver(receiver, intFilter, Context.RECEIVER_NOT_EXPORTED); | ||
+ } else { | ||
+ getReactApplicationContext().registerReceiver(receiver, intFilter); | ||
+ } | ||
} | ||
|
||
private void unregisterReceiver(BroadcastReceiver receiver) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters