Handle IME hide internal state correctly.
IME process is notified after client has hidden the IME. At this point IME should call doHideWindow() so internal lifecycle methods are called the way they were called earlier. Also, with insets we don't hide the decorView of IME window till client is unbound, so to be consistent with previous behavior, call windowVisibilityChanged(View.GONE) explicitly. Fix: 151125925 Test: atest KeyboardVisibilityTest InputMethodServiceTest Change-Id: Ibe9a02b93489370b6ae9b497993e366f88791a62
This commit is contained in:
@@ -878,8 +878,7 @@ public class InputMethodService extends AbstractInputMethodService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void notifyImeHidden() {
|
private void notifyImeHidden() {
|
||||||
setImeWindowStatus(IME_ACTIVE | IME_INVISIBLE, mBackDisposition);
|
doHideWindow();
|
||||||
onPreRenderedWindowVisibilityChanged(false /* setVisible */);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeImeSurface() {
|
private void removeImeSurface() {
|
||||||
@@ -2284,7 +2283,9 @@ public class InputMethodService extends AbstractInputMethodService {
|
|||||||
if (mDecorViewVisible) {
|
if (mDecorViewVisible) {
|
||||||
// When insets API is enabled, it is responsible for client and server side
|
// When insets API is enabled, it is responsible for client and server side
|
||||||
// visibility of IME window.
|
// visibility of IME window.
|
||||||
if (!isVisibilityAppliedUsingInsetsConsumer()) {
|
if (isVisibilityAppliedUsingInsetsConsumer()) {
|
||||||
|
mInputView.dispatchWindowVisibilityChanged(View.GONE);
|
||||||
|
} else {
|
||||||
mWindow.hide();
|
mWindow.hide();
|
||||||
}
|
}
|
||||||
mDecorViewVisible = false;
|
mDecorViewVisible = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user