From 124c7e37e446e928d8ff91c45851520579883d01 Mon Sep 17 00:00:00 2001 From: Collin Fijalkovich Date: Fri, 30 Apr 2021 16:33:02 +0000 Subject: [PATCH] Revert "Enable remote animation for keygaurd going away." This reverts commit d0ba2859dd8cc851475b0e481adde30cb0eae795. Reason for revert: Checking for cause of test breakage Change-Id: I32f434f2e0c9b7d20bcd0ba51c0b770df8dfa575 --- .../systemui/keyguard/KeyguardService.java | 28 ++++--------------- .../KeyguardUnlockAnimationController.kt | 2 +- .../keyguard/KeyguardViewMediator.java | 2 +- .../server/policy/PhoneWindowManager.java | 2 +- .../keyguard/KeyguardServiceDelegate.java | 6 ++-- .../server/wm/WindowManagerService.java | 27 ++---------------- 6 files changed, 13 insertions(+), 54 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index f1431f5cd40be..666afed41c351 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -51,7 +51,6 @@ import com.android.internal.policy.IKeyguardExitCallback; import com.android.internal.policy.IKeyguardService; import com.android.internal.policy.IKeyguardStateCallback; import com.android.systemui.SystemUIApplication; -import com.android.wm.shell.transition.Transitions; import javax.inject.Inject; @@ -63,29 +62,16 @@ public class KeyguardService extends Service { * Run Keyguard animation as remote animation in System UI instead of local animation in * the server process. * - * 0: Runs all keyguard animation as local animation - * 1: Only runs keyguard going away animation as remote animation - * 2: Runs all keyguard animation as remote animation - * * Note: Must be consistent with WindowManagerService. */ private static final String ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY = "persist.wm.enable_remote_keyguard_animation"; - private static final int sEnableRemoteKeyguardAnimation = - SystemProperties.getInt(ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY, 1); - /** * @see #ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY */ - public static boolean sEnableRemoteKeyguardGoingAwayAnimation = - !Transitions.ENABLE_SHELL_TRANSITIONS && sEnableRemoteKeyguardAnimation >= 1; - - /** - * @see #ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY - */ - public static boolean sEnableRemoteKeyguardOccludeAnimation = - !Transitions.ENABLE_SHELL_TRANSITIONS && sEnableRemoteKeyguardAnimation >= 2; + static boolean sEnableRemoteKeyguardAnimation = + SystemProperties.getBoolean(ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY, false); private final KeyguardViewMediator mKeyguardViewMediator; private final KeyguardLifecyclesDispatcher mKeyguardLifecyclesDispatcher; @@ -97,22 +83,20 @@ public class KeyguardService extends Service { mKeyguardViewMediator = keyguardViewMediator; mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher; - RemoteAnimationDefinition definition = new RemoteAnimationDefinition(); - if (sEnableRemoteKeyguardGoingAwayAnimation) { + if (sEnableRemoteKeyguardAnimation) { + RemoteAnimationDefinition definition = new RemoteAnimationDefinition(); final RemoteAnimationAdapter exitAnimationAdapter = new RemoteAnimationAdapter(mExitAnimationRunner, 0, 0); definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_GOING_AWAY, exitAnimationAdapter); definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER, exitAnimationAdapter); - } - if (sEnableRemoteKeyguardOccludeAnimation) { final RemoteAnimationAdapter occludeAnimationAdapter = new RemoteAnimationAdapter(mOccludeAnimationRunner, 0, 0); definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_OCCLUDE, occludeAnimationAdapter); definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_UNOCCLUDE, occludeAnimationAdapter); + ActivityTaskManager.getInstance().registerRemoteAnimationsForDisplay( + DEFAULT_DISPLAY, definition); } - ActivityTaskManager.getInstance().registerRemoteAnimationsForDisplay( - DEFAULT_DISPLAY, definition); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt index 85ee0dca88059..411c328cd3101 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt @@ -280,7 +280,7 @@ class KeyguardUnlockAnimationController @Inject constructor( } override fun onKeyguardDismissAmountChanged() { - if (!KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation) { + if (!KeyguardService.sEnableRemoteKeyguardAnimation) { return } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index b7da7addf027a..48f9a58d7d1ac 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2100,7 +2100,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, playSounds(false); } - if (KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation) { + if (KeyguardService.sEnableRemoteKeyguardAnimation) { mSurfaceBehindRemoteAnimationFinishedCallback = finishedCallback; mSurfaceBehindRemoteAnimationRunning = true; diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 3ee8b4408e584..29496b31b4a5e 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -3021,7 +3021,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { private int handleStartTransitionForKeyguardLw(boolean keyguardGoingAway, long duration) { final int res = applyKeyguardOcclusionChange(); if (res != 0) return res; - if (!WindowManagerService.sEnableRemoteKeyguardGoingAwayAnimation && keyguardGoingAway) { + if (!WindowManagerService.sEnableRemoteKeyguardAnimation && keyguardGoingAway) { if (DEBUG_KEYGUARD) Slog.d(TAG, "Starting keyguard exit animation"); startKeyguardExitAnimation(SystemClock.uptimeMillis(), duration); } diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java index 6e478ee7bf1b5..44f14b4d5b0df 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java @@ -263,8 +263,7 @@ public class KeyguardServiceDelegate { */ @Deprecated public void setOccluded(boolean isOccluded, boolean animate) { - if (!WindowManagerService.sEnableRemoteKeyguardOccludeAnimation - && mKeyguardService != null) { + if (!WindowManagerService.sEnableRemoteKeyguardAnimation && mKeyguardService != null) { if (DEBUG) Log.v(TAG, "setOccluded(" + isOccluded + ") animate=" + animate); mKeyguardService.setOccluded(isOccluded, animate); } @@ -404,8 +403,7 @@ public class KeyguardServiceDelegate { } public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) { - if (!WindowManagerService.sEnableRemoteKeyguardGoingAwayAnimation - && mKeyguardService != null) { + if (!WindowManagerService.sEnableRemoteKeyguardAnimation && mKeyguardService != null) { mKeyguardService.startKeyguardExitAnimation(startTime, fadeoutDuration); } } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 69fee2ddace76..9e8b6a34e1d52 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -420,42 +420,19 @@ public class WindowManagerService extends IWindowManager.Stub static boolean sDisableCustomTaskAnimationProperty = SystemProperties.getBoolean(DISABLE_CUSTOM_TASK_ANIMATION_PROPERTY, true); - /** - * Use WMShell for app transition. - */ - public static final String ENABLE_SHELL_TRANSITIONS = "persist.debug.shell_transit"; - - /** - * @see #ENABLE_SHELL_TRANSITIONS - */ - public static final boolean sEnableShellTransitions = - SystemProperties.getBoolean(ENABLE_SHELL_TRANSITIONS, false); - /** * Run Keyguard animation as remote animation in System UI instead of local animation in * the server process. - * - * 0: Runs all keyguard animation as local animation - * 1: Only runs keyguard going away animation as remote animation - * 2: Runs all keyguard animation as remote animation */ private static final String ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY = "persist.wm.enable_remote_keyguard_animation"; - private static final int sEnableRemoteKeyguardAnimation = - SystemProperties.getInt(ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY, 1); - /** * @see #ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY */ - public static final boolean sEnableRemoteKeyguardGoingAwayAnimation = !sEnableShellTransitions - && sEnableRemoteKeyguardAnimation >= 1; + public static boolean sEnableRemoteKeyguardAnimation = + SystemProperties.getBoolean(ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY, false); - /** - * @see #ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY - */ - public static final boolean sEnableRemoteKeyguardOccludeAnimation = !sEnableShellTransitions - && sEnableRemoteKeyguardAnimation >= 2; /** * Allows a fullscreen windowing mode activity to launch in its desired orientation directly