Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0b364fb authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Hide the stop button for the device admin app in the task...

Merge "Merge "Hide the stop button for the device admin app in the task manager" into tm-dev am: d62d63b2 am: 86af120e am: 60cf6be1" into tm-qpr-dev-plus-aosp am: 7e4770c1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18567918



Change-Id: Idc636da03cf48c7bf709cd6854c9b4da9fc75dd2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f982c60a 7e4770c1
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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 {}
@@ -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;
        }
@@ -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:
+5 −0
Original line number Diff line number Diff line
@@ -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();
+2 −1
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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;
    }
+1 −0
Original line number Diff line number Diff line
@@ -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