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
This commit is contained in:
Jing Ji
2023-01-06 01:49:49 -08:00
parent 26af2c72fe
commit b50556f0b4
4 changed files with 7 additions and 8 deletions

View File

@@ -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";

View File

@@ -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)

View File

@@ -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 =

View File

@@ -6885,14 +6885,12 @@
<permission android:name="android.permission.MANAGE_WEARABLE_SENSING_SERVICE"
android:protectionLevel="signature|privileged" />
<!-- Allows applications to use the long running jobs APIs.
<p>This is a special access permission that can be revoked by the system or the user.
<p>Apps need to target API {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE} or above
to be able to request this permission.
<p>Protection level: appop
<!-- Allows applications to use the long running jobs APIs. For more details
see {@link android.app.job.JobInfo.Builder#setUserInitiated}.
<p>Protection level: normal
-->
<permission android:name="android.permission.RUN_LONG_JOBS"
android:protectionLevel="normal|appop"/>
android:protectionLevel="normal"/>
<!-- Allows an app access to the installer provided app metadata.
@hide -->