diff options
| author | 2016-01-15 23:55:04 +0000 | |
|---|---|---|
| committer | 2016-01-15 23:55:04 +0000 | |
| commit | 21e0917d73c4fe5c3f67ff3918d114b078499101 (patch) | |
| tree | 0aeb2863a0887999a15e559c3c925e4918534063 | |
| parent | 2a0a2e0129694c28686f7cf80b671ad777335207 (diff) | |
| parent | ccb6ce2dcd8b833692f6c8a4a568fb938acfe058 (diff) | |
Merge "Fix split-screen visible apps issue when screen is rotated on lockscreen"
4 files changed, 21 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index e837d9a0a610..3459dc85809d 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -1940,7 +1940,8 @@ public final class ActivityStackSupervisor implements DisplayListener { // static stacks need to be adjusted so they don't overlap with the docked stack. // We get the bounds to use from window manager which has been adjusted for any // screen controls and is also the same for all stacks. - mWindowManager.getStackDockedModeBounds(HOME_STACK_ID, tempRect); + mWindowManager.getStackDockedModeBounds( + HOME_STACK_ID, tempRect, true /* ignoreVisibilityOnKeyguardShowing */); for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) { if (StackId.isResizeableByDockedStack(i)) { ActivityStack otherStack = getStack(i); diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 71d616d900d1..d9667a1225ff 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -425,7 +425,7 @@ class Task implements DimLayer.DimLayerUser { } /** Original bounds of the task if applicable, otherwise fullscreen rect. */ - public void getBounds(Rect out) { + void getBounds(Rect out) { if (useCurrentBounds()) { // No need to adjust the output bounds if fullscreen or the docked stack is visible // since it is already what we want to represent to the rest of the system. @@ -433,9 +433,8 @@ class Task implements DimLayer.DimLayerUser { return; } - // The bounds has been adjusted to accommodate for a docked stack, but the docked stack - // is not currently visible. Go ahead a represent it as fullscreen to the rest of the - // system. + // The bounds has been adjusted to accommodate for a docked stack, but the docked stack is + // not currently visible. Go ahead a represent it as fullscreen to the rest of the system. mStack.getDisplayContent().getLogicalDisplayRect(out); } diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 7748c6a8ffb8..a75f2c96a0c9 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -485,7 +485,7 @@ public class TaskStack implements DimLayer.DimLayerUser { } } - void getStackDockedModeBoundsLocked(Rect outBounds) { + void getStackDockedModeBoundsLocked(Rect outBounds, boolean ignoreVisibilityOnKeyguardShowing) { if (!StackId.isResizeableByDockedStack(mStackId) || mDisplayContent == null) { outBounds.set(mBounds); return; @@ -497,11 +497,11 @@ public class TaskStack implements DimLayer.DimLayerUser { throw new IllegalStateException( "Calling getStackDockedModeBoundsLocked() when there is no docked stack."); } - if (!dockedStack.isVisibleLocked()) { + if (!dockedStack.isVisibleLocked(ignoreVisibilityOnKeyguardShowing)) { // The docked stack is being dismissed, but we caught before it finished being // dismissed. In that case we want to treat it as if it is not occupying any space and // let others occupy the whole display. - mDisplayContent.getLogicalDisplayRect(mTmpRect); + mDisplayContent.getLogicalDisplayRect(outBounds); return; } @@ -782,10 +782,19 @@ public class TaskStack implements DimLayer.DimLayerUser { } boolean isVisibleLocked() { + return isVisibleLocked(false); + } + + boolean isVisibleLocked(boolean ignoreVisibilityOnKeyguardShowing) { final boolean keyguardOn = mService.mPolicy.isKeyguardShowingOrOccluded(); if (keyguardOn && !StackId.isAllowedOverLockscreen(mStackId)) { - return false; + // The keyguard is showing and the stack shouldn't show on top of the keyguard. + // We return false for visibility except in cases where the caller wants us to return + // true for visibility when the keyguard is showing. One example, is if the docked + // is being resized due to orientation while the keyguard is on. + return ignoreVisibilityOnKeyguardShowing; } + for (int i = mTasks.size() - 1; i >= 0; i--) { Task task = mTasks.get(i); for (int j = task.mAppTokens.size() - 1; j >= 0; j--) { diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 4fa38561423c..adc2da4d50b4 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -4801,11 +4801,12 @@ public class WindowManagerService extends IWindowManager.Stub } } - public void getStackDockedModeBounds(int stackId, Rect bounds) { + public void getStackDockedModeBounds( + int stackId, Rect bounds, boolean ignoreVisibilityOnKeyguardShowing) { synchronized (mWindowMap) { final TaskStack stack = mStackIdToStack.get(stackId); if (stack != null) { - stack.getStackDockedModeBoundsLocked(bounds); + stack.getStackDockedModeBoundsLocked(bounds, ignoreVisibilityOnKeyguardShowing); return; } bounds.setEmpty(); |