From 8e265527f93f932f3954440c82971121e2a2ccf5 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Mon, 13 Feb 2017 11:09:37 -0800 Subject: [PATCH] Unminimizing after toggle screen on/off shows docked app correctly (1/2) When turning screen off when in minimized mode with resizable launcher, then turning screen back on and unminimizing, it would have the incorrect position of the divider from the started split position and the docked app would have the wrong task bounds compared to its stack bounds (so the docked app looks clipped). Block toggling minimized state when screen turns off when being minimized will fix this. Fixes: 34937502, 35388501 Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDockedStackTests Change-Id: I255a56d6b4041586f9125ee39f6e75a3c61f544f --- .../com/android/server/wm/DockedStackDividerController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java index fc377973221b..85eae0212373 100644 --- a/services/core/java/com/android/server/wm/DockedStackDividerController.java +++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java @@ -540,12 +540,14 @@ public class DockedStackDividerController implements DimLayerUser { checkMinimizeChanged(true /* animate */); // We were minimized, and now we are still minimized, but somebody is trying to launch an - // app in docked stack, better show recent apps so we actually get unminimized! This catches + // app in docked stack, better show recent apps so we actually get unminimized! However do + // not do this if keyguard is dismissed such as when the device is unlocking. This catches // any case that was missed in ActivityStarter.postStartActivityUncheckedProcessing because // we couldn't retrace the launch of the app in the docked stack to the launch from // homescreen. if (wasMinimized && mMinimizedDock && containsAppInDockedStack(openingApps) - && appTransition != TRANSIT_NONE) { + && appTransition != TRANSIT_NONE && + !AppTransition.isKeyguardGoingAwayTransit(appTransition)) { mService.showRecentApps(true /* fromHome */); } } @@ -579,6 +581,12 @@ public class DockedStackDividerController implements DimLayerUser { if (homeTask == null || !isWithinDisplay(homeTask)) { return; } + + // Do not minimize when dock is already minimized while keyguard is showing and not + // occluded such as unlocking the screen + if (mMinimizedDock && mService.mPolicy.isKeyguardShowingAndNotOccluded()) { + return; + } final TaskStack fullscreenStack = mDisplayContent.getStackById(FULLSCREEN_WORKSPACE_STACK_ID); final boolean homeVisible = homeTask.getTopVisibleAppToken() != null; -- 2.11.0