From 5fac212e8b15fd84782bd6c914c3a7a5e646d945 Mon Sep 17 00:00:00 2001 From: Jiaquan He Date: Thu, 22 Dec 2016 16:47:59 -0800 Subject: [PATCH] Check split screen properly. This commit detacts split screen by checking whether there's a docked task instead of multi window mode. Bug: 33847223 Bug: 32101881 Change-Id: I23ee11e57ded7c5e81d51cfbfea05500a879945c --- .../src/com/android/systemui/recents/RecentsImpl.java | 3 ++- .../src/com/android/systemui/recents/views/TaskStackView.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java index 2263a4e9369ce..106bb532c99aa 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java @@ -765,9 +765,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Get the transform for the running task stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(); + boolean isInSplitScreen = Recents.getSystemServices().hasDockedTask(); stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getScroller().getStackScroll(), mTmpTransform, null, windowOverrideRect, - Recents.getConfiguration().isGridEnabled); + Recents.getConfiguration().isGridEnabled && !isInSplitScreen); return mTmpTransform; } diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 8d91b4f4ba054..c46c2c35f9a49 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -2133,13 +2133,13 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal * Check whether we should use the grid layout. * We use the grid layout for Recents iff all the following is true: * 1. Grid-mode is enabled. - * 2. The activity is not in multi-window mode. + * 2. The activity is not in split screen mode (there's no docked task). * 3. The user is not dragging a task view over the dock state. * @return True if we should use the grid layout. */ public boolean useGridLayout() { return Recents.getConfiguration().isGridEnabled - && !((RecentsActivity) mContext).isInMultiWindowMode() + && !Recents.getSystemServices().hasDockedTask() && !mDraggingOverDockState; }