Don't even think about changing keyguard transit

When camera was launched with a lockscreen wallpaper set, the
wallpaper target was launcher in that case, which was also in
mClosingApps because it was first getting shown by keyguard
exit but then immediately hidden by starting the camera,
before the transition started.

Now since lockscreen wasn't the wallpaper target, launcher was
already for some reason, and we changed the transit to
WALLPAPER_CLOSE as a window with the wallpaper target was in
mClosingApps.

Fix this by never ever changing away from keyguard transits.

Test: go/wm-smoke
Test: ActivityManagerTransitionSelectionTests
Test: Set lockscreen wallpaper, set animation duration scale to
0.5, insert a random sleep statement in SystemUI, launch
camera from screen off while in trusted state and camera
wasn't running before.
Fixes: 37677242
Change-Id: I984b66d7f117034f3d55591284dd822b5ec76cbd
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index c1c72ca..b1ed358 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -2044,7 +2044,10 @@
         if (forceOverride || isKeyguardTransit(transit) || !isTransitionSet()
                 || mNextAppTransition == TRANSIT_NONE) {
             setAppTransition(transit, flags);
-        } else if (!alwaysKeepCurrent) {
+        }
+        // We never want to change from a Keyguard transit to a non-Keyguard transit, as our logic
+        // relies on the fact that we always execute a Keyguard transition after preparing one.
+        else if (!alwaysKeepCurrent && !isKeyguardTransit(transit)) {
             if (transit == TRANSIT_TASK_OPEN && isTransitionEqual(TRANSIT_TASK_CLOSE)) {
                 // Opening a new task always supersedes a close for the anim.
                 setAppTransition(transit, flags);