Don't delete legacy shortcuts in loadWorkspace()

Legacy 1x1 shortcut intents have null package names.
This was causing an NPE when calling LauncherApps#getApplicationInfo(),
which caused those shortcuts to be removed from the workspace.

Bug: 37634887
Change-Id: I6d9876ee1634a573c1f0f94602ae373365cab01c
This commit is contained in:
Tony Wickham
2017-05-04 15:39:43 -07:00
parent 8f4a3963b0
commit 431a71320c
+2 -1
View File
@@ -1062,7 +1062,8 @@ public class LauncherModel extends BroadcastReceiver
info = c.loadSimpleShortcut();
// Shortcuts are only available on the primary profile
if (pmHelper.isAppSuspended(targetPkg, c.user)) {
if (!TextUtils.isEmpty(targetPkg)
&& pmHelper.isAppSuspended(targetPkg, c.user)) {
disabledState |= ShortcutInfo.FLAG_DISABLED_SUSPENDED;
}