From cc6f1136be7067509a0b6ded88bc2b10888ad509 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Thu, 24 Sep 2020 18:10:24 +0800 Subject: [PATCH] Hide IME adjust dims when exiting split mode If the IME is showing while exiting split mode, the IME-adjust dims won't be changed to hidden. This makes sure to hide the IME-adjust dims when leaving split mode. Fix: 168505685 Test: atest SystemUITests Test: atest WMShellUnitTests Test: manual check switching user while showing IME in split mode, there won't have overlapping dim remains on the screen. Change-Id: I778df71616827c01f415231d8bbc20b037181d10 --- .../wm/shell/splitscreen/DividerView.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java index cdb27da7de07e..2b14e8bf88d6f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java @@ -845,15 +845,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, } void enterSplitMode(boolean isHomeStackResizable) { - post(() -> { - final SurfaceControl sc = getWindowSurfaceControl(); - if (sc == null) { - return; - } - Transaction t = mTiles.getTransaction(); - t.show(sc).apply(); - mTiles.releaseTransaction(t); - }); + setHidden(false); SnapTarget miniMid = mSplitLayout.getMinimizedSnapAlgorithm(isHomeStackResizable).getMiddleTarget(); @@ -880,14 +872,19 @@ public class DividerView extends FrameLayout implements OnTouchListener, } void exitSplitMode() { - // Reset tile bounds + // The view is going to be removed right after this function involved, updates the surface + // in the current thread instead of posting it to the view's UI thread. final SurfaceControl sc = getWindowSurfaceControl(); if (sc == null) { return; } Transaction t = mTiles.getTransaction(); - t.hide(sc).apply(); + t.hide(sc); + mImeController.setDimsHidden(t, true); + t.apply(); mTiles.releaseTransaction(t); + + // Reset tile bounds int midPos = mSplitLayout.getSnapAlgorithm().getMiddleTarget().position; mWindowManagerProxy.applyResizeSplits(midPos, mSplitLayout); }