mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 12:49:55 +01:00
Don't try to get bonded Bluetooth devices on API 31+.
This commit is contained in:
@@ -26,7 +26,6 @@ import static android.os.Process.myPid;
|
|||||||
import static android.os.Process.myTid;
|
import static android.os.Process.myTid;
|
||||||
import static android.os.Process.myUid;
|
import static android.os.Process.myUid;
|
||||||
import static android.provider.Settings.Secure.ANDROID_ID;
|
import static android.provider.Settings.Secure.ANDROID_ID;
|
||||||
import static org.briarproject.bramble.util.AndroidUtils.hasBtConnectPermission;
|
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
@@ -53,8 +52,8 @@ class AndroidSecureRandomProvider extends UnixSecureRandomProvider {
|
|||||||
ContentResolver contentResolver = appContext.getContentResolver();
|
ContentResolver contentResolver = appContext.getContentResolver();
|
||||||
String id = Settings.Secure.getString(contentResolver, ANDROID_ID);
|
String id = Settings.Secure.getString(contentResolver, ANDROID_ID);
|
||||||
if (id != null) out.writeUTF(id);
|
if (id != null) out.writeUTF(id);
|
||||||
// use bluetooth paired devices as well, if allowed
|
// On API 31 and higher we need permission to access bonded devices
|
||||||
if (hasBtConnectPermission(appContext)) {
|
if (SDK_INT < 31) {
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
|
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
|
||||||
if (bt != null) {
|
if (bt != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user