Skip to content

Commit d422ade

Browse files
satok16Android (Google) Code Review
authored andcommitted
Merge "Fix the issue that the ime switch icon is remaining after closing VoiceInput" into jb-dev
2 parents 2c21449 + 2f913d9 commit d422ade

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

core/java/android/inputmethodservice/InputMethodService.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public void hideSoftInput(int flags, ResultReceiver resultReceiver) {
402402
mShowInputFlags = 0;
403403
mShowInputRequested = false;
404404
mShowInputForced = false;
405-
hideWindow();
405+
doHideWindow();
406406
if (resultReceiver != null) {
407407
resultReceiver.send(wasVis != isInputViewShown()
408408
? InputMethodManager.RESULT_HIDDEN
@@ -737,15 +737,15 @@ void initViews() {
737737
onDisplayCompletions(completions);
738738
}
739739
} else {
740-
hideWindow();
740+
doHideWindow();
741741
}
742742
} else if (mCandidatesVisibility == View.VISIBLE) {
743743
// If the candidates are currently visible, make sure the
744744
// window is shown for them.
745745
showWindow(false);
746746
} else {
747747
// Otherwise hide the window.
748-
hideWindow();
748+
doHideWindow();
749749
}
750750
// If user uses hard keyboard, IME button should always be shown.
751751
boolean showing = onEvaluateInputViewShown();
@@ -1096,7 +1096,7 @@ public void setCandidatesViewShown(boolean shown) {
10961096
if (shown) {
10971097
showWindow(false);
10981098
} else {
1099-
hideWindow();
1099+
doHideWindow();
11001100
}
11011101
}
11021102
}
@@ -1449,9 +1449,13 @@ private void finishViews() {
14491449
mCandidatesViewStarted = false;
14501450
}
14511451

1452+
private void doHideWindow() {
1453+
mImm.setImeWindowStatus(mToken, 0, mBackDisposition);
1454+
hideWindow();
1455+
}
1456+
14521457
public void hideWindow() {
14531458
finishViews();
1454-
mImm.setImeWindowStatus(mToken, 0, mBackDisposition);
14551459
if (mWindowVisible) {
14561460
mWindow.hide();
14571461
mWindowVisible = false;
@@ -1703,7 +1707,7 @@ private boolean handleBack(boolean doIt) {
17031707
// If we have the window visible for some other reason --
17041708
// most likely to show candidates -- then just get rid
17051709
// of it. This really shouldn't happen, but just in case...
1706-
if (doIt) hideWindow();
1710+
if (doIt) doHideWindow();
17071711
}
17081712
return true;
17091713
}

0 commit comments

Comments
 (0)