am 123017cc: Merge "Wipe the application cache selectively" into jb-dev

* commit '123017cc74eddf16698889539f6274025ee30155':
  Wipe the application cache selectively
main
Jean Chalard 2012-05-25 04:09:12 -07:00 committed by Android Git Automerger
commit 250f6a44a7
2 changed files with 5 additions and 1 deletions

View File

@ -51,6 +51,8 @@ public class DictionaryPackInstallBroadcastReceiver extends BroadcastReceiver {
if (null == packageUri) return; // No package name : we can't do anything
final String packageName = packageUri.getSchemeSpecificPart();
if (null == packageName) return;
// TODO: do this in a more appropriate place
TargetApplicationGetter.removeApplicationInfoCache(packageName);
final PackageInfo packageInfo;
try {
packageInfo = manager.getPackageInfo(packageName, PackageManager.GET_PROVIDERS);

View File

@ -31,7 +31,9 @@ public class TargetApplicationGetter extends AsyncTask<String, Void, Application
public static ApplicationInfo getCachedApplicationInfo(final String packageName) {
return sCache.get(packageName);
}
// TODO: Wipe the cache when new packages are installed.
public static void removeApplicationInfoCache(final String packageName) {
sCache.remove(packageName);
}
public interface OnTargetApplicationKnownListener {
public void onTargetApplicationKnown(final ApplicationInfo info);