Fixing NPE in Workspace.removeItemsByPackageName() (Bug 8942242)
Change-Id: I1f63e548caa4b00b7166db4a53307c80650d8907
This commit is contained in:
@@ -3659,21 +3659,21 @@ public class Workspace extends SmoothPagedView
|
||||
if (tag instanceof ShortcutInfo) {
|
||||
ShortcutInfo info = (ShortcutInfo) tag;
|
||||
ComponentName cn = info.intent.getComponent();
|
||||
if (packageNames.contains(cn.getPackageName())) {
|
||||
if ((cn != null) && packageNames.contains(cn.getPackageName())) {
|
||||
cns.add(cn);
|
||||
}
|
||||
} else if (tag instanceof FolderInfo) {
|
||||
FolderInfo info = (FolderInfo) tag;
|
||||
for (ShortcutInfo s : info.contents) {
|
||||
ComponentName cn = s.intent.getComponent();
|
||||
if (packageNames.contains(cn.getPackageName())) {
|
||||
if ((cn != null) && packageNames.contains(cn.getPackageName())) {
|
||||
cns.add(cn);
|
||||
}
|
||||
}
|
||||
} else if (tag instanceof LauncherAppWidgetInfo) {
|
||||
LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) tag;
|
||||
ComponentName cn = info.providerName;
|
||||
if (packageNames.contains(cn.getPackageName())) {
|
||||
if ((cn != null) && packageNames.contains(cn.getPackageName())) {
|
||||
cns.add(cn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user