Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4aac669f authored by Wilson Wu's avatar Wilson Wu
Browse files

Add ImeSurfaceParent into SoftInputShowHideHistory

Records corresponding IME surface parent information
into SoftInputShowHideHistory for analysis.

Bug: 238062252
Test: check bugreport
Change-Id: I1a1ac4caee2ddcb651f66907e77cec0ae1d75b2d
parent e2fdbeff
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -900,11 +900,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;
@@ -916,6 +919,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                mRequestWindowName = requestWindowName;
                mImeControlTargetName = imeControlTargetName;
                mImeTargetNameFromWm = imeTargetName;
                mImeSurfaceParentName = imeSurfaceParentName;
            }
        }

@@ -961,6 +965,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);
@@ -4619,7 +4626,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
+6 −1
Original line number Diff line number Diff line
@@ -808,12 +808,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;
        }
    }

+5 −2
Original line number Diff line number Diff line
@@ -8186,6 +8186,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";
@@ -8202,15 +8203,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