Merge "Require valid arrays when adding and binding new Apps. (Bug 11627095)" into jb-ub-now-jolly-elf

This commit is contained in:
Winson Chung
2013-11-14 19:50:28 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 3 deletions
@@ -294,7 +294,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
// Add the new apps to the model and bind them
if (!addShortcuts.isEmpty()) {
LauncherAppState app = LauncherAppState.getInstance();
app.getModel().addAndBindAddedApps(context, addShortcuts, null);
app.getModel().addAndBindAddedApps(context, addShortcuts, new ArrayList<AppInfo>());
}
}
}
+5 -2
View File
@@ -282,7 +282,10 @@ public class LauncherModel extends BroadcastReceiver {
addAndBindAddedApps(context, workspaceApps, cb, allAppsApps);
}
public void addAndBindAddedApps(final Context context, final ArrayList<ItemInfo> workspaceApps,
final Callbacks callbacks, final ArrayList<AppInfo> allAppsApps) {
final Callbacks callbacks, final ArrayList<AppInfo> allAppsApps) {
if (workspaceApps == null || allAppsApps == null) {
throw new RuntimeException("workspaceApps and allAppsApps must not be null");
}
if (workspaceApps.isEmpty() && allAppsApps.isEmpty()) {
return;
}
@@ -1508,7 +1511,7 @@ public class LauncherModel extends BroadcastReceiver {
}
if (!added.isEmpty()) {
Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
addAndBindAddedApps(context, added, cb, null);
addAndBindAddedApps(context, added, cb, new ArrayList<AppInfo>());
}
}