Loading data/etc/services.core.protolog.json +12 −6 Original line number Diff line number Diff line Loading @@ -1927,6 +1927,12 @@ "group": "WM_SHOW_TRANSACTIONS", "at": "com\/android\/server\/wm\/Session.java" }, "-81121442": { "message": "ImeContainer just became organized but it doesn't have a parent or the parent doesn't have a surface control. mSurfaceControl=%s imeParentSurfaceControl=%s", "level": "ERROR", "group": "WM_DEBUG_IME", "at": "com\/android\/server\/wm\/DisplayContent.java" }, "-80004683": { "message": "Resume failed; resetting state to %s: %s", "level": "VERBOSE", Loading Loading @@ -2767,12 +2773,6 @@ "group": "WM_DEBUG_WALLPAPER", "at": "com\/android\/server\/wm\/WallpaperWindowToken.java" }, "736003885": { "message": "Unable to retrieve the task token to start recording for display %d", "level": "VERBOSE", "group": "WM_DEBUG_CONTENT_RECORDING", "at": "com\/android\/server\/wm\/ContentRecorder.java" }, "736692676": { "message": "Config is relaunching %s", "level": "VERBOSE", Loading Loading @@ -3139,6 +3139,12 @@ "group": "WM_DEBUG_BACK_PREVIEW", "at": "com\/android\/server\/wm\/BackNavigationController.java" }, "1175495463": { "message": "ImeContainer just became organized. Reparenting under parent. imeParentSurfaceControl=%s", "level": "INFO", "group": "WM_DEBUG_IME", "at": "com\/android\/server\/wm\/DisplayContent.java" }, "1178653181": { "message": "Old wallpaper still the target.", "level": "VERBOSE", Loading services/core/java/com/android/server/wm/DisplayContent.java +17 −0 Original line number Diff line number Diff line Loading @@ -4875,6 +4875,23 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp void setOrganizer(IDisplayAreaOrganizer organizer, boolean skipDisplayAreaAppeared) { super.setOrganizer(organizer, skipDisplayAreaAppeared); mDisplayContent.updateImeParent(); // If the ImeContainer was previously unorganized then the framework might have // reparented its surface control under an activity so we need to reparent it back // under its parent. if (organizer != null) { final SurfaceControl imeParentSurfaceControl = getParentSurfaceControl(); if (mSurfaceControl != null && imeParentSurfaceControl != null) { ProtoLog.i(WM_DEBUG_IME, "ImeContainer just became organized. Reparenting " + "under parent. imeParentSurfaceControl=%s", imeParentSurfaceControl); getPendingTransaction().reparent(mSurfaceControl, imeParentSurfaceControl); } else { ProtoLog.e(WM_DEBUG_IME, "ImeContainer just became organized but it doesn't " + "have a parent or the parent doesn't have a surface control." + " mSurfaceControl=%s imeParentSurfaceControl=%s", mSurfaceControl, imeParentSurfaceControl); } } } } Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +27 −0 Original line number Diff line number Diff line Loading @@ -414,6 +414,33 @@ public class DisplayContentTests extends WindowTestsBase { imeContainer.setOrganizer(null); } @Test public void testImeContainerIsReparentedUnderParentWhenOrganized() { final DisplayArea.Tokens imeContainer = mDisplayContent.getImeContainer(); final ActivityRecord activity = createActivityRecord(mDisplayContent); final WindowState startingWin = createWindow(null, TYPE_APPLICATION_STARTING, activity, "startingWin"); startingWin.setHasSurface(true); assertTrue(startingWin.canBeImeTarget()); final Transaction transaction = mDisplayContent.getPendingTransaction(); spyOn(transaction); // Organized the ime container. final IDisplayAreaOrganizer mockImeOrganizer = mock(IDisplayAreaOrganizer.class); when(mockImeOrganizer.asBinder()).thenReturn(new Binder()); imeContainer.setOrganizer(mockImeOrganizer); // Verify that the ime container surface is reparented under // its parent surface as a consequence of the setOrganizer call. SurfaceControl imeParentSurfaceControl = imeContainer.getParentSurfaceControl(); verify(transaction).reparent(imeContainer.getSurfaceControl(), imeParentSurfaceControl); // Clean up organizer. imeContainer.setOrganizer(null); } /** * This tests root task movement between displays and proper root task's, task's and app token's * display container references updates. Loading Loading
data/etc/services.core.protolog.json +12 −6 Original line number Diff line number Diff line Loading @@ -1927,6 +1927,12 @@ "group": "WM_SHOW_TRANSACTIONS", "at": "com\/android\/server\/wm\/Session.java" }, "-81121442": { "message": "ImeContainer just became organized but it doesn't have a parent or the parent doesn't have a surface control. mSurfaceControl=%s imeParentSurfaceControl=%s", "level": "ERROR", "group": "WM_DEBUG_IME", "at": "com\/android\/server\/wm\/DisplayContent.java" }, "-80004683": { "message": "Resume failed; resetting state to %s: %s", "level": "VERBOSE", Loading Loading @@ -2767,12 +2773,6 @@ "group": "WM_DEBUG_WALLPAPER", "at": "com\/android\/server\/wm\/WallpaperWindowToken.java" }, "736003885": { "message": "Unable to retrieve the task token to start recording for display %d", "level": "VERBOSE", "group": "WM_DEBUG_CONTENT_RECORDING", "at": "com\/android\/server\/wm\/ContentRecorder.java" }, "736692676": { "message": "Config is relaunching %s", "level": "VERBOSE", Loading Loading @@ -3139,6 +3139,12 @@ "group": "WM_DEBUG_BACK_PREVIEW", "at": "com\/android\/server\/wm\/BackNavigationController.java" }, "1175495463": { "message": "ImeContainer just became organized. Reparenting under parent. imeParentSurfaceControl=%s", "level": "INFO", "group": "WM_DEBUG_IME", "at": "com\/android\/server\/wm\/DisplayContent.java" }, "1178653181": { "message": "Old wallpaper still the target.", "level": "VERBOSE", Loading
services/core/java/com/android/server/wm/DisplayContent.java +17 −0 Original line number Diff line number Diff line Loading @@ -4875,6 +4875,23 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp void setOrganizer(IDisplayAreaOrganizer organizer, boolean skipDisplayAreaAppeared) { super.setOrganizer(organizer, skipDisplayAreaAppeared); mDisplayContent.updateImeParent(); // If the ImeContainer was previously unorganized then the framework might have // reparented its surface control under an activity so we need to reparent it back // under its parent. if (organizer != null) { final SurfaceControl imeParentSurfaceControl = getParentSurfaceControl(); if (mSurfaceControl != null && imeParentSurfaceControl != null) { ProtoLog.i(WM_DEBUG_IME, "ImeContainer just became organized. Reparenting " + "under parent. imeParentSurfaceControl=%s", imeParentSurfaceControl); getPendingTransaction().reparent(mSurfaceControl, imeParentSurfaceControl); } else { ProtoLog.e(WM_DEBUG_IME, "ImeContainer just became organized but it doesn't " + "have a parent or the parent doesn't have a surface control." + " mSurfaceControl=%s imeParentSurfaceControl=%s", mSurfaceControl, imeParentSurfaceControl); } } } } Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +27 −0 Original line number Diff line number Diff line Loading @@ -414,6 +414,33 @@ public class DisplayContentTests extends WindowTestsBase { imeContainer.setOrganizer(null); } @Test public void testImeContainerIsReparentedUnderParentWhenOrganized() { final DisplayArea.Tokens imeContainer = mDisplayContent.getImeContainer(); final ActivityRecord activity = createActivityRecord(mDisplayContent); final WindowState startingWin = createWindow(null, TYPE_APPLICATION_STARTING, activity, "startingWin"); startingWin.setHasSurface(true); assertTrue(startingWin.canBeImeTarget()); final Transaction transaction = mDisplayContent.getPendingTransaction(); spyOn(transaction); // Organized the ime container. final IDisplayAreaOrganizer mockImeOrganizer = mock(IDisplayAreaOrganizer.class); when(mockImeOrganizer.asBinder()).thenReturn(new Binder()); imeContainer.setOrganizer(mockImeOrganizer); // Verify that the ime container surface is reparented under // its parent surface as a consequence of the setOrganizer call. SurfaceControl imeParentSurfaceControl = imeContainer.getParentSurfaceControl(); verify(transaction).reparent(imeContainer.getSurfaceControl(), imeParentSurfaceControl); // Clean up organizer. imeContainer.setOrganizer(null); } /** * This tests root task movement between displays and proper root task's, task's and app token's * display container references updates. Loading