Skip to content

Commit b5470d5

Browse files
Jean ChalardAndroid (Google) Code Review
authored andcommitted
Merge "Fix a warning from the binder, step 2."
2 parents a5142a8 + de9dbb0 commit b5470d5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

core/java/android/view/inputmethod/InputMethodManager.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)