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

Commit 50f4aefb authored by Pavel Grafov's avatar Pavel Grafov Committed by Android (Google) Code Review
Browse files

Merge "Clean up fully rolled out DisallowUserControlBgUsageFix" into main

parents ccaa6ea8 d60a73d9
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1989,12 +1989,10 @@ public class AppStandbyController
                mAdminProtectedPackages.put(userId, packageNames);
            }
        }
        if (android.app.admin.flags.Flags.disallowUserControlBgUsageFix()) {
        if (!Flags.avoidIdleCheck() || mInjector.getBootPhase() >= PHASE_BOOT_COMPLETED) {
            postCheckIdleStates(userId);
        }
    }
    }

    @Override
    public void onAdminDataAvailable() {
+0 −10
Original line number Diff line number Diff line
@@ -216,16 +216,6 @@ flag {
  }
}

flag {
  name: "disallow_user_control_bg_usage_fix"
  namespace: "enterprise"
  description: "Make DPM.setUserControlDisabledPackages() ensure background usage is allowed"
  bug: "326031059"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "disallow_user_control_stopped_state_fix"
  namespace: "enterprise"
+4 −6
Original line number Diff line number Diff line
@@ -136,13 +136,11 @@ public class PowerAllowlistBackend {
            return true;
        }

        if (android.app.admin.flags.Flags.disallowUserControlBgUsageFix()) {
        // App is subject to DevicePolicyManager.setUserControlDisabledPackages() policy.
        final int userId = UserHandle.getUserId(uid);
        if (mAppContext.getPackageManager().isPackageStateProtected(pkg, userId)) {
            return true;
        }
        }

        return false;
    }
+1 −3
Original line number Diff line number Diff line
@@ -238,9 +238,7 @@ final class PolicyEnforcerCallbacks {
            }

            for (int user : resolveUsers(userId)) {
                if (Flags.disallowUserControlBgUsageFix()) {
                setBgUsageAppOp(packages, pmi, user, appOpsManager);
                }
                if (Flags.disallowUserControlStoppedStateFix()) {
                    for (String packageName : packages) {
                        pmi.setPackageStoppedState(packageName, false, user);