diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-09-01 16:24:14 +0700 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-09-01 16:25:24 +0100 |
commit | f9e4ad62d692f5b0afc1be62080012f93a73a386 (patch) | |
tree | ea472be03d768116d00915545a27f2505c669c48 /services | |
parent | 39e05c74197bf54ba89f025ae98bfa16387234f6 (diff) | |
download | frameworks_base-f9e4ad62d692f5b0afc1be62080012f93a73a386.zip frameworks_base-f9e4ad62d692f5b0afc1be62080012f93a73a386.tar.gz frameworks_base-f9e4ad62d692f5b0afc1be62080012f93a73a386.tar.bz2 |
PackageManager: allow build-time disabling of components
Allow components to be specified as disabled at build time
(applied on boot).
This allows stock OTA components to be marked as disabled in
CM builds.
Change-Id: I6e4499cc40a779792a5ea97a10137399dad7d69f
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/pm/PackageManagerService.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 0c09a7e..41e68f8 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -1323,6 +1323,21 @@ public class PackageManagerService extends IPackageManager.Stub { ? (UPDATE_PERMISSIONS_REPLACE_PKG|UPDATE_PERMISSIONS_REPLACE_ALL) : 0)); + // Disable components marked for disabling at build-time + for (String name : mContext.getResources().getStringArray( + com.android.internal.R.array.config_disabledComponents)) { + ComponentName cn = ComponentName.unflattenFromString(name); + Slog.v(TAG, "Disabling " + name); + String className = cn.getClassName(); + PackageSetting pkgSetting = mSettings.mPackages.get(cn.getPackageName()); + if (pkgSetting == null || pkgSetting.pkg == null + || !pkgSetting.pkg.hasComponentClassName(className)) { + Slog.w(TAG, "Unable to disable " + name); + continue; + } + pkgSetting.disableComponentLPw(className, UserHandle.USER_OWNER); + } + // can downgrade to reader mSettings.writeLPr(); |