Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 109eb275 authored by Justin Ghan's avatar Justin Ghan Committed by Android (Google) Code Review
Browse files

Merge "Check getShowSoftInputOnFocus() for stylus input" into main

parents ea5d4892 26f96a62
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -178,3 +178,13 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "handwriting_unsupported_show_soft_input_fix"
  namespace: "text"
  description: "Don't show soft keyboard on stylus input if text field doesn't support handwriting and getShowSoftInputOnFocus() returns false."
  bug: "363180475"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+6 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.view;
import static com.android.text.flags.Flags.handwritingCursorPosition;
import static com.android.text.flags.Flags.handwritingTrackDisabled;
import static com.android.text.flags.Flags.handwritingUnsupportedMessage;
import static com.android.text.flags.Flags.handwritingUnsupportedShowSoftInputFix;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
@@ -241,7 +242,11 @@ public class HandwritingInitiator {
                            if (!candidateView.hasFocus()) {
                                requestFocusWithoutReveal(candidateView);
                            }
                            if (!handwritingUnsupportedShowSoftInputFix()
                                    || (candidateView instanceof TextView tv
                                            && tv.getShowSoftInputOnFocus())) {
                                mImm.showSoftInput(candidateView, 0);
                            }
                            mState.mHandled = true;
                            mState.mShouldInitHandwriting = false;
                            motionEvent.setAction((motionEvent.getAction()