Merge "Reset IME show request when hide is requested"
This commit is contained in:
@@ -56,8 +56,6 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
|
||||
if (mIsImeLayoutDrawn && mShowImeRunner != null) {
|
||||
// Show IME if InputMethodService requested to be shown and it's layout has finished.
|
||||
mShowImeRunner.run();
|
||||
mIsImeLayoutDrawn = false;
|
||||
mShowImeRunner = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,10 +72,19 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
|
||||
mDisplayContent.mInputMethodTarget.showInsets(
|
||||
WindowInsets.Type.ime(), true /* fromIme */);
|
||||
}
|
||||
mImeTargetFromIme = null;
|
||||
abortShowImePostLayout();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Abort any pending request to show IME post layout.
|
||||
*/
|
||||
void abortShowImePostLayout() {
|
||||
mImeTargetFromIme = null;
|
||||
mIsImeLayoutDrawn = false;
|
||||
mShowImeRunner = null;
|
||||
}
|
||||
|
||||
private boolean isImeTargetFromDisplayContentAndImeSame() {
|
||||
// IMMS#mLastImeTargetWindow always considers focused window as
|
||||
// IME target, however DisplayContent#computeImeTarget() can compute
|
||||
|
||||
@@ -7331,6 +7331,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
synchronized (mGlobalLock) {
|
||||
final DisplayContent dc = mRoot.getDisplayContent(displayId);
|
||||
if (dc != null && dc.mInputMethodTarget != null) {
|
||||
// If there was a pending IME show(), reset it as IME has been
|
||||
// requested to be hidden.
|
||||
dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout();
|
||||
dc.mInputMethodTarget.hideInsets(WindowInsets.Type.ime(), true /* fromIme */);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user