Merge "Update dock stack create mode after rotation if dock side changed" into nyc-dev
am: e55e4b7f73
* commit 'e55e4b7f73be3b3babd28581a839d0b9700d555d':
Update dock stack create mode after rotation if dock side changed
Change-Id: I6e0b7bd1775c7968c36b0ec0d470be8bde363c73
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.server.wm;
|
||||
|
||||
import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT;
|
||||
import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
|
||||
import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
|
||||
@@ -403,6 +404,13 @@ public class TaskStack implements DimLayer.DimLayerUser,
|
||||
snapDockedStackAfterRotation(mTmpRect2);
|
||||
final int newDockSide = getDockSide(mTmpRect2);
|
||||
if (oldDockSide != newDockSide) {
|
||||
// Update the dock create mode and clear the dock create bounds, these
|
||||
// might change after a rotation and the original values will be invalid.
|
||||
mService.setDockedStackCreateStateLocked(
|
||||
(newDockSide == DOCKED_LEFT || newDockSide == DOCKED_TOP)
|
||||
? DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT
|
||||
: DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT,
|
||||
null);
|
||||
mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4959,11 +4959,15 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
public void setDockedStackCreateState(int mode, Rect bounds) {
|
||||
synchronized (mWindowMap) {
|
||||
mDockedStackCreateMode = mode;
|
||||
mDockedStackCreateBounds = bounds;
|
||||
setDockedStackCreateStateLocked(mode, bounds);
|
||||
}
|
||||
}
|
||||
|
||||
void setDockedStackCreateStateLocked(int mode, Rect bounds) {
|
||||
mDockedStackCreateMode = mode;
|
||||
mDockedStackCreateBounds = bounds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new TaskStack and place it on a DisplayContent.
|
||||
* @param stackId The unique identifier of the new stack.
|
||||
|
||||
Reference in New Issue
Block a user