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

Commit d60a73d9 authored by Pavel Grafov's avatar Pavel Grafov
Browse files

Clean up fully rolled out DisallowUserControlBgUsageFix

Flag was rolled out in Android V.

Bug: 335663055
Test: TH
Flag: EXEMPT flag cleanup
Change-Id: I8699ac50ae7538a2de98e0e892236eef5b0bdd89
parent 992ffb63
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);