Fixing issue where updating the visibility of one application can trigger all icons to disappear. (Bug 8757421)

- Also queueing bindComponentsRemoved() and bindPackagesUpdated() to wait for resume (Bug 8594153)

Change-Id: I44028fe79f6fa6bcd6b829e36f3f5b9ed756dc4d
This commit is contained in:
Winson Chung
2013-05-01 16:53:33 -07:00
parent 81426b9bfe
commit 83892cc076
7 changed files with 114 additions and 63 deletions
@@ -1556,16 +1556,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
return -1;
}
private int findAppByPackage(List<ApplicationInfo> list, String packageName) {
int length = list.size();
for (int i = 0; i < length; ++i) {
ApplicationInfo info = list.get(i);
if (ItemInfo.getPackageName(info.intent).equals(packageName)) {
return i;
}
}
return -1;
}
private void removeAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) {
// loop through all the apps and remove apps that have the same component
int length = list.size();
@@ -1577,18 +1567,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
}
private void removeAppsWithPackageNameWithoutInvalidate(ArrayList<String> packageNames) {
// loop through all the package names and remove apps that have the same package name
for (String pn : packageNames) {
int removeIndex = findAppByPackage(mApps, pn);
while (removeIndex > -1) {
mApps.remove(removeIndex);
removeIndex = findAppByPackage(mApps, pn);
}
}
}
public void removeApps(ArrayList<String> packageNames) {
removeAppsWithPackageNameWithoutInvalidate(packageNames);
public void removeApps(ArrayList<ApplicationInfo> appInfos) {
removeAppsWithoutInvalidate(appInfos);
updatePageCounts();
invalidateOnDataChange();
}