summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wilson Wu <wilsonwu@google.com> 2022-11-28 02:46:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-11-28 02:46:44 +0000
commitc9d48ffda4d68e46898b6ffaaaf29aaa6e0249ac (patch)
tree14f9efc60980a90bad4894654d8c922b0d2b9808
parent607bdbf7139f41d7f6abb0122051a4d1487482c8 (diff)
parenta210826fe5577d9501da413f569253e6fc9979d8 (diff)
Merge "Fix IME not shown from recents to split-screen task"
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java2
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java18
2 files changed, 19 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java
index d9b4f475a50c..4edc64266cca 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java
@@ -295,8 +295,8 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
mImeSourceControl.release(SurfaceControl::release);
}
}
- mImeSourceControl = imeSourceControl;
}
+ mImeSourceControl = imeSourceControl;
}
private void applyVisibilityToLeash(InsetsSourceControl imeSourceControl) {
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java
index 40f2e88f34fd..86415419418a 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java
@@ -21,7 +21,9 @@ import static android.view.InsetsState.ITYPE_IME;
import static android.view.Surface.ROTATION_0;
import static android.view.WindowInsets.Type.ime;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
@@ -90,6 +92,22 @@ public class DisplayImeControllerTest extends ShellTestCase {
}
@Test
+ public void insetsControlChanged_updateExpectedImeSourceControl() {
+ final InsetsSourceControl[] insetsSourceControls = new InsetsSourceControl[]{
+ new InsetsSourceControl(ITYPE_IME, mock(SurfaceControl.class), false,
+ new Point(0, 0), Insets.NONE)};
+ final InsetsSourceControl imeSourceControl = insetsSourceControls[0];
+
+ mPerDisplay.insetsControlChanged(insetsStateWithIme(false), insetsSourceControls);
+
+ assertEquals(imeSourceControl, mPerDisplay.mImeSourceControl);
+
+ mPerDisplay.insetsControlChanged(insetsStateWithIme(false), null);
+
+ assertNull(mPerDisplay.mImeSourceControl);
+ }
+
+ @Test
public void insetsChanged_schedulesNoWorkOnExecutor() {
mPerDisplay.insetsChanged(insetsStateWithIme(false));
verifyZeroInteractions(mExecutor);