Wipe the application cache selectively
Bug: 6537051 Change-Id: I839d0a98c729f3604582946d70c0140a5cff7dcfmain
parent
1b1243d61f
commit
eb696d288e
|
@ -51,6 +51,8 @@ public class DictionaryPackInstallBroadcastReceiver extends BroadcastReceiver {
|
||||||
if (null == packageUri) return; // No package name : we can't do anything
|
if (null == packageUri) return; // No package name : we can't do anything
|
||||||
final String packageName = packageUri.getSchemeSpecificPart();
|
final String packageName = packageUri.getSchemeSpecificPart();
|
||||||
if (null == packageName) return;
|
if (null == packageName) return;
|
||||||
|
// TODO: do this in a more appropriate place
|
||||||
|
TargetApplicationGetter.removeApplicationInfoCache(packageName);
|
||||||
final PackageInfo packageInfo;
|
final PackageInfo packageInfo;
|
||||||
try {
|
try {
|
||||||
packageInfo = manager.getPackageInfo(packageName, PackageManager.GET_PROVIDERS);
|
packageInfo = manager.getPackageInfo(packageName, PackageManager.GET_PROVIDERS);
|
||||||
|
|
|
@ -31,7 +31,9 @@ public class TargetApplicationGetter extends AsyncTask<String, Void, Application
|
||||||
public static ApplicationInfo getCachedApplicationInfo(final String packageName) {
|
public static ApplicationInfo getCachedApplicationInfo(final String packageName) {
|
||||||
return sCache.get(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 interface OnTargetApplicationKnownListener {
|
||||||
public void onTargetApplicationKnown(final ApplicationInfo info);
|
public void onTargetApplicationKnown(final ApplicationInfo info);
|
||||||
|
|
Loading…
Reference in New Issue