Skip to content

Commit 881bbc2

Browse files
committed
Check local array to see if we need bluetooth connect permission
1 parent cb1c48e commit 881bbc2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ protected void onCreate(Bundle savedInstanceState) {
2525
if (BuildConfig.TRANSPORT.equals("MULTI") || BuildConfig.TRANSPORT.equals("MULTI_HB")) {
2626
String[] permissionsNeeded = permissionsNeeded();
2727
if (permissionsNeeded.length > 0) {
28-
requestPermission(permissionsNeeded(), REQUEST_CODE);
29-
if (checkBTPermission()) {
30-
return;
28+
requestPermission(permissionsNeeded, REQUEST_CODE);
29+
for (String permission : permissionsNeeded) {
30+
if (Manifest.permission.BLUETOOTH_CONNECT.equals(permission)) {
31+
// We need to request BLUETOOTH_CONNECT permission to connect to SDL via Bluetooth
32+
return;
33+
}
3134
}
3235
}
3336

0 commit comments

Comments
 (0)