diff options
| author | goneil <goneil@google.com> | 2018-02-28 15:22:08 -0800 |
|---|---|---|
| committer | Gil O'Neil <goneil@google.com> | 2018-03-13 17:23:04 +0000 |
| commit | 18928e90698e91d3491d73de8b2fa5ba6799f8e0 (patch) | |
| tree | e1a4dad8cd4dfea3180d8f19e6fa3662864db0e6 /core/java | |
| parent | b90670cf1752d79ffed020bf4653b300c417d57b (diff) | |
Migrate from config.xml to SystemConfig for disabled carrier apps
Move config_disabledUntilUsedPreinstalledCarrierApps from config.xml to
system config for pixel/nexus devices
Bug: 72999375
Test: Ensure Fi is disabled by default and enabled once the Fi SIM is
inserted
Change-Id: I594744f0cacdfefe20873118827fda501ec199fb
(cherry picked from commit eb31cd4bfed5ed23560d6618210c2ff8988ac25b)
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/server/SystemConfig.java | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java index c71e505c6790..c5be8e4a3aba 100644 --- a/core/java/com/android/server/SystemConfig.java +++ b/core/java/com/android/server/SystemConfig.java @@ -142,12 +142,24 @@ public class SystemConfig { // Package names that are exempted from private API blacklisting final ArraySet<String> mHiddenApiPackageWhitelist = new ArraySet<>(); + // The list of carrier applications which should be disabled until used. + // This function suppresses update notifications for these pre-installed apps. + // In SubscriptionInfoUpdater, the listed applications are disabled until used when all of the + // following conditions are met. + // 1. Not currently carrier-privileged according to the inserted SIM + // 2. Pre-installed + // 3. In the default state (enabled but not explicitly) + // And SubscriptionInfoUpdater undoes this and marks the app enabled when a SIM is inserted + // that marks the app as carrier privileged. It also grants the app default permissions + // for Phone and Location. As such, apps MUST only ever be added to this list if they + // obtain user consent to access their location through other means. + final ArraySet<String> mDisabledUntilUsedPreinstalledCarrierApps = new ArraySet<>(); + // These are the packages of carrier-associated apps which should be disabled until used until // a SIM is inserted which grants carrier privileges to that carrier app. final ArrayMap<String, List<String>> mDisabledUntilUsedPreinstalledCarrierAssociatedApps = new ArrayMap<>(); - final ArrayMap<String, ArraySet<String>> mPrivAppPermissions = new ArrayMap<>(); final ArrayMap<String, ArraySet<String>> mPrivAppDenyPermissions = new ArrayMap<>(); @@ -232,6 +244,10 @@ public class SystemConfig { return mBackupTransportWhitelist; } + public ArraySet<String> getDisabledUntilUsedPreinstalledCarrierApps() { + return mDisabledUntilUsedPreinstalledCarrierApps; + } + public ArrayMap<String, List<String>> getDisabledUntilUsedPreinstalledCarrierAssociatedApps() { return mDisabledUntilUsedPreinstalledCarrierAssociatedApps; } @@ -630,6 +646,18 @@ public class SystemConfig { associatedPkgs.add(pkgname); } XmlUtils.skipCurrentTag(parser); + } else if ("disabled-until-used-preinstalled-carrier-app".equals(name) + && allowAppConfigs) { + String pkgname = parser.getAttributeValue(null, "package"); + if (pkgname == null) { + Slog.w(TAG, + "<disabled-until-used-preinstalled-carrier-app> without " + + "package in " + permFile + " at " + + parser.getPositionDescription()); + } else { + mDisabledUntilUsedPreinstalledCarrierApps.add(pkgname); + } + XmlUtils.skipCurrentTag(parser); } else if ("privapp-permissions".equals(name) && allowPrivappPermissions) { // privapp permissions from system, vendor and product partitions are stored // separately. This is to prevent xml files in the vendor partition from |
