Don't try to get Bluetooth address from settings.

This commit is contained in:
akwizgran
2023-06-30 18:14:12 +01:00
parent 74f8e84a9b
commit 882f536b8d

View File

@@ -63,10 +63,12 @@ public class AndroidUtils {
return new Pair<>(address, "adapter");
}
// Return the address from settings if it's valid and not fake
address = Settings.Secure.getString(ctx.getContentResolver(),
"bluetooth_address");
if (isValidBluetoothAddress(address)) {
return new Pair<>(address, "settings");
if (SDK_INT < 33) {
address = Settings.Secure.getString(ctx.getContentResolver(),
"bluetooth_address");
if (isValidBluetoothAddress(address)) {
return new Pair<>(address, "settings");
}
}
// Try to get the address via reflection
address = getBluetoothAddressByReflection(adapter);