Loading services/core/java/com/android/server/wm/InsetsSourceProvider.java +6 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,12 @@ class InsetsSourceProvider { return mSource; } @VisibleForTesting @NonNull Rect getSourceFrame() { return mSourceFrame; } /** * @return Whether the current flag configuration allows to control this source. */ Loading services/core/java/com/android/server/wm/WindowState.java +5 −0 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // should be updated after the new given insets are sent to window manager. return; } if (!mRelayoutCalled) { // The window was not laid out yet. The source frame should be updated after the window // is laid out. return; } final SparseArray<InsetsSourceProvider> providers = getInsetsSourceProviders(); for (int i = providers.size() - 1; i >= 0; i--) { providers.valueAt(i).updateSourceFrame(winFrame); Loading services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase { // Disabling this call for most tests since it can override the systemUiFlags when called. doNothing().when(mDisplayPolicy).updateSystemBarAttributes(); makeWindowVisible(mStatusBarWindow, mNavBarWindow); updateDisplayFrames(); } Loading Loading @@ -154,6 +155,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase { }; addWindow(win); win.getFrame().set(0, 0, 500, 100); makeWindowVisible(win); win.updateSourceFrame(win.getFrame()); mDisplayContent.getInsetsStateController().onPostLayout(); Loading services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,7 @@ public class DisplayPolicyTests extends WindowTestsBase { final DisplayPolicy displayPolicy = mDisplayContent.getDisplayPolicy(); mDisplayContent.setInputMethodWindowLocked(mImeWindow); makeWindowVisible(mImeWindow); mImeWindow.getControllableInsetProvider().setServerVisible(true); mImeWindow.mGivenContentInsets.set(0, 10, 0, 0); Loading services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,8 @@ public class InsetsStateControllerTest extends WindowTestsBase { final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar"); final WindowState ime = createWindow(null, TYPE_INPUT_METHOD, "ime"); makeWindowVisible(statusBar); // IME cannot be the IME target. ime.mAttrs.flags |= FLAG_NOT_FOCUSABLE; Loading Loading
services/core/java/com/android/server/wm/InsetsSourceProvider.java +6 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,12 @@ class InsetsSourceProvider { return mSource; } @VisibleForTesting @NonNull Rect getSourceFrame() { return mSourceFrame; } /** * @return Whether the current flag configuration allows to control this source. */ Loading
services/core/java/com/android/server/wm/WindowState.java +5 −0 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // should be updated after the new given insets are sent to window manager. return; } if (!mRelayoutCalled) { // The window was not laid out yet. The source frame should be updated after the window // is laid out. return; } final SparseArray<InsetsSourceProvider> providers = getInsetsSourceProviders(); for (int i = providers.size() - 1; i >= 0; i--) { providers.valueAt(i).updateSourceFrame(winFrame); Loading
services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase { // Disabling this call for most tests since it can override the systemUiFlags when called. doNothing().when(mDisplayPolicy).updateSystemBarAttributes(); makeWindowVisible(mStatusBarWindow, mNavBarWindow); updateDisplayFrames(); } Loading Loading @@ -154,6 +155,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase { }; addWindow(win); win.getFrame().set(0, 0, 500, 100); makeWindowVisible(win); win.updateSourceFrame(win.getFrame()); mDisplayContent.getInsetsStateController().onPostLayout(); Loading
services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,7 @@ public class DisplayPolicyTests extends WindowTestsBase { final DisplayPolicy displayPolicy = mDisplayContent.getDisplayPolicy(); mDisplayContent.setInputMethodWindowLocked(mImeWindow); makeWindowVisible(mImeWindow); mImeWindow.getControllableInsetProvider().setServerVisible(true); mImeWindow.mGivenContentInsets.set(0, 10, 0, 0); Loading
services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,8 @@ public class InsetsStateControllerTest extends WindowTestsBase { final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar"); final WindowState ime = createWindow(null, TYPE_INPUT_METHOD, "ime"); makeWindowVisible(statusBar); // IME cannot be the IME target. ime.mAttrs.flags |= FLAG_NOT_FOCUSABLE; Loading