diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-07-24 16:32:42 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-07-24 16:34:00 -0700 |
commit | 46730fc78388607fd562044cbaaa26ffc9f65337 (patch) | |
tree | 460661e109dcae2b1cae10d77cb287ac37ed6892 /services | |
parent | 3bee5af8162c177f8c8f4199489a401058ab26a9 (diff) | |
download | frameworks_base-46730fc78388607fd562044cbaaa26ffc9f65337.zip frameworks_base-46730fc78388607fd562044cbaaa26ffc9f65337.tar.gz frameworks_base-46730fc78388607fd562044cbaaa26ffc9f65337.tar.bz2 |
Fix handling of application disabled state.
Change-Id: I617b76e89eeb75437b384b92f1205bb00b15bb70
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/PackageManagerService.java | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 11d0b7a..9d8c072 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -1495,6 +1495,7 @@ class PackageManagerService extends IPackageManager.Stub { ps.pkg.applicationInfo.publicSourceDir = ps.resourcePathString; ps.pkg.applicationInfo.sourceDir = ps.codePathString; ps.pkg.applicationInfo.dataDir = getDataPathForPackage(ps.pkg).getPath(); + ps.pkg.mSetEnabled = ps.enabled; } return generatePackageInfo(ps.pkg, flags); } @@ -6875,6 +6876,7 @@ class PackageManagerService extends IPackageManager.Stub { return; } pkgSetting.enabled = newState; + pkgSetting.pkg.mSetEnabled = newState; } else { // We're dealing with a component level state change switch (newState) { @@ -8261,6 +8263,7 @@ class PackageManagerService extends IPackageManager.Stub { private void insertPackageSettingLP(PackageSetting p, PackageParser.Package pkg) { p.pkg = pkg; + pkg.mSetEnabled = p.enabled; String codePath = pkg.applicationInfo.sourceDir; String resourcePath = pkg.applicationInfo.publicSourceDir; // Update code path if needed @@ -9486,6 +9489,9 @@ class PackageManagerService extends IPackageManager.Stub { } boolean isEnabledLP(ComponentInfo componentInfo, int flags) { + if ((flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) { + return true; + } final PackageSetting packageSettings = mPackages.get(componentInfo.packageName); if (Config.LOGV) { Log.v(TAG, "isEnabledLock - packageName = " + componentInfo.packageName @@ -9501,14 +9507,20 @@ class PackageManagerService extends IPackageManager.Stub { Debug.waitForDebugger(); Log.i(TAG, "We will crash!"); } + return false; + } + if (packageSettings.enabled == COMPONENT_ENABLED_STATE_DISABLED + || (packageSettings.pkg != null && !packageSettings.pkg.applicationInfo.enabled + && packageSettings.enabled == COMPONENT_ENABLED_STATE_DEFAULT)) { + return false; + } + if (packageSettings.enabledComponents.contains(componentInfo.name)) { + return true; + } + if (packageSettings.disabledComponents.contains(componentInfo.name)) { + return false; } - return ((flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) - || ((componentInfo.enabled - && ((packageSettings.enabled == COMPONENT_ENABLED_STATE_ENABLED) - || (componentInfo.applicationInfo.enabled - && packageSettings.enabled != COMPONENT_ENABLED_STATE_DISABLED)) - && !packageSettings.disabledComponents.contains(componentInfo.name)) - || packageSettings.enabledComponents.contains(componentInfo.name)); + return componentInfo.enabled; } } |