am 18859947: Merge "Fix issue #4021524 HMI63B: "Force stop" button not disabled after app is stopped" into honeycomb-mr1

* commit '18859947ea2899197e1621e154aab6bceb14d406':
  Fix issue #4021524 HMI63B: "Force stop" button not disabled after app is stopped
This commit is contained in:
Dianne Hackborn
2011-03-08 14:53:03 -08:00
committed by Android Git Automerger
2 changed files with 12 additions and 4 deletions

View File

@@ -248,8 +248,7 @@ public class ApplicationsState {
} else if (Intent.ACTION_PACKAGE_CHANGED.equals(actionStr)) {
Uri data = intent.getData();
String pkgName = data.getEncodedSchemeSpecificPart();
removePackage(pkgName);
addPackage(pkgName);
invalidatePackage(pkgName);
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(actionStr) ||
Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(actionStr)) {
// When applications become available or unavailable (perhaps because
@@ -266,8 +265,7 @@ public class ApplicationsState {
boolean avail = Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(actionStr);
if (avail) {
for (String pkgName : pkgList) {
removePackage(pkgName);
addPackage(pkgName);
invalidatePackage(pkgName);
}
}
}
@@ -624,6 +622,11 @@ public class ApplicationsState {
}
}
void invalidatePackage(String pkgName) {
removePackage(pkgName);
addPackage(pkgName);
}
AppEntry getEntryLocked(ApplicationInfo info) {
AppEntry entry = mEntriesMap.get(info.packageName);
if (DEBUG) Log.i(TAG, "Looking up entry of pkg " + info.packageName + ": " + entry);

View File

@@ -736,6 +736,11 @@ public class InstalledAppDetails extends Fragment
ActivityManager am = (ActivityManager)getActivity().getSystemService(
Context.ACTIVITY_SERVICE);
am.forceStopPackage(pkgName);
mState.invalidatePackage(pkgName);
ApplicationsState.AppEntry newEnt = mState.getEntry(pkgName);
if (newEnt != null) {
mAppEntry = newEnt;
}
checkForceStop();
}