diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index af4d6172..41b19503 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> @@ -89,7 +90,8 @@ android:exported="true" android:icon="@drawable/ic_quicksettings_collector_start" android:label="@string/quicksettings_collecting_start" - android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> + android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" + tools:targetApi="n"> @@ -103,7 +105,8 @@ android:exported="true" android:icon="@drawable/ic_quicksettings_uploader_start" android:label="@string/quicksettings_upload_start" - android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> + android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" + tools:targetApi="n"> @@ -117,7 +120,8 @@ android:exported="true" android:icon="@drawable/ic_quicksettings_export_start" android:label="@string/quicksettings_export_start" - android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> + android:permission="android.permission.BIND_QUICK_SETTINGS_TILE" + tools:targetApi="n"> diff --git a/app/src/main/java/info/zamojski/soft/towercollector/MainActivity.java b/app/src/main/java/info/zamojski/soft/towercollector/MainActivity.java index bd2d65cc..becdfb97 100644 --- a/app/src/main/java/info/zamojski/soft/towercollector/MainActivity.java +++ b/app/src/main/java/info/zamojski/soft/towercollector/MainActivity.java @@ -888,7 +888,7 @@ private void startCollectorServiceWithCheck() { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @NeedsPermission({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @NeedsPermission({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void startCollectorServiceApi33() { startCollectorServiceInternal(); } @@ -921,7 +921,7 @@ private void startCollectorServiceInternal() { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @OnShowRationale({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @OnShowRationale({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void onStartCollectorShowRationaleApi33(PermissionRequest request) { onStartCollectorShowRationaleInternal(request); } @@ -936,7 +936,7 @@ private void onStartCollectorShowRationaleInternal(PermissionRequest request) { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @OnPermissionDenied({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @OnPermissionDenied({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void onStartCollectorPermissionDeniedApi33() { onStartCollectorPermissionDeniedInternal(); } @@ -951,7 +951,7 @@ private void onStartCollectorPermissionDeniedInternal() { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @OnNeverAskAgain({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @OnNeverAskAgain({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void onStartCollectorNeverAskAgainApi33() { onStartCollectorNeverAskAgainInternal(); } diff --git a/app/src/main/java/info/zamojski/soft/towercollector/preferences/CollectorPreferenceFragment.java b/app/src/main/java/info/zamojski/soft/towercollector/preferences/CollectorPreferenceFragment.java index 13b8db06..1a4a6a82 100644 --- a/app/src/main/java/info/zamojski/soft/towercollector/preferences/CollectorPreferenceFragment.java +++ b/app/src/main/java/info/zamojski/soft/towercollector/preferences/CollectorPreferenceFragment.java @@ -162,7 +162,7 @@ private void setupCollectorKeepScreenOnDialog() { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @NeedsPermission({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @NeedsPermission({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void requestStartAtBootApi33() { requestStartAtBootInternal(); } @@ -184,7 +184,7 @@ private void requestStartAtBootInternal() { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @OnShowRationale({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @OnShowRationale({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void onStartAtBootRationaleApi33(final PermissionRequest request) { onStartAtBootRationaleInternal(request); } @@ -227,7 +227,7 @@ public void onClick(DialogInterface dialog, int which) { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @OnPermissionDenied({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @OnPermissionDenied({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void onStartAtBootPermissionDeniedApi33() { onStartAtBootPermissionDeniedInternal(); } @@ -249,7 +249,7 @@ private void onStartAtBootPermissionDeniedInternal() { } @TargetApi(Build.VERSION_CODES.TIRAMISU) - @OnNeverAskAgain({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.READ_PHONE_STATE}) + @OnNeverAskAgain({Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.FOREGROUND_SERVICE_LOCATION, Manifest.permission.READ_PHONE_STATE}) void onStartAtBootNeverAskAgainApi33() { onStartAtBootNeverAskAgainInternal(); }