Merge branch '1721-fine-location' into 'master'

Request fine location permission for Bluetooth discovery

Closes #1721

See merge request briar/briar!1272
This commit is contained in:
Torsten Grote
2020-08-12 19:40:48 +00:00
2 changed files with 6 additions and 6 deletions

View File

@@ -29,7 +29,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission-sdk-23 android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission-sdk-23 android:name="android.permission.FOREGROUND_SERVICE"/>
@@ -43,7 +43,7 @@
android:banner="@mipmap/tv_banner"
android:supportsRtl="true"
android:theme="@style/BriarTheme"
tools:ignore="GoogleAppIndexingWarning"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
tools:targetApi="16">
<receiver

View File

@@ -41,7 +41,7 @@ import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentManager;
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
import static android.Manifest.permission.CAMERA;
import static android.bluetooth.BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE;
import static android.bluetooth.BluetoothAdapter.ACTION_SCAN_MODE_CHANGED;
@@ -396,7 +396,7 @@ public abstract class KeyAgreementActivity extends BriarActivity implements
private void requestPermissions() {
ActivityCompat.requestPermissions(this,
new String[] {CAMERA, ACCESS_COARSE_LOCATION},
new String[] {CAMERA, ACCESS_FINE_LOCATION},
REQUEST_PERMISSION_CAMERA_LOCATION);
}
@@ -413,9 +413,9 @@ public abstract class KeyAgreementActivity extends BriarActivity implements
} else {
cameraPermission = Permission.PERMANENTLY_DENIED;
}
if (gotPermission(ACCESS_COARSE_LOCATION, permissions, grantResults)) {
if (gotPermission(ACCESS_FINE_LOCATION, permissions, grantResults)) {
locationPermission = Permission.GRANTED;
} else if (shouldShowRationale(ACCESS_COARSE_LOCATION)) {
} else if (shouldShowRationale(ACCESS_FINE_LOCATION)) {
locationPermission = Permission.SHOW_RATIONALE;
} else {
locationPermission = Permission.PERMANENTLY_DENIED;