Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe9d96a3 authored by Winson Chung's avatar Winson Chung
Browse files

Require valid arrays when adding and binding new Apps. (Bug 11627095)

Change-Id: I8f2a4dc70bf376d804885f433ab20064823ebaac
parent e248b837
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -283,6 +283,9 @@ public class LauncherModel extends BroadcastReceiver {
    }
    public void addAndBindAddedApps(final Context context, final ArrayList<ItemInfo> workspaceApps,
                                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>());
            }
        }