OSDN Git Service

am fe1f3a1b: Merge "Fix ViewRootImpl to find missing focus using D-pad."
authorJeff Brown <jeffbrown@android.com>
Fri, 8 Feb 2013 23:49:46 +0000 (15:49 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Fri, 8 Feb 2013 23:49:46 +0000 (15:49 -0800)
# By Ki-Hwan Lee
# Via Gerrit Code Review (1) and Ki-Hwan Lee (1)
* commit 'fe1f3a1beff9f73f6a04bcc35239038a21bc38ff':
  Fix ViewRootImpl to find missing focus using D-pad.

1  2 
core/java/android/view/ViewRootImpl.java

@@@ -3749,8 -3790,16 +3749,15 @@@ public final class ViewRootImpl impleme
  
                      // Give the focused view a last chance to handle the dpad key.
                      if (mView.dispatchUnhandledMove(focused, direction)) {
 -                        finishInputEvent(q, true);
 -                        return;
 +                        return EVENT_HANDLED;
                      }
+                 } else {
+                     // find the best view to give focus to in this non-touch-mode with no-focus
+                     View v = focusSearch(null, direction);
+                     if (v != null && v.requestFocus(direction)) {
+                         finishInputEvent(q, true);
+                         return;
+                     }
                  }
              }
          }