Loading apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,11 @@ public class PowerExemptionManager { * @hide */ public static final int REASON_DISALLOW_APPS_CONTROL = 323; /** * Active device admin package. * @hide */ public static final int REASON_ACTIVE_DEVICE_ADMIN = 324; /** @hide The app requests out-out. */ public static final int REASON_OPT_OUT_REQUESTED = 1000; Loading Loading @@ -459,6 +464,7 @@ public class PowerExemptionManager { REASON_OPT_OUT_REQUESTED, REASON_DPO_PROTECTED_APP, REASON_DISALLOW_APPS_CONTROL, REASON_ACTIVE_DEVICE_ADMIN, }) @Retention(RetentionPolicy.SOURCE) public @interface ReasonCode {} Loading Loading @@ -669,6 +675,8 @@ public class PowerExemptionManager { return AppBackgroundRestrictionsInfo.REASON_DPO_PROTECTED_APP; case REASON_DISALLOW_APPS_CONTROL: return AppBackgroundRestrictionsInfo.REASON_DISALLOW_APPS_CONTROL; case REASON_ACTIVE_DEVICE_ADMIN: return AppBackgroundRestrictionsInfo.REASON_ACTIVE_DEVICE_ADMIN; default: return AppBackgroundRestrictionsInfo.REASON_DENIED; } Loading Loading @@ -818,6 +826,8 @@ public class PowerExemptionManager { return "DPO_PROTECTED_APP"; case REASON_DISALLOW_APPS_CONTROL: return "DISALLOW_APPS_CONTROL"; case REASON_ACTIVE_DEVICE_ADMIN: return "ACTIVE_DEVICE_ADMIN"; case REASON_OPT_OUT_REQUESTED: return "REASON_OPT_OUT_REQUESTED"; default: Loading apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java +5 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,11 @@ public interface AppStandbyInternal { void setActiveAdminApps(Set<String> adminPkgs, int userId); /** * @return {@code true} if the given package is an active device admin app. */ boolean isActiveDeviceAdmin(String packageName, int userId); void onAdminDataAvailable(); void clearCarrierPrivilegedApps(); Loading apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +2 −1 Original line number Diff line number Diff line Loading @@ -1799,7 +1799,8 @@ public class AppStandbyController } @VisibleForTesting boolean isActiveDeviceAdmin(String packageName, int userId) { @Override public boolean isActiveDeviceAdmin(String packageName, int userId) { synchronized (mActiveAdminApps) { final Set<String> adminPkgs = mActiveAdminApps.get(userId); return adminPkgs != null && adminPkgs.contains(packageName); Loading core/proto/android/os/appbackgroundrestrictioninfo.proto +1 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ message AppBackgroundRestrictionsInfo { REASON_CARRIER_PRIVILEGED_APP = 321; REASON_DPO_PROTECTED_APP = 322; REASON_DISALLOW_APPS_CONTROL = 323; REASON_ACTIVE_DEVICE_ADMIN = 324; // app requested to be exempt REASON_OPT_OUT_REQUESTED = 1000; } Loading packages/SystemUI/src/com/android/systemui/qs/FgsManagerController.kt +1 −0 Original line number Diff line number Diff line Loading @@ -462,6 +462,7 @@ class FgsManagerController @Inject constructor( PowerExemptionManager.REASON_DISALLOW_APPS_CONTROL, PowerExemptionManager.REASON_DPO_PROTECTED_APP, PowerExemptionManager.REASON_PROFILE_OWNER, PowerExemptionManager.REASON_ACTIVE_DEVICE_ADMIN, PowerExemptionManager.REASON_PROC_STATE_PERSISTENT, PowerExemptionManager.REASON_PROC_STATE_PERSISTENT_UI, PowerExemptionManager.REASON_ROLE_DIALER, Loading Loading
apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,11 @@ public class PowerExemptionManager { * @hide */ public static final int REASON_DISALLOW_APPS_CONTROL = 323; /** * Active device admin package. * @hide */ public static final int REASON_ACTIVE_DEVICE_ADMIN = 324; /** @hide The app requests out-out. */ public static final int REASON_OPT_OUT_REQUESTED = 1000; Loading Loading @@ -459,6 +464,7 @@ public class PowerExemptionManager { REASON_OPT_OUT_REQUESTED, REASON_DPO_PROTECTED_APP, REASON_DISALLOW_APPS_CONTROL, REASON_ACTIVE_DEVICE_ADMIN, }) @Retention(RetentionPolicy.SOURCE) public @interface ReasonCode {} Loading Loading @@ -669,6 +675,8 @@ public class PowerExemptionManager { return AppBackgroundRestrictionsInfo.REASON_DPO_PROTECTED_APP; case REASON_DISALLOW_APPS_CONTROL: return AppBackgroundRestrictionsInfo.REASON_DISALLOW_APPS_CONTROL; case REASON_ACTIVE_DEVICE_ADMIN: return AppBackgroundRestrictionsInfo.REASON_ACTIVE_DEVICE_ADMIN; default: return AppBackgroundRestrictionsInfo.REASON_DENIED; } Loading Loading @@ -818,6 +826,8 @@ public class PowerExemptionManager { return "DPO_PROTECTED_APP"; case REASON_DISALLOW_APPS_CONTROL: return "DISALLOW_APPS_CONTROL"; case REASON_ACTIVE_DEVICE_ADMIN: return "ACTIVE_DEVICE_ADMIN"; case REASON_OPT_OUT_REQUESTED: return "REASON_OPT_OUT_REQUESTED"; default: Loading
apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java +5 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,11 @@ public interface AppStandbyInternal { void setActiveAdminApps(Set<String> adminPkgs, int userId); /** * @return {@code true} if the given package is an active device admin app. */ boolean isActiveDeviceAdmin(String packageName, int userId); void onAdminDataAvailable(); void clearCarrierPrivilegedApps(); Loading
apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +2 −1 Original line number Diff line number Diff line Loading @@ -1799,7 +1799,8 @@ public class AppStandbyController } @VisibleForTesting boolean isActiveDeviceAdmin(String packageName, int userId) { @Override public boolean isActiveDeviceAdmin(String packageName, int userId) { synchronized (mActiveAdminApps) { final Set<String> adminPkgs = mActiveAdminApps.get(userId); return adminPkgs != null && adminPkgs.contains(packageName); Loading
core/proto/android/os/appbackgroundrestrictioninfo.proto +1 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ message AppBackgroundRestrictionsInfo { REASON_CARRIER_PRIVILEGED_APP = 321; REASON_DPO_PROTECTED_APP = 322; REASON_DISALLOW_APPS_CONTROL = 323; REASON_ACTIVE_DEVICE_ADMIN = 324; // app requested to be exempt REASON_OPT_OUT_REQUESTED = 1000; } Loading
packages/SystemUI/src/com/android/systemui/qs/FgsManagerController.kt +1 −0 Original line number Diff line number Diff line Loading @@ -462,6 +462,7 @@ class FgsManagerController @Inject constructor( PowerExemptionManager.REASON_DISALLOW_APPS_CONTROL, PowerExemptionManager.REASON_DPO_PROTECTED_APP, PowerExemptionManager.REASON_PROFILE_OWNER, PowerExemptionManager.REASON_ACTIVE_DEVICE_ADMIN, PowerExemptionManager.REASON_PROC_STATE_PERSISTENT, PowerExemptionManager.REASON_PROC_STATE_PERSISTENT_UI, PowerExemptionManager.REASON_ROLE_DIALER, Loading