summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-05-04 17:22:49 -0700
committerDianne Hackborn <hackbod@google.com>2010-05-04 17:22:49 -0700
commit4416c3d6e4becd9ed39b89a03db0239c8225a135 (patch)
treeee83724da376bd99e2a35880c87522a20e2572da /services
parent5e5202bd6f9e7687fc6399762529b0ef5625e515 (diff)
downloadframeworks_base-4416c3d6e4becd9ed39b89a03db0239c8225a135.zip
frameworks_base-4416c3d6e4becd9ed39b89a03db0239c8225a135.tar.gz
frameworks_base-4416c3d6e4becd9ed39b89a03db0239c8225a135.tar.bz2
Fix issue #2643754: Launcher is caching widget layouts for too long
With the .apk file names now changing during an update, we need to make sure to flush all caches related to a package when the package is removed. Otherwise we can continue to use the old package, since its old file may still exist if we try to load it too soon. Change-Id: I15f08dffca3feac999dbca4f24bef12a30ca0a66
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 8383ca3..706e15a 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -12269,6 +12269,18 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
}
}
+ private final void sendPackageBroadcastLocked(int cmd, String[] packages) {
+ for (int i = mLruProcesses.size() - 1 ; i >= 0 ; i--) {
+ ProcessRecord r = mLruProcesses.get(i);
+ if (r.thread != null) {
+ try {
+ r.thread.dispatchPackageBroadcast(cmd, packages);
+ } catch (RemoteException ex) {
+ }
+ }
+ }
+ }
+
private final int broadcastIntentLocked(ProcessRecord callerApp,
String callerPackage, Intent intent, String resolvedType,
IIntentReceiver resultTo, int resultCode, String resultData,
@@ -12315,6 +12327,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
for (String pkg : list) {
forceStopPackageLocked(pkg, -1, false, true, true);
}
+ sendPackageBroadcastLocked(
+ IApplicationThread.EXTERNAL_STORAGE_UNAVAILABLE, list);
}
} else {
Uri data = intent.getData();
@@ -12324,6 +12338,10 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
forceStopPackageLocked(ssp,
intent.getIntExtra(Intent.EXTRA_UID, -1), false, true, true);
}
+ if (intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction())) {
+ sendPackageBroadcastLocked(IApplicationThread.PACKAGE_REMOVED,
+ new String[] {ssp});
+ }
}
}
}