Loading services/core/java/com/android/server/wm/InsetsStateController.java +7 −2 Original line number Diff line number Diff line Loading @@ -170,8 +170,13 @@ class InsetsStateController { } if (aboveIme) { InsetsSource imeSource = state.peekSource(ITYPE_IME); if (imeSource != null && imeSource.isVisible()) { imeSource = new InsetsSource(imeSource); imeSource.setVisible(false); state = new InsetsState(state); state.setSourceVisible(ITYPE_IME, false); state.addSource(imeSource); } } return state; Loading services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,21 @@ public class InsetsStateControllerTest extends WindowTestsBase { assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_NAVIGATION_BAR)); } @Test public void testStripForDispatch_independentSources() { getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null); final WindowState app1 = createWindow(null, TYPE_APPLICATION, "app1"); app1.mBehindIme = true; final WindowState app2 = createWindow(null, TYPE_APPLICATION, "app2"); app2.mBehindIme = false; getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true); assertFalse(getController().getInsetsForDispatch(app2).getSource(ITYPE_IME).isVisible()); assertTrue(getController().getInsetsForDispatch(app1).getSource(ITYPE_IME).isVisible()); } @Test public void testStripForDispatch_belowIme() { getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null); Loading Loading
services/core/java/com/android/server/wm/InsetsStateController.java +7 −2 Original line number Diff line number Diff line Loading @@ -170,8 +170,13 @@ class InsetsStateController { } if (aboveIme) { InsetsSource imeSource = state.peekSource(ITYPE_IME); if (imeSource != null && imeSource.isVisible()) { imeSource = new InsetsSource(imeSource); imeSource.setVisible(false); state = new InsetsState(state); state.setSourceVisible(ITYPE_IME, false); state.addSource(imeSource); } } return state; Loading
services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,21 @@ public class InsetsStateControllerTest extends WindowTestsBase { assertNull(getController().getInsetsForDispatch(app).peekSource(ITYPE_NAVIGATION_BAR)); } @Test public void testStripForDispatch_independentSources() { getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null); final WindowState app1 = createWindow(null, TYPE_APPLICATION, "app1"); app1.mBehindIme = true; final WindowState app2 = createWindow(null, TYPE_APPLICATION, "app2"); app2.mBehindIme = false; getController().getRawInsetsState().setSourceVisible(ITYPE_IME, true); assertFalse(getController().getInsetsForDispatch(app2).getSource(ITYPE_IME).isVisible()); assertTrue(getController().getInsetsForDispatch(app1).getSource(ITYPE_IME).isVisible()); } @Test public void testStripForDispatch_belowIme() { getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null); Loading