From fa378d84a2ee574782a2185abad0bc72d5dd22c8 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 14 Feb 2017 09:16:45 -0800 Subject: [PATCH] Do not use docked stack bounds unless all conditions are met. TaskStack currently refers to the DockedStackDividerControler to calculate the docked stack. However, only a partial set of the conditions when this is valid were mirrored. The code now checks the base condition (that we are dealing with the docked stack) and then checks a null value before applying. Null is passed back from the controller in the case all conditions are not met. Change-Id: I388c2eb0b8b9312cd9ee6380ace1837e2eca8450 Fixes: 35233502 Test: manual from bug repro steps. --- services/core/java/com/android/server/wm/TaskStack.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 544d1e3d88dbe..b09d699969741 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -423,8 +423,12 @@ public class TaskStack extends WindowContainer implements DimLayer.DimLaye mBoundsAfterRotation.setEmpty(); final DockedStackDividerController controller = getDisplayContent() .mDividerControllerLocked; - if (controller.isMinimizedDock() && mStackId == DOCKED_STACK_ID) { - outTempBounds.set(controller.getMiddlePositionDockedStackRect()); + if (mStackId == DOCKED_STACK_ID) { + final Rect dockedStackRect = controller.getMiddlePositionDockedStackRect(); + + if (dockedStackRect != null) { + outTempBounds.set(dockedStackRect); + } } }