diff options
author | Michael Jurka <mikejurka@google.com> | 2012-06-18 14:38:48 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-18 14:38:48 -0700 |
commit | d74389d9027a128da85be151670ee43e55feaba5 (patch) | |
tree | 1cfb394d6928dc2d9f9770188aa716b14eadc9f4 /src/com/android/launcher2 | |
parent | a71d745ab3449c29f86aa2da8e1848d6edf40dbe (diff) | |
parent | 5649c287039ea7908112b41604c3fc2893c4697e (diff) | |
download | packages_apps_trebuchet-d74389d9027a128da85be151670ee43e55feaba5.zip packages_apps_trebuchet-d74389d9027a128da85be151670ee43e55feaba5.tar.gz packages_apps_trebuchet-d74389d9027a128da85be151670ee43e55feaba5.tar.bz2 |
Merge "Add null pointer checks to fix NPEs" into jb-dev
Diffstat (limited to 'src/com/android/launcher2')
-rw-r--r-- | src/com/android/launcher2/Folder.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/InstallShortcutReceiver.java | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index 1163f9e..de2e435 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -923,7 +923,9 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList private void onCloseComplete() { DragLayer parent = (DragLayer) getParent(); - parent.removeView(this); + if (parent != null) { + parent.removeView(this); + } mDragController.removeDropTarget((DropTarget) this); clearFocus(); mFolderIcon.requestFocus(); diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java index 54ba7de..a525d00 100644 --- a/src/com/android/launcher2/InstallShortcutReceiver.java +++ b/src/com/android/launcher2/InstallShortcutReceiver.java @@ -169,6 +169,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver { if (intent.getAction() == null) { intent.setAction(Intent.ACTION_VIEW); } else if (intent.getAction().equals(Intent.ACTION_MAIN) && + intent.getCategories() != null && intent.getCategories().contains(Intent.CATEGORY_LAUNCHER)) { intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); |