diff options
| -rw-r--r-- | services/core/java/com/android/server/policy/PhoneWindowManager.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 0b07902eb440..6295630a7a8e 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -7758,7 +7758,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // it and is in the fullscreen opaque state. Seamless rotation // requires freezing various Surface states and won't work well // with animations, so we disable it in the animation case for now. - if (w != null && mTopIsFullscreen && !w.isAnimatingLw() && + if (w != null && !w.isAnimatingLw() && ((w.getAttrs().rotationAnimation == ROTATION_ANIMATION_JUMPCUT) || (w.getAttrs().rotationAnimation == ROTATION_ANIMATION_SEAMLESS))) { return true; diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 6fdfaa25e14e..c0b2d336b33c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -6772,6 +6772,20 @@ public class WindowManagerService extends IWindowManager.Stub rotateSeamlessly = false; break; } + // In what can only be called an unfortunate workaround we require + // seamlessly rotated child windows to have the TRANSFORM_TO_DISPLAY_INVERSE + // flag. Due to limitations in the client API, there is no way for + // the client to set this flag in a race free fashion. If we seamlessly rotate + // a window which does not have this flag, but then gains it, we will get + // an incorrect visual result (rotated viewfinder). This means if we want to + // support seamlessly rotating windows which could gain this flag, we can't + // rotate windows without it. This limits seamless rotation in N to camera framework + // users, windows without children, and native code. This is unfortunate but + // having the camera work is our primary goal. + if (w.isChildWindow() & w.isVisibleNow() && + !w.mWinAnimator.mSurfaceController.getTransformToDisplayInverse()) { + rotateSeamlessly = false; + } } } |