From d0c4ac7948f32cbff0cc7775bd475c97fae3b5c0 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Thu, 16 Sep 2021 17:14:07 +0800 Subject: [PATCH] Fix split cannot active It was mistake on previos change, we should exit split when both stages are invisible. Bug: 199369390 Test: manual Test: pass existing tests Change-Id: I9f237155fd75b4ee16db647f4849f929cbba1056 --- .../src/com/android/wm/shell/splitscreen/StageCoordinator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 637d3be87780f..493870d7fd728 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -649,6 +649,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, final boolean sideStageVisible = mSideStageListener.mVisible; final boolean mainStageVisible = mMainStageListener.mVisible; final boolean bothStageVisible = sideStageVisible && mainStageVisible; + final boolean bothStageInvisible = !sideStageVisible && !mainStageVisible; final boolean sameVisibility = sideStageVisible == mainStageVisible; // Only add or remove divider when both visible or both invisible to avoid sometimes we only // got one stage visibility changed for a moment and it will cause flicker. @@ -656,7 +657,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, setDividerVisibility(bothStageVisible); } - if (!bothStageVisible) { + if (bothStageInvisible) { if (mExitSplitScreenOnHide // Don't dismiss staged split when both stages are not visible due to sleeping display, // like the cases keyguard showing or screen off.