summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-07-26 13:19:38 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-07-26 13:19:38 -0700
commit13f011e35299ed071ecfeb3573a95ddbae5285d3 (patch)
treeb51c821eea8332a906d311761d564ccce76eebdb /src
parentab962b75eeb9f956ac2eb1b00e66f6cca492010e (diff)
parent2d86dfec5797bfd4fba78562032c14bd9b6cfa7a (diff)
downloadandroid_packages_apps_Trebuchet-13f011e35299ed071ecfeb3573a95ddbae5285d3.tar.gz
android_packages_apps_Trebuchet-13f011e35299ed071ecfeb3573a95ddbae5285d3.tar.bz2
android_packages_apps_Trebuchet-13f011e35299ed071ecfeb3573a95ddbae5285d3.zip
am 2d86dfec: Fix launcher updating when all of an app\'s activities disappear.
Merge commit '2d86dfec5797bfd4fba78562032c14bd9b6cfa7a' * commit '2d86dfec5797bfd4fba78562032c14bd9b6cfa7a': Fix launcher updating when all of an app's activities disappear.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AllAppsList.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/com/android/launcher2/AllAppsList.java b/src/com/android/launcher2/AllAppsList.java
index 3bacd87e0..e5d878226 100644
--- a/src/com/android/launcher2/AllAppsList.java
+++ b/src/com/android/launcher2/AllAppsList.java
@@ -149,6 +149,17 @@ class AllAppsList {
modified.add(applicationInfo);
}
}
+ } else {
+ // Remove all data for this package.
+ for (int i = data.size() - 1; i >= 0; i--) {
+ final ApplicationInfo applicationInfo = data.get(i);
+ final ComponentName component = applicationInfo.intent.getComponent();
+ if (packageName.equals(component.getPackageName())) {
+ removed.add(applicationInfo);
+ mIconCache.remove(component);
+ data.remove(i);
+ }
+ }
}
}
@@ -160,23 +171,10 @@ class AllAppsList {
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
+ mainIntent.setPackage(packageName);
final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0);
- final List<ResolveInfo> matches = new ArrayList<ResolveInfo>();
-
- if (apps != null) {
- // Find all activities that match the packageName
- int count = apps.size();
- for (int i = 0; i < count; i++) {
- final ResolveInfo info = apps.get(i);
- final ActivityInfo activityInfo = info.activityInfo;
- if (packageName.equals(activityInfo.packageName)) {
- matches.add(info);
- }
- }
- }
-
- return matches;
+ return apps != null ? apps : new ArrayList<ResolveInfo>();
}
/**