From b50556f0b47b8168e1f97eccc295316db4aec859 Mon Sep 17 00:00:00 2001 From: Jing Ji Date: Fri, 6 Jan 2023 01:49:49 -0800 Subject: [PATCH] Update the permission RUN_LONG_JOBS Make it a normal permission and detach it from the appop OP_RUN_LONG_JOBS which is effectively a no-op now. Hide the public intent to navigate to the long background tasks page. There will be a separated CL to hide the entry point to the long background tasks page in the Settings app. Bug: 255821578 Test: atest CtsJobSchedulerTestCases:JobSchedulingTest Change-Id: Id8a2b366b61f464ff180ffd1339a504ee227b381 --- core/api/current.txt | 1 - core/java/android/app/AppOpsManager.java | 2 +- core/java/android/provider/Settings.java | 2 ++ core/res/AndroidManifest.xml | 10 ++++------ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 5dd1b3938f40b..28612826842e0 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -36318,7 +36318,6 @@ package android.provider { field public static final String ACTION_MANAGE_ALL_SIM_PROFILES_SETTINGS = "android.settings.MANAGE_ALL_SIM_PROFILES_SETTINGS"; field public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = "android.settings.MANAGE_APPLICATIONS_SETTINGS"; field public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION = "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION"; - field public static final String ACTION_MANAGE_APP_LONG_RUNNING_JOBS = "android.settings.MANAGE_APP_LONG_RUNNING_JOBS"; field public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; field public static final String ACTION_MANAGE_OVERLAY_PERMISSION = "android.settings.action.MANAGE_OVERLAY_PERMISSION"; field public static final String ACTION_MANAGE_SUPERVISOR_RESTRICTED_SETTING = "android.settings.MANAGE_SUPERVISOR_RESTRICTED_SETTING"; diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index 563f6d4d95444..a14f3d35fa487 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -2489,7 +2489,7 @@ public class AppOpsManager { "RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO").setDefaultMode( AppOpsManager.MODE_ALLOWED).build(), new AppOpInfo.Builder(OP_RUN_LONG_JOBS, OPSTR_RUN_LONG_JOBS, "RUN_LONG_JOBS") - .setPermission(Manifest.permission.RUN_LONG_JOBS).build(), + .setDefaultMode(AppOpsManager.MODE_ALLOWED).build(), new AppOpInfo.Builder(OP_READ_MEDIA_VISUAL_USER_SELECTED, OPSTR_READ_MEDIA_VISUAL_USER_SELECTED, "READ_MEDIA_VISUAL_USER_SELECTED") .setPermission(Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 2bdd360c58a6e..0168a23356584 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -602,6 +602,8 @@ public final class Settings { * Output: When a package data uri is passed as input, the activity result is set to * {@link android.app.Activity#RESULT_OK} if the permission was granted to the app. Otherwise, * the result is set to {@link android.app.Activity#RESULT_CANCELED}. + * + * @hide */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_MANAGE_APP_LONG_RUNNING_JOBS = diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index bfa5301433806..602c89210d250 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -6885,14 +6885,12 @@ - + android:protectionLevel="normal"/>