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 Original line Diff line number Diff line
@@ -900,11 +900,14 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            final String mImeControlTargetName;
            final String mImeControlTargetName;
            @Nullable
            @Nullable
            final String mImeTargetNameFromWm;
            final String mImeTargetNameFromWm;
            @Nullable
            final String mImeSurfaceParentName;


            Entry(ClientState client, EditorInfo editorInfo, String focusedWindowName,
            Entry(ClientState client, EditorInfo editorInfo, String focusedWindowName,
                    @SoftInputModeFlags int softInputMode, @SoftInputShowHideReason int reason,
                    @SoftInputModeFlags int softInputMode, @SoftInputShowHideReason int reason,
                    boolean inFullscreenMode, String requestWindowName,
                    boolean inFullscreenMode, String requestWindowName,
                    @Nullable String imeControlTargetName, @Nullable String imeTargetName) {
                    @Nullable String imeControlTargetName, @Nullable String imeTargetName,
                    @Nullable String imeSurfaceParentName) {
                mClientState = client;
                mClientState = client;
                mEditorInfo = editorInfo;
                mEditorInfo = editorInfo;
                mFocusedWindowName = focusedWindowName;
                mFocusedWindowName = focusedWindowName;
@@ -916,6 +919,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                mRequestWindowName = requestWindowName;
                mRequestWindowName = requestWindowName;
                mImeControlTargetName = imeControlTargetName;
                mImeControlTargetName = imeControlTargetName;
                mImeTargetNameFromWm = imeTargetName;
                mImeTargetNameFromWm = imeTargetName;
                mImeSurfaceParentName = imeSurfaceParentName;
            }
            }
        }
        }


@@ -961,6 +965,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                pw.print(prefix);
                pw.print(prefix);
                pw.println(" imeTargetNameFromWm=" + entry.mImeTargetNameFromWm);
                pw.println(" imeTargetNameFromWm=" + entry.mImeTargetNameFromWm);


                pw.print(prefix);
                pw.println(" imeSurfaceParentName=" + entry.mImeSurfaceParentName);

                pw.print(prefix);
                pw.print(prefix);
                pw.print(" editorInfo: ");
                pw.print(" editorInfo: ");
                pw.print(" inputType=" + entry.mEditorInfo.inputType);
                pw.print(" inputType=" + entry.mEditorInfo.inputType);
@@ -4619,7 +4626,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        mSoftInputShowHideHistory.addEntry(new SoftInputShowHideHistory.Entry(
        mSoftInputShowHideHistory.addEntry(new SoftInputShowHideHistory.Entry(
                mCurFocusedWindowClient, mCurEditorInfo, info.focusedWindowName,
                mCurFocusedWindowClient, mCurEditorInfo, info.focusedWindowName,
                mCurFocusedWindowSoftInputMode, reason, mInFullscreenMode,
                mCurFocusedWindowSoftInputMode, reason, mInFullscreenMode,
                info.requestWindowName, info.imeControlTargetName, info.imeLayerTargetName));
                info.requestWindowName, info.imeControlTargetName, info.imeLayerTargetName,
                info.imeSurfaceParentName));
    }
    }


    @BinderThread
    @BinderThread
+6 −1
Original line number Original line Diff line number Diff line
@@ -808,12 +808,17 @@ public abstract class WindowManagerInternal {
         */
         */
        public final String imeLayerTargetName;
        public final String imeLayerTargetName;


        /** The surface parent of the IME container. */
        public final String imeSurfaceParentName;

        public ImeTargetInfo(String focusedWindowName, String requestWindowName,
        public ImeTargetInfo(String focusedWindowName, String requestWindowName,
                String imeControlTargetName, String imeLayerTargetName) {
                String imeControlTargetName, String imeLayerTargetName,
                String imeSurfaceParentName) {
            this.focusedWindowName = focusedWindowName;
            this.focusedWindowName = focusedWindowName;
            this.requestWindowName = requestWindowName;
            this.requestWindowName = requestWindowName;
            this.imeControlTargetName = imeControlTargetName;
            this.imeControlTargetName = imeControlTargetName;
            this.imeLayerTargetName = imeLayerTargetName;
            this.imeLayerTargetName = imeLayerTargetName;
            this.imeSurfaceParentName = imeSurfaceParentName;
        }
        }
    }
    }


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


        @Override
        @Override