File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
core/java/android/view/inputmethod Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -384,14 +384,18 @@ public void handleMessage(Message msg) {
384384 }
385385 }
386386
387- class ControlledInputConnectionWrapper extends IInputConnectionWrapper {
388- public ControlledInputConnectionWrapper (Looper mainLooper , InputConnection conn ) {
387+ private static class ControlledInputConnectionWrapper extends IInputConnectionWrapper {
388+ private final InputMethodManager mParentInputMethodManager ;
389+
390+ public ControlledInputConnectionWrapper (final Looper mainLooper , final InputConnection conn ,
391+ final InputMethodManager inputMethodManager ) {
389392 super (mainLooper , conn );
393+ mParentInputMethodManager = inputMethodManager ;
390394 }
391395
392396 @ Override
393397 public boolean isActive () {
394- return mActive ;
398+ return mParentInputMethodManager . mActive ;
395399 }
396400 }
397401
@@ -439,7 +443,7 @@ public void setActive(boolean active) {
439443 mMainLooper = looper ;
440444 mH = new H (looper );
441445 mIInputContext = new ControlledInputConnectionWrapper (looper ,
442- mDummyInputConnection );
446+ mDummyInputConnection , this );
443447
444448 if (mInstance == null ) {
445449 mInstance = this ;
@@ -1016,7 +1020,7 @@ public void run() {
10161020 mCursorCandStart = -1 ;
10171021 mCursorCandEnd = -1 ;
10181022 mCursorRect .setEmpty ();
1019- servedContext = new ControlledInputConnectionWrapper (vh .getLooper (), ic );
1023+ servedContext = new ControlledInputConnectionWrapper (vh .getLooper (), ic , this );
10201024 } else {
10211025 servedContext = null ;
10221026 }
You can’t perform that action at this time.
0 commit comments