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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user