mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Merge branch 'catch-security-exception-for-bluetooth-address-setting' into 'master'
Catch SecurityException for bluetooth_address setting See merge request briar/briar!1811
This commit is contained in:
@@ -64,10 +64,15 @@ public class AndroidUtils {
|
|||||||
}
|
}
|
||||||
// Return the address from settings if it's valid and not fake
|
// Return the address from settings if it's valid and not fake
|
||||||
if (SDK_INT < 33) {
|
if (SDK_INT < 33) {
|
||||||
address = Settings.Secure.getString(ctx.getContentResolver(),
|
try {
|
||||||
"bluetooth_address");
|
address = Settings.Secure.getString(ctx.getContentResolver(),
|
||||||
if (isValidBluetoothAddress(address)) {
|
"bluetooth_address");
|
||||||
return new Pair<>(address, "settings");
|
if (isValidBluetoothAddress(address)) {
|
||||||
|
return new Pair<>(address, "settings");
|
||||||
|
}
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
// Some custom ROMs throw this exception on SDK_INT < 33.
|
||||||
|
// Fall through
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Try to get the address via reflection
|
// Try to get the address via reflection
|
||||||
|
|||||||
Reference in New Issue
Block a user