Merge "Deliver hideInsets when target is removed" into rvc-dev am: bb6c1e09ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12011265 Change-Id: Idd5ef36a92ca4440dc9be16e6ce98e1092572a38
This commit is contained in:
@@ -757,6 +757,12 @@
|
||||
"group": "WM_DEBUG_BOOT",
|
||||
"at": "com\/android\/server\/wm\/WindowManagerService.java"
|
||||
},
|
||||
"-547111355": {
|
||||
"message": "hideIme Control target: %s ",
|
||||
"level": "DEBUG",
|
||||
"group": "WM_DEBUG_IME",
|
||||
"at": "com\/android\/server\/wm\/WindowManagerService.java"
|
||||
},
|
||||
"-545190927": {
|
||||
"message": "<<< CLOSE TRANSACTION animate",
|
||||
"level": "INFO",
|
||||
@@ -1087,6 +1093,12 @@
|
||||
"group": "WM_ERROR",
|
||||
"at": "com\/android\/server\/wm\/WindowManagerService.java"
|
||||
},
|
||||
"95216706": {
|
||||
"message": "hideIme target: %s ",
|
||||
"level": "DEBUG",
|
||||
"group": "WM_DEBUG_IME",
|
||||
"at": "com\/android\/server\/wm\/WindowManagerService.java"
|
||||
},
|
||||
"95281111": {
|
||||
"message": "Attempted to get IME flag of a display that does not exist: %d",
|
||||
"level": "WARN",
|
||||
|
||||
@@ -4047,7 +4047,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
// Send it to window manager to hide IME from IME target window.
|
||||
// TODO(b/139861270): send to mCurClient.client once IMMS is aware of
|
||||
// actual IME target.
|
||||
mWindowManagerInternal.hideIme(mHideRequestWindowMap.get(windowToken));
|
||||
mWindowManagerInternal.hideIme(
|
||||
mHideRequestWindowMap.get(windowToken),
|
||||
mCurClient.selfReportedDisplayId);
|
||||
}
|
||||
} else {
|
||||
// Send to window manager to show IME after IME layout finishes.
|
||||
|
||||
@@ -528,8 +528,9 @@ public abstract class WindowManagerInternal {
|
||||
* Hide IME using imeTargetWindow when requested.
|
||||
*
|
||||
* @param imeTargetWindowToken token of the (IME target) window on which IME should be hidden.
|
||||
* @param displayId the id of the display the IME is on.
|
||||
*/
|
||||
public abstract void hideIme(IBinder imeTargetWindowToken);
|
||||
public abstract void hideIme(IBinder imeTargetWindowToken, int displayId);
|
||||
|
||||
/**
|
||||
* Tell window manager about a package that should not be running with high refresh rate
|
||||
|
||||
@@ -90,6 +90,7 @@ import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_BOOT;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_IME;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_KEEP_SCREEN_ON;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
|
||||
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_SCREEN_ON;
|
||||
@@ -7616,24 +7617,26 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideIme(IBinder imeTargetWindowToken) {
|
||||
public void hideIme(IBinder imeTargetWindowToken, int displayId) {
|
||||
synchronized (mGlobalLock) {
|
||||
WindowState imeTarget = mWindowMap.get(imeTargetWindowToken);
|
||||
if (imeTarget == null) {
|
||||
// The target window no longer exists.
|
||||
return;
|
||||
ProtoLog.d(WM_DEBUG_IME, "hideIme target: %s ", imeTarget);
|
||||
DisplayContent dc = mRoot.getDisplayContent(displayId);
|
||||
if (imeTarget != null) {
|
||||
imeTarget = imeTarget.getImeControlTarget().getWindow();
|
||||
if (imeTarget != null) {
|
||||
dc = imeTarget.getDisplayContent();
|
||||
}
|
||||
// If there was a pending IME show(), reset it as IME has been
|
||||
// requested to be hidden.
|
||||
dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout();
|
||||
}
|
||||
imeTarget = imeTarget.getImeControlTarget().getWindow();
|
||||
final DisplayContent dc = imeTarget != null
|
||||
? imeTarget.getDisplayContent() : getDefaultDisplayContentLocked();
|
||||
// If there was a pending IME show(), reset it as IME has been
|
||||
// requested to be hidden.
|
||||
dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout();
|
||||
if (dc.mInputMethodControlTarget == null) {
|
||||
return;
|
||||
if (dc != null && dc.mInputMethodControlTarget != null) {
|
||||
ProtoLog.d(WM_DEBUG_IME, "hideIme Control target: %s ",
|
||||
dc.mInputMethodControlTarget);
|
||||
dc.mInputMethodControlTarget.hideInsets(
|
||||
WindowInsets.Type.ime(), true /* fromIme */);
|
||||
}
|
||||
dc.mInputMethodControlTarget.hideInsets(
|
||||
WindowInsets.Type.ime(), true /* fromIme */);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user