diff options
| author | 2017-10-05 00:05:18 +0000 | |
|---|---|---|
| committer | 2017-10-05 00:05:18 +0000 | |
| commit | 52fd6caa9428b33f4a895bf2f9ad740fab6ecd7d (patch) | |
| tree | 5b6d34d867c59778e8d71f8ebfc14ca5313ed9ea | |
| parent | 1f94184990edda3ebf4776a21a60c147977a81ca (diff) | |
| parent | 1d74b205130215322d68bdcf13800490d3568c9d (diff) | |
Merge "Disable seamless-rotation when other windows are visible." into oc-mr1-dev am: 59c258d83b
am: 1d74b20513
Change-Id: If1b2315f1364913ddf1c7e9a9879cb9d92901474
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 17 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/Session.java | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index bdf46c76d73a..8fc9dda3722a 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -969,10 +969,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo final int lastOrientation = mLastOrientation; final boolean oldAltOrientation = mAltOrientation; int rotation = mService.mPolicy.rotationForOrientationLw(lastOrientation, oldRotation); - final boolean rotateSeamlessly = mService.mPolicy.shouldRotateSeamlessly(oldRotation, + boolean mayRotateSeamlessly = mService.mPolicy.shouldRotateSeamlessly(oldRotation, rotation); - if (rotateSeamlessly) { + if (mayRotateSeamlessly) { final WindowState seamlessRotated = getWindow((w) -> w.mSeamlesslyRotated); if (seamlessRotated != null) { // We can't rotate (seamlessly or not) while waiting for the last seamless rotation @@ -981,7 +981,20 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // window-removal. return false; } + + // In the presence of the PINNED stack or System Alert + // windows we unforuntately can not seamlessly rotate. + if (getStackById(PINNED_STACK_ID) != null) { + mayRotateSeamlessly = false; + } + for (int i = 0; i < mService.mSessions.size(); i++) { + if (mService.mSessions.valueAt(i).hasAlertWindowSurfaces()) { + mayRotateSeamlessly = false; + break; + } + } } + final boolean rotateSeamlessly = mayRotateSeamlessly; // TODO: Implement forced rotation changes. // Set mAltOrientation to indicate that the application is receiving diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index 178124776823..4dd147e53588 100644 --- a/services/core/java/com/android/server/wm/Session.java +++ b/services/core/java/com/android/server/wm/Session.java @@ -719,4 +719,8 @@ public class Session extends IWindowSession.Stub public String toString() { return mStringName; } + + boolean hasAlertWindowSurfaces() { + return !mAlertWindowSurfaces.isEmpty(); + } } |