Don't freeze display if it isn't okay to animate.

In window manager world you freeze the display because you want to
do a rotation animation and that has the effect to allowing anything
to influence the display orientation while the display is frozing.
However, when the display is being turned off with the power button
we still want the lockscreen to influence the display orientation so
there is no rotation animation when the screen comes one.
We already have a concept okToAnimate() used to determine if we should
run animations. We now also use it to determine if we should freeze the
display since freezing the display is a result of want to running a
rotation animation.

Fixes: 63760853
Test: Repro. steps from bug.
Test: go/wm-smoke
Change-Id: I9abeda1bd0018f519772f0edce05ea8025efbbbe
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 5bd5e21..2caac7a 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -6003,9 +6003,9 @@
             return;
         }
 
-        if (!displayContent.isReady() || !mPolicy.isScreenOn()) {
-            // No need to freeze the screen before the display is ready, system is ready, or if
-            // the screen is off.
+        if (!displayContent.isReady() || !mPolicy.isScreenOn() || !okToAnimate()) {
+            // No need to freeze the screen before the display is ready,  if the screen is off,
+            // or we can't currently animate.
             return;
         }