summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tony Huang <tonyychuang@google.com> 2022-03-23 17:20:46 +0800
committer Tony Huang <tonyychuang@google.com> 2022-03-31 14:47:44 +0800
commitcfeb154a1b080e2f2859c8ce1322abba3b866276 (patch)
treedb037b77b3ff5f8e0c7f2913476500edfdd0dfde
parent9dc93c7c06a41c5389925a6dbe43ae11db935cad (diff)
Reduce flicker when resize animation
When resize split, split decor use fade in animation but bottom larger than bounds area is black, it will make color change from black to decor background color and it just like flicker. To avoid this, we should add back using of am#setSplitScreenResizing which could make black backgound to color similar to app content background. And it should also reduce flicker while snap divider to dismiss split. Bug: 220985951 Bug: 221178408 Test: manual Test: pass existing tests Change-Id: I961a4d3ab4f3552fd5ace4b3a6742afa980f073c
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java16
1 files changed, 15 insertions, 1 deletions
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 3593eddf4b3b..e150cf9cd112 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
@@ -171,6 +171,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
private boolean mShouldUpdateRecents;
private boolean mExitSplitScreenOnHide;
private boolean mIsDividerRemoteAnimating;
+ private boolean mResizingSplits;
/** The target stage to dismiss to when unlock after folded. */
@StageType
@@ -1093,10 +1094,11 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
@Override
public void onSnappedToDismiss(boolean bottomOrRight) {
+ setResizingSplits(false /* resizing */);
+
final boolean mainStageToTop =
bottomOrRight ? mSideStagePosition == SPLIT_POSITION_BOTTOM_OR_RIGHT
: mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT;
-
if (!ENABLE_SHELL_TRANSITIONS) {
exitSplitScreen(mainStageToTop ? mMainStage : mSideStage, EXIT_REASON_DRAG_DIVIDER);
return;
@@ -1125,6 +1127,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
@Override
public void onLayoutSizeChanging(SplitLayout layout) {
mSyncQueue.runInSync(t -> {
+ setResizingSplits(true /* resizing */);
updateSurfaceBounds(layout, t);
mMainStage.onResizing(getMainStageBounds(), t);
mSideStage.onResizing(getSideStageBounds(), t);
@@ -1138,6 +1141,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
updateUnfoldBounds();
mSyncQueue.queue(wct);
mSyncQueue.runInSync(t -> {
+ setResizingSplits(false /* resizing */);
updateSurfaceBounds(layout, t);
mMainStage.onResized(t);
mSideStage.onResized(t);
@@ -1179,6 +1183,16 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
bottomRightStage.mRootLeash, topLeftStage.mDimLayer, bottomRightStage.mDimLayer);
}
+ void setResizingSplits(boolean resizing) {
+ if (resizing == mResizingSplits) return;
+ try {
+ ActivityTaskManager.getService().setSplitScreenResizing(resizing);
+ mResizingSplits = resizing;
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Error calling setSplitScreenResizing", e);
+ }
+ }
+
@Override
public int getSplitItemPosition(WindowContainerToken token) {
if (token == null) {