fix bug 2200625 - NPE at com.android.launcher2.AllAppsView.onTouchEvent(AllAppsView.java:259) on Passion
There's no need to do selection if we're not visible.
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 2dd3b4d..f5fdd36 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -192,6 +192,11 @@
@Override
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
+
+ if (!isVisible()) {
+ return;
+ }
+
if (gainFocus) {
if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
// Select the first icon when we gain keyboard focus
@@ -212,6 +217,10 @@
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (!isVisible()) {
+ return false;
+ }
+
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) {
if (mArrowNavigation) {
int whichApp = mRollo.mState.selectedIconIndex;