File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 1919import android .content .Context ;
2020import android .util .AttributeSet ;
2121import android .view .inputmethod .ExtractedText ;
22+ import android .view .inputmethod .InputMethodManager ;
2223import android .widget .EditText ;
2324
2425/***
@@ -142,4 +143,17 @@ public boolean hasVerticalScrollBar() {
142143 @ Override public boolean hasFocus () {
143144 return this .isEnabled ();
144145 }
146+
147+ /**
148+ * @hide
149+ */
150+ @ Override protected void viewClicked (InputMethodManager imm ) {
151+ // As an instance of this class is supposed to be owned by IMS,
152+ // and it has a reference to the IMS (the current IME),
153+ // we just need to call back its onViewClicked() here.
154+ // It should be good to avoid unnecessary IPCs by doing this as well.
155+ if (mIME != null ) {
156+ mIME .onViewClicked (false );
157+ }
158+ }
145159}
Original file line number Diff line number Diff line change @@ -5432,8 +5432,8 @@ public boolean onKeyUp(int keyCode, KeyEvent event) {
54325432 if (mMovement != null && mText instanceof Editable
54335433 && mLayout != null && onCheckIsTextEditor ()) {
54345434 InputMethodManager imm = InputMethodManager .peekInstance ();
5435+ viewClicked (imm );
54355436 if (imm != null ) {
5436- imm .viewClicked (this );
54375437 imm .showSoftInput (this , 0 );
54385438 }
54395439 }
@@ -8346,9 +8346,7 @@ public boolean onTouchEvent(MotionEvent event) {
83468346 if (touchIsFinished && (isTextEditable () || mTextIsSelectable )) {
83478347 // Show the IME, except when selecting in read-only text.
83488348 final InputMethodManager imm = InputMethodManager .peekInstance ();
8349- if (imm != null ) {
8350- imm .viewClicked (this );
8351- }
8349+ viewClicked (imm );
83528350 if (!mTextIsSelectable ) {
83538351 handled |= imm != null && imm .showSoftInput (this , 0 );
83548352 }
@@ -11310,6 +11308,15 @@ protected void resetResolvedDrawables() {
1131011308 mResolvedDrawables = false ;
1131111309 }
1131211310
11311+ /**
11312+ * @hide
11313+ */
11314+ protected void viewClicked (InputMethodManager imm ) {
11315+ if (imm != null ) {
11316+ imm .viewClicked (this );
11317+ }
11318+ }
11319+
1131311320 @ ViewDebug .ExportedProperty (category = "text" )
1131411321 private CharSequence mText ;
1131511322 private CharSequence mTransformed ;
You can’t perform that action at this time.
0 commit comments