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

Commit 26905ee0 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

DO NOT MERGE - Add flag to turn on/off the headless user specific...

DO NOT MERGE - Add flag to turn on/off the headless user specific blacklist/whitelist am: 81ce02f5

Change-Id: If9928abe6f7af3f9ef2d4ba4375983a067357b76
parents 55c7b67d 81ce02f5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1717,6 +1717,9 @@
         This feature should be disabled for most devices. -->
    <integer name="config_virtualKeyQuietTimeMillis">0</integer>

    <!-- Flag indicating whether system user specific blacklist/whitelist is supported -->
    <bool name="config_systemUserPackagesBlacklistSupported">false</bool>

    <!-- A list of potential packages, in priority order, that may contain an
         ephemeral resolver. Each package will be be queried for a component
         that has been granted the PACKAGE_EPHEMERAL_AGENT permission.
+1 −0
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@
  <java-symbol type="bool" name="config_mobile_data_capable" />
  <java-symbol type="bool" name="config_suspendWhenScreenOffDueToProximity" />
  <java-symbol type="bool" name="config_swipeDisambiguation" />
  <java-symbol type="bool" name="config_systemUserPackagesBlacklistSupported" />
  <java-symbol type="bool" name="config_syncstorageengine_masterSyncAutomatically" />
  <java-symbol type="bool" name="config_ui_enableFadingMarquee" />
  <java-symbol type="bool" name="config_enableHapticTextHandle" />
+19 −0
Original line number Diff line number Diff line
@@ -2362,12 +2362,26 @@ public class PackageManagerService extends IPackageManager.Stub
        return m;
    }
    private boolean isSystemUserPackagesBlacklistSupported() {
        return Resources.getSystem().getBoolean(
              R.bool.config_systemUserPackagesBlacklistSupported);
    }
    private void enableSystemUserPackages() {
        if (!isSystemUserPackagesBlacklistSupported()) {
            Log.i(TAG, "Skipping system user blacklist since "
                    + "config_systemUserPackagesBlacklistSupported is false");
            return;
        }
        boolean isHeadlessSystemUserMode = UserManager.isHeadlessSystemUserMode();
        if (!isHeadlessSystemUserMode && !UserManager.isSplitSystemUser()) {
            Log.i(TAG, "Skipping system user blacklist on 'regular' device type");
            return;
        }
        Log.i(TAG, "blacklisting packages for system user");
        Set<String> enableApps = new ArraySet<>();
        AppsQueryHelper queryHelper = new AppsQueryHelper(this);
        List<String> allAps = queryHelper.queryApps(0, /* systemAppsOnly */ false,
@@ -21703,6 +21717,11 @@ public class PackageManagerService extends IPackageManager.Stub
            if (dumpState.isDumping(DumpState.DUMP_PACKAGES)) {
                mSettings.dumpPackagesLPr(pw, packageName, permissionNames, dumpState, checkin);
                boolean systemUserPackagesBlacklistSupported =
                        isSystemUserPackagesBlacklistSupported();
                pw.println("isSystemUserPackagesBlacklistSupported: "
                        + systemUserPackagesBlacklistSupported);
            }
            if (dumpState.isDumping(DumpState.DUMP_SHARED_USERS)) {