summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-11-14 11:30:05 -0800
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:18 -0700
commit2912b082d171809423f676f84ca0bc7d2639a133 (patch)
tree02080aeb2194112a8cc8870ec75dda423cb6cc0c /src/com/android
parent57529fe246212966da65700afa20fc135c2bbc88 (diff)
downloadandroid_packages_apps_Trebuchet-2912b082d171809423f676f84ca0bc7d2639a133.tar.gz
android_packages_apps_Trebuchet-2912b082d171809423f676f84ca0bc7d2639a133.tar.bz2
android_packages_apps_Trebuchet-2912b082d171809423f676f84ca0bc7d2639a133.zip
Require valid arrays when adding and binding new Apps. (Bug 11627095)
Change-Id: I8f2a4dc70bf376d804885f433ab20064823ebaac
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/InstallShortcutReceiver.java2
-rw-r--r--src/com/android/launcher3/LauncherModel.java7
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 08f562d49..a8adf4c03 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -291,7 +291,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;
}
@@ -1639,7 +1642,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>());
}
}