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

Commit 785758b1 authored by Alex Johnston's avatar Alex Johnston Committed by Android (Google) Code Review
Browse files

Merge "Use OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS for exempting app standby"

parents 28ad0bee e3d8ae1e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ public class AppStandbyController

    /**
     * Map of uids to their current app-op mode for
     * {@link AppOpsManager#OPSTR_SYSTEM_EXEMPT_FROM_APP_STANDBY}.
     * {@link AppOpsManager#OPSTR_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS}.
     */
    @GuardedBy("mSystemExemptionAppOpMode")
    private final SparseIntArray mSystemExemptionAppOpMode = new SparseIntArray();
@@ -670,7 +670,7 @@ public class AppStandbyController
            IAppOpsService iAppOpsService = mInjector.getAppOpsService();
            try {
                iAppOpsService.startWatchingMode(
                        AppOpsManager.OP_SYSTEM_EXEMPT_FROM_APP_STANDBY,
                        AppOpsManager.OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS,
                        /*packageName=*/ null,
                        new IAppOpsCallback.Stub() {
                            @Override
@@ -1482,7 +1482,8 @@ public class AppStandbyController
                    }
                } else {
                    int mode = mAppOpsManager.checkOpNoThrow(
                            AppOpsManager.OP_SYSTEM_EXEMPT_FROM_APP_STANDBY, uid, packageName);
                            AppOpsManager.OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS, uid,
                            packageName);
                    mSystemExemptionAppOpMode.put(uid, mode);
                    if (mode == AppOpsManager.MODE_ALLOWED) {
                        return STANDBY_BUCKET_EXEMPTED;