From e537165bc1dc327f03089c041b33d4800be9c7b6 Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Wed, 3 Feb 2021 17:48:35 +0800 Subject: [PATCH] Don't provide IME insets to the PIP window The PIP window will be moved up to avoid overlapping with IME when IME is showing. The time of overlapping is very short. We don't want the PIP window to change its layout during so. Fix: 160346523 Test: atest InsetsStateControllerTest Change-Id: I23be3afe2913210f6ac64aa1c19aae567e539756 --- .../java/com/android/server/wm/InsetsStateController.java | 4 ++++ .../src/com/android/server/wm/InsetsStateControllerTest.java | 1 + 2 files changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/InsetsStateController.java b/services/core/java/com/android/server/wm/InsetsStateController.java index 3ba7b7d96e47e..580d3285c6a5d 100644 --- a/services/core/java/com/android/server/wm/InsetsStateController.java +++ b/services/core/java/com/android/server/wm/InsetsStateController.java @@ -17,6 +17,7 @@ package com.android.server.wm; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; +import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.InsetsState.ITYPE_CAPTION_BAR; @@ -218,6 +219,9 @@ class InsetsStateController { state.removeSource(ITYPE_STATUS_BAR); state.removeSource(ITYPE_NAVIGATION_BAR); state.removeSource(ITYPE_EXTRA_NAVIGATION_BAR); + if (windowingMode == WINDOWING_MODE_PINNED) { + state.removeSource(ITYPE_IME); + } } return state; diff --git a/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java index 2107ab1eeeea8..ee293fcf70e65 100644 --- a/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java @@ -86,6 +86,7 @@ public class InsetsStateControllerTest extends WindowTestsBase { assertNull(getController().getInsetsForWindow(app).peekSource(ITYPE_STATUS_BAR)); assertNull(getController().getInsetsForWindow(app).peekSource(ITYPE_NAVIGATION_BAR)); + assertNull(getController().getInsetsForWindow(app).peekSource(ITYPE_IME)); } @Test