From 9b092da37a6517e407bef0f0087df574a2cb5ae4 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Wed, 7 Dec 2022 18:37:52 +0000 Subject: [PATCH] Don't try to get bonded Bluetooth devices on API 31+. --- .../bramble/system/AndroidSecureRandomProvider.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bramble-android/src/main/java/org/briarproject/bramble/system/AndroidSecureRandomProvider.java b/bramble-android/src/main/java/org/briarproject/bramble/system/AndroidSecureRandomProvider.java index b6c0c87da..84aa76840 100644 --- a/bramble-android/src/main/java/org/briarproject/bramble/system/AndroidSecureRandomProvider.java +++ b/bramble-android/src/main/java/org/briarproject/bramble/system/AndroidSecureRandomProvider.java @@ -26,7 +26,6 @@ import static android.os.Process.myPid; import static android.os.Process.myTid; import static android.os.Process.myUid; import static android.provider.Settings.Secure.ANDROID_ID; -import static org.briarproject.bramble.util.AndroidUtils.hasBtConnectPermission; @Immutable @NotNullByDefault @@ -53,8 +52,8 @@ class AndroidSecureRandomProvider extends UnixSecureRandomProvider { ContentResolver contentResolver = appContext.getContentResolver(); String id = Settings.Secure.getString(contentResolver, ANDROID_ID); if (id != null) out.writeUTF(id); - // use bluetooth paired devices as well, if allowed - if (hasBtConnectPermission(appContext)) { + // On API 31 and higher we need permission to access bonded devices + if (SDK_INT < 31) { Parcel parcel = Parcel.obtain(); BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter(); if (bt != null) {