diff options
author | Winson Chung <winsonc@google.com> | 2013-11-14 11:30:05 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-11-14 11:30:05 -0800 |
commit | fe9d96a39651de99819208e95c7ec7d432a402e0 (patch) | |
tree | 0b6a50f3c42784b5ea81efa91f08030e711a1e86 /src/com | |
parent | e248b83797e6b6ce128085560ad0c5b900413bf2 (diff) | |
download | android_packages_apps_Trebuchet-fe9d96a39651de99819208e95c7ec7d432a402e0.tar.gz android_packages_apps_Trebuchet-fe9d96a39651de99819208e95c7ec7d432a402e0.tar.bz2 android_packages_apps_Trebuchet-fe9d96a39651de99819208e95c7ec7d432a402e0.zip |
Require valid arrays when adding and binding new Apps. (Bug 11627095)
Change-Id: I8f2a4dc70bf376d804885f433ab20064823ebaac
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/InstallShortcutReceiver.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/launcher3/InstallShortcutReceiver.java b/src/com/android/launcher3/InstallShortcutReceiver.java index 835c472d4..fb75161fe 100644 --- a/src/com/android/launcher3/InstallShortcutReceiver.java +++ b/src/com/android/launcher3/InstallShortcutReceiver.java @@ -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>()); } } } diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index dff181426..ba1bcdb1e 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -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>()); } } |