Fix broken transition to secure apps when relaunching

Previously, the logic for keeping occluded mode during transitions
would also trigger when transitioning from the lockscreen to a
SHOW_WHEN_LOCKED activity that was already on-screen, which would
then prematurely clear the occluded mode and break the launch
transition.

With the fix, the lockscreen must already be occluded before the
keep-occluded-during-transitions logic is triggered.

Bug: 21525170
Change-Id: I1d9ad95b2dd0728af7986f09adb67a617cc62cb2
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 671c44e..6a63aab 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -4264,7 +4264,7 @@
             // that is being hidden in an animation - keep the
             // keyguard hidden until the new window shows up and
             // we know whether to show the keyguard or not.
-            if (win.isAnimatingLw() && appWindow && showWhenLocked) {
+            if (win.isAnimatingLw() && appWindow && showWhenLocked && mKeyguardHidden) {
                 mHideLockScreen = true;
                 mWinShowWhenLocked = win;
             }