From 1172db3eb3f555bf11a045687c6f58f4e0fb9c83 Mon Sep 17 00:00:00 2001 From: Ilyas Sung Date: Tue, 31 Jan 2023 16:39:48 +0000 Subject: [PATCH] Add system exemption to allow application to start activity while running in the background. * This new appop is replacing an appop in Android U that was unused. Bug: 246330879 Test: atest AppOpsTests Change-Id: I6792139a5bc55fdb886911ef354b7e83ef1c454e --- core/java/android/app/AppOpsManager.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index f9e40819e1706..3018f348ac576 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -1432,14 +1432,14 @@ public class AppOpsManager { .APP_OP_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION; /** - * Hide foreground service stop button in quick settings. + * Allows an application to start an activity while running in the background. * * Only to be used by the system. * * @hide */ - public static final int OP_SYSTEM_EXEMPT_FROM_FGS_STOP_BUTTON = - AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_FGS_STOP_BUTTON; + public static final int OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION = + AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION; /** * Allows an application to capture bugreport directly without consent dialog when using the @@ -2027,14 +2027,14 @@ public class AppOpsManager { "android:system_exempt_from_fgs_bg_start_while_in_use_permission_restriction"; /** - * Hide foreground service stop button in quick settings. + * Allows an application to start an activity while running in the background. * * Only to be used by the system. * * @hide */ - public static final String OPSTR_SYSTEM_EXEMPT_FROM_FGS_STOP_BUTTON = - "android:system_exempt_from_fgs_stop_button"; + public static final String OPSTR_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION = + "android:system_exempt_from_activity_bg_start_restriction"; /** * Allows an application to capture bugreport directly without consent dialog when using the @@ -2562,9 +2562,9 @@ public class AppOpsManager { OPSTR_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION, "SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION") .build(), - new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_FGS_STOP_BUTTON, - OPSTR_SYSTEM_EXEMPT_FROM_FGS_STOP_BUTTON, - "SYSTEM_EXEMPT_FROM_FGS_STOP_BUTTON").build(), + new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION, + OPSTR_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION, + "SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION").build(), new AppOpInfo.Builder( OP_CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD, OPSTR_CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD,