Merge "Add ImeSurfaceParent into SoftInputShowHideHistory"

This commit is contained in:
Wilson Wu
2022-08-16 08:36:15 +00:00
committed by Android (Google) Code Review
3 changed files with 21 additions and 5 deletions

View File

@@ -910,11 +910,14 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
final String mImeControlTargetName;
@Nullable
final String mImeTargetNameFromWm;
@Nullable
final String mImeSurfaceParentName;
Entry(ClientState client, EditorInfo editorInfo, String focusedWindowName,
@SoftInputModeFlags int softInputMode, @SoftInputShowHideReason int reason,
boolean inFullscreenMode, String requestWindowName,
@Nullable String imeControlTargetName, @Nullable String imeTargetName) {
@Nullable String imeControlTargetName, @Nullable String imeTargetName,
@Nullable String imeSurfaceParentName) {
mClientState = client;
mEditorInfo = editorInfo;
mFocusedWindowName = focusedWindowName;
@@ -926,6 +929,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
mRequestWindowName = requestWindowName;
mImeControlTargetName = imeControlTargetName;
mImeTargetNameFromWm = imeTargetName;
mImeSurfaceParentName = imeSurfaceParentName;
}
}
@@ -971,6 +975,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
pw.print(prefix);
pw.println(" imeTargetNameFromWm=" + entry.mImeTargetNameFromWm);
pw.print(prefix);
pw.println(" imeSurfaceParentName=" + entry.mImeSurfaceParentName);
pw.print(prefix);
pw.print(" editorInfo: ");
pw.print(" inputType=" + entry.mEditorInfo.inputType);
@@ -4676,7 +4683,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
mSoftInputShowHideHistory.addEntry(new SoftInputShowHideHistory.Entry(
mCurFocusedWindowClient, mCurEditorInfo, info.focusedWindowName,
mCurFocusedWindowSoftInputMode, reason, mInFullscreenMode,
info.requestWindowName, info.imeControlTargetName, info.imeLayerTargetName));
info.requestWindowName, info.imeControlTargetName, info.imeLayerTargetName,
info.imeSurfaceParentName));
}
@BinderThread

View File

@@ -810,12 +810,17 @@ public abstract class WindowManagerInternal {
*/
public final String imeLayerTargetName;
/** The surface parent of the IME container. */
public final String imeSurfaceParentName;
public ImeTargetInfo(String focusedWindowName, String requestWindowName,
String imeControlTargetName, String imeLayerTargetName) {
String imeControlTargetName, String imeLayerTargetName,
String imeSurfaceParentName) {
this.focusedWindowName = focusedWindowName;
this.requestWindowName = requestWindowName;
this.imeControlTargetName = imeControlTargetName;
this.imeLayerTargetName = imeLayerTargetName;
this.imeSurfaceParentName = imeSurfaceParentName;
}
}

View File

@@ -8215,6 +8215,7 @@ public class WindowManagerService extends IWindowManager.Stub
final String requestWindowName;
final String imeControlTargetName;
final String imeLayerTargetName;
final String imeSurfaceParentName;
synchronized (mGlobalLock) {
final WindowState focusedWin = mWindowMap.get(focusedToken);
focusedWindowName = focusedWin != null ? focusedWin.getName() : "null";
@@ -8231,15 +8232,17 @@ public class WindowManagerService extends IWindowManager.Stub
}
final InsetsControlTarget target = dc.getImeTarget(IME_TARGET_LAYERING);
imeLayerTargetName = target != null ? target.getWindow().getName() : "null";
final SurfaceControl imeParent = dc.mInputMethodSurfaceParent;
imeSurfaceParentName = imeParent != null ? imeParent.toString() : "null";
if (show) {
dc.onShowImeRequested();
}
} else {
imeControlTargetName = imeLayerTargetName = "no-display";
imeControlTargetName = imeLayerTargetName = imeSurfaceParentName = "no-display";
}
}
return new ImeTargetInfo(focusedWindowName, requestWindowName, imeControlTargetName,
imeLayerTargetName);
imeLayerTargetName, imeSurfaceParentName);
}
@Override