Loading core/java/android/view/WindowManagerPolicy.java +4 −5 Original line number Original line Diff line number Diff line Loading @@ -74,7 +74,6 @@ import android.graphics.Rect; import android.os.Bundle; import android.os.Bundle; import android.os.IBinder; import android.os.IBinder; import android.os.Looper; import android.os.Looper; import android.os.PowerManager; import android.os.RemoteException; import android.os.RemoteException; import android.util.Slog; import android.util.Slog; import android.view.animation.Animation; import android.view.animation.Animation; Loading Loading @@ -1317,12 +1316,12 @@ public interface WindowManagerPolicy { public boolean isScreenOn(); public boolean isScreenOn(); /** /** * @return whether the device is currently {@link PowerManager#isInteractive() interactive}. * @return whether the device is currently allowed to animate. * * * Note: the screen can be on while the device is not interactive, e.g. when the device is * Note: this can be true even if it is not appropriate to animate for reasons that are outside * showing Ambient Display. * of the policy's authority. */ */ boolean isInteractive(); boolean okToAnimate(); /** /** * Tell the policy that the lid switch has changed state. * Tell the policy that the lid switch has changed state. Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +11 −3 Original line number Original line Diff line number Diff line Loading @@ -3168,10 +3168,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override @Override public void selectRotationAnimationLw(int anim[]) { public void selectRotationAnimationLw(int anim[]) { // If the screen is off or non-interactive, force a jumpcut. final boolean forceJumpcut = !mScreenOnFully || !mAwake; if (PRINT_ANIM) Slog.i(TAG, "selectRotationAnimation mTopFullscreen=" if (PRINT_ANIM) Slog.i(TAG, "selectRotationAnimation mTopFullscreen=" + mTopFullscreenOpaqueWindowState + " rotationAnimation=" + mTopFullscreenOpaqueWindowState + " rotationAnimation=" + (mTopFullscreenOpaqueWindowState == null ? + (mTopFullscreenOpaqueWindowState == null ? "0" : mTopFullscreenOpaqueWindowState.getAttrs().rotationAnimation)); "0" : mTopFullscreenOpaqueWindowState.getAttrs().rotationAnimation) + " forceJumpcut=" + forceJumpcut); if (forceJumpcut) { anim[0] = R.anim.rotation_animation_jump_exit; anim[1] = R.anim.rotation_animation_enter; return; } if (mTopFullscreenOpaqueWindowState != null) { if (mTopFullscreenOpaqueWindowState != null) { int animationHint = mTopFullscreenOpaqueWindowState.getRotationAnimationHint(); int animationHint = mTopFullscreenOpaqueWindowState.getRotationAnimationHint(); if (animationHint < 0 && mTopIsFullscreen) { if (animationHint < 0 && mTopIsFullscreen) { Loading Loading @@ -6829,8 +6837,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } @Override @Override public boolean isInteractive() { public boolean okToAnimate() { return mAwake; return mAwake && !mGoingToSleep; } } /** {@inheritDoc} */ /** {@inheritDoc} */ Loading services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2403,7 +2403,7 @@ public class WindowManagerService extends IWindowManager.Stub } } boolean okToAnimate() { boolean okToAnimate() { return okToDisplay() && mPolicy.isInteractive(); return okToDisplay() && mPolicy.okToAnimate(); } } @Override @Override Loading services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -382,7 +382,7 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { } } @Override @Override public boolean isInteractive() { public boolean okToAnimate() { return true; return true; } } Loading Loading
core/java/android/view/WindowManagerPolicy.java +4 −5 Original line number Original line Diff line number Diff line Loading @@ -74,7 +74,6 @@ import android.graphics.Rect; import android.os.Bundle; import android.os.Bundle; import android.os.IBinder; import android.os.IBinder; import android.os.Looper; import android.os.Looper; import android.os.PowerManager; import android.os.RemoteException; import android.os.RemoteException; import android.util.Slog; import android.util.Slog; import android.view.animation.Animation; import android.view.animation.Animation; Loading Loading @@ -1317,12 +1316,12 @@ public interface WindowManagerPolicy { public boolean isScreenOn(); public boolean isScreenOn(); /** /** * @return whether the device is currently {@link PowerManager#isInteractive() interactive}. * @return whether the device is currently allowed to animate. * * * Note: the screen can be on while the device is not interactive, e.g. when the device is * Note: this can be true even if it is not appropriate to animate for reasons that are outside * showing Ambient Display. * of the policy's authority. */ */ boolean isInteractive(); boolean okToAnimate(); /** /** * Tell the policy that the lid switch has changed state. * Tell the policy that the lid switch has changed state. Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +11 −3 Original line number Original line Diff line number Diff line Loading @@ -3168,10 +3168,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override @Override public void selectRotationAnimationLw(int anim[]) { public void selectRotationAnimationLw(int anim[]) { // If the screen is off or non-interactive, force a jumpcut. final boolean forceJumpcut = !mScreenOnFully || !mAwake; if (PRINT_ANIM) Slog.i(TAG, "selectRotationAnimation mTopFullscreen=" if (PRINT_ANIM) Slog.i(TAG, "selectRotationAnimation mTopFullscreen=" + mTopFullscreenOpaqueWindowState + " rotationAnimation=" + mTopFullscreenOpaqueWindowState + " rotationAnimation=" + (mTopFullscreenOpaqueWindowState == null ? + (mTopFullscreenOpaqueWindowState == null ? "0" : mTopFullscreenOpaqueWindowState.getAttrs().rotationAnimation)); "0" : mTopFullscreenOpaqueWindowState.getAttrs().rotationAnimation) + " forceJumpcut=" + forceJumpcut); if (forceJumpcut) { anim[0] = R.anim.rotation_animation_jump_exit; anim[1] = R.anim.rotation_animation_enter; return; } if (mTopFullscreenOpaqueWindowState != null) { if (mTopFullscreenOpaqueWindowState != null) { int animationHint = mTopFullscreenOpaqueWindowState.getRotationAnimationHint(); int animationHint = mTopFullscreenOpaqueWindowState.getRotationAnimationHint(); if (animationHint < 0 && mTopIsFullscreen) { if (animationHint < 0 && mTopIsFullscreen) { Loading Loading @@ -6829,8 +6837,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } @Override @Override public boolean isInteractive() { public boolean okToAnimate() { return mAwake; return mAwake && !mGoingToSleep; } } /** {@inheritDoc} */ /** {@inheritDoc} */ Loading
services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2403,7 +2403,7 @@ public class WindowManagerService extends IWindowManager.Stub } } boolean okToAnimate() { boolean okToAnimate() { return okToDisplay() && mPolicy.isInteractive(); return okToDisplay() && mPolicy.okToAnimate(); } } @Override @Override Loading
services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -382,7 +382,7 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { } } @Override @Override public boolean isInteractive() { public boolean okToAnimate() { return true; return true; } } Loading