DO NOT MERGE - Add flag to turn on/off the headless user specific blacklist/whitelist am: 81ce02f510
Change-Id: If9928abe6f7af3f9ef2d4ba4375983a067357b76
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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() {
|
||||
boolean isHeadlessSystemUserMode = UserManager.isHeadlessSystemUserMode();
|
||||
if (!isHeadlessSystemUserMode && !UserManager.isSplitSystemUser()) {
|
||||
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)) {
|
||||
|
||||
Reference in New Issue
Block a user