Skip to content

Commit 06fd472

Browse files
jreckAndroid (Google) Code Review
authored andcommitted
Merge "Fix a bug with enterTouchMode removing focus"
2 parents c5cbcb5 + 09dd116 commit 06fd472

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/java/android/view/ViewRootImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,7 +2977,10 @@ private boolean enterTouchMode() {
29772977
// be when the window is first being added, and mFocused isn't
29782978
// set yet.
29792979
final View focused = mView.findFocus();
2980-
if (focused != null && !focused.isFocusableInTouchMode()) {
2980+
if (focused != null) {
2981+
if (focused.isFocusableInTouchMode()) {
2982+
return true;
2983+
}
29812984
final ViewGroup ancestorToTakeFocus =
29822985
findAncestorToTakeFocusInTouchMode(focused);
29832986
if (ancestorToTakeFocus != null) {

0 commit comments

Comments
 (0)