From 12a8907c8bebf261837b381347f340a535b74cdd Mon Sep 17 00:00:00 2001 From: akwizgran Date: Thu, 29 Oct 2020 14:34:10 +0000 Subject: [PATCH] Ignore missing location permission on API < 23 where it's not needed. --- .../briar/android/keyagreement/KeyAgreementActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/KeyAgreementActivity.java b/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/KeyAgreementActivity.java index ae6c74f93..a2795b2a0 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/KeyAgreementActivity.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/KeyAgreementActivity.java @@ -45,6 +45,7 @@ import static android.bluetooth.BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE; import static android.bluetooth.BluetoothAdapter.ACTION_SCAN_MODE_CHANGED; import static android.bluetooth.BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE; import static android.content.pm.PackageManager.PERMISSION_GRANTED; +import static android.os.Build.VERSION.SDK_INT; import static java.util.logging.Level.INFO; import static java.util.logging.Logger.getLogger; import static org.briarproject.bramble.api.nullsafety.NullSafety.requireNonNull; @@ -219,7 +220,7 @@ public abstract class KeyAgreementActivity extends BriarActivity implements private boolean areEssentialPermissionsGranted() { return cameraPermission == Permission.GRANTED && - (locationPermission == Permission.GRANTED || + (SDK_INT < 23 || locationPermission == Permission.GRANTED || !isBluetoothSupported()); }