diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 07defc13a2..391e6c6742 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -46,7 +46,7 @@ limitations under the License. - + diff --git a/src/main/java/de/dennisguse/opentracks/TrackListActivity.java b/src/main/java/de/dennisguse/opentracks/TrackListActivity.java index a3e60fd35a..bf10ba5494 100644 --- a/src/main/java/de/dennisguse/opentracks/TrackListActivity.java +++ b/src/main/java/de/dennisguse/opentracks/TrackListActivity.java @@ -276,7 +276,7 @@ public void bindView(View view, Context context, Cursor cursor) { } private void requestRequiredPermissions() { - PermissionRequester.ALL.requestPermissionsIfNeeded(this, this, null, (requester) -> Toast.makeText(this, R.string.permission_gps_failed, Toast.LENGTH_SHORT).show()); + PermissionRequester.ALL.requestPermissionsIfNeeded(this, this, null, (requester) -> Toast.makeText(this, R.string.permission_gps_failed, Toast.LENGTH_LONG).show()); } @Override diff --git a/src/main/java/de/dennisguse/opentracks/util/PermissionRequester.java b/src/main/java/de/dennisguse/opentracks/util/PermissionRequester.java index 41c3b2fab5..7a72b59ad9 100644 --- a/src/main/java/de/dennisguse/opentracks/util/PermissionRequester.java +++ b/src/main/java/de/dennisguse/opentracks/util/PermissionRequester.java @@ -60,11 +60,12 @@ private void requestPermission(ActivityResultCaller context, @Nullable Runnable private static final List GPS_PERMISSION; static { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - GPS_PERMISSION = List.of(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION); - } else { + //TODO ACCESS_BACKGROUND_LOCATION is required for API, but the permission is not properly granted. See #1653. +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { +// GPS_PERMISSION = List.of(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION); +// } else { GPS_PERMISSION = List.of(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION); - } +// } } private static final List BLUETOOTH_PERMISSIONS;