Loading core/java/android/window/flags/windowing_frontend.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,16 @@ flag { } } flag { name: "do_not_skip_ime_by_target_visibility" namespace: "windowing_frontend" description: "Avoid window traversal missing IME" bug: "339375944" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "apply_lifecycle_on_pip_change" namespace: "windowing_frontend" Loading services/core/java/com/android/server/wm/WindowState.java +10 −8 Original line number Diff line number Diff line Loading @@ -4648,6 +4648,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (!isImeLayeringTarget()) { return false; } if (!com.android.window.flags.Flags.doNotSkipImeByTargetVisibility()) { // Note that we don't process IME window if the IME input target is not on the screen. // In case some unexpected IME visibility cases happen like starting the remote // animation on the keyguard but seeing the IME window that originally on the app Loading @@ -4657,6 +4658,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP && !(imeInputTarget.isDrawn() || imeInputTarget.isVisibleRequested())) { return false; } } return mDisplayContent.forAllImeWindows(callback, traverseTopToBottom); } Loading services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -747,6 +747,8 @@ public class RemoteAnimationControllerTest extends WindowTestsBase { } } @android.platform.test.annotations.RequiresFlagsDisabled( com.android.window.flags.Flags.FLAG_DO_NOT_SKIP_IME_BY_TARGET_VISIBILITY) @SetupWindows(addWindows = W_INPUT_METHOD) @Test public void testLaunchRemoteAnimationWithoutImeBehind() { Loading services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java +21 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.eq; import android.platform.test.annotations.Presubmit; Loading Loading @@ -60,4 +61,24 @@ public class WindowContainerTraversalTests extends WindowTestsBase { verify(c).accept(eq(mDockedDividerWindow)); verify(c).accept(eq(mImeWindow)); } @android.platform.test.annotations.RequiresFlagsEnabled( com.android.window.flags.Flags.FLAG_DO_NOT_SKIP_IME_BY_TARGET_VISIBILITY) @SetupWindows(addWindows = { W_ACTIVITY, W_INPUT_METHOD }) @Test public void testTraverseImeRegardlessOfImeTarget() { mDisplayContent.setImeLayeringTarget(mAppWindow); mDisplayContent.setImeInputTarget(mAppWindow); mAppWindow.mHasSurface = false; mAppWindow.mActivityRecord.setVisibleRequested(false); mAppWindow.mActivityRecord.setVisible(false); final boolean[] foundIme = { false }; mDisplayContent.forAllWindows(w -> { if (w == mImeWindow) { foundIme[0] = true; } }, true /* traverseTopToBottom */); assertTrue("IME must be found", foundIme[0]); } } Loading
core/java/android/window/flags/windowing_frontend.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,16 @@ flag { } } flag { name: "do_not_skip_ime_by_target_visibility" namespace: "windowing_frontend" description: "Avoid window traversal missing IME" bug: "339375944" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "apply_lifecycle_on_pip_change" namespace: "windowing_frontend" Loading
services/core/java/com/android/server/wm/WindowState.java +10 −8 Original line number Diff line number Diff line Loading @@ -4648,6 +4648,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (!isImeLayeringTarget()) { return false; } if (!com.android.window.flags.Flags.doNotSkipImeByTargetVisibility()) { // Note that we don't process IME window if the IME input target is not on the screen. // In case some unexpected IME visibility cases happen like starting the remote // animation on the keyguard but seeing the IME window that originally on the app Loading @@ -4657,6 +4658,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP && !(imeInputTarget.isDrawn() || imeInputTarget.isVisibleRequested())) { return false; } } return mDisplayContent.forAllImeWindows(callback, traverseTopToBottom); } Loading
services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -747,6 +747,8 @@ public class RemoteAnimationControllerTest extends WindowTestsBase { } } @android.platform.test.annotations.RequiresFlagsDisabled( com.android.window.flags.Flags.FLAG_DO_NOT_SKIP_IME_BY_TARGET_VISIBILITY) @SetupWindows(addWindows = W_INPUT_METHOD) @Test public void testLaunchRemoteAnimationWithoutImeBehind() { Loading
services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java +21 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.eq; import android.platform.test.annotations.Presubmit; Loading Loading @@ -60,4 +61,24 @@ public class WindowContainerTraversalTests extends WindowTestsBase { verify(c).accept(eq(mDockedDividerWindow)); verify(c).accept(eq(mImeWindow)); } @android.platform.test.annotations.RequiresFlagsEnabled( com.android.window.flags.Flags.FLAG_DO_NOT_SKIP_IME_BY_TARGET_VISIBILITY) @SetupWindows(addWindows = { W_ACTIVITY, W_INPUT_METHOD }) @Test public void testTraverseImeRegardlessOfImeTarget() { mDisplayContent.setImeLayeringTarget(mAppWindow); mDisplayContent.setImeInputTarget(mAppWindow); mAppWindow.mHasSurface = false; mAppWindow.mActivityRecord.setVisibleRequested(false); mAppWindow.mActivityRecord.setVisible(false); final boolean[] foundIme = { false }; mDisplayContent.forAllWindows(w -> { if (w == mImeWindow) { foundIme[0] = true; } }, true /* traverseTopToBottom */); assertTrue("IME must be found", foundIme[0]); } }