diff options
3 files changed, 26 insertions, 1 deletions
diff --git a/packages/SystemUI/res/values/flags.xml b/packages/SystemUI/res/values/flags.xml index 027f162445c0..b999e51bdaa5 100644 --- a/packages/SystemUI/res/values/flags.xml +++ b/packages/SystemUI/res/values/flags.xml @@ -36,6 +36,13 @@ <!-- The new animations to/from lockscreen and AOD! --> <bool name="flag_lockscreen_animations">false</bool> + <!-- The new swipe to unlock animation, which shows the app/launcher behind the keyguard during + the swipe. --> + <bool name="flag_new_unlock_swipe_animation">true</bool> + + <!-- The shared-element transition between lockscreen smartspace and launcher smartspace. --> + <bool name="flag_smartspace_shared_element_transition">false</bool> + <bool name="flag_pm_lite">true</bool> <bool name="flag_charging_ripple">false</bool> diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt index 38d153e38ca9..941f2c6f4282 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt @@ -31,6 +31,7 @@ import com.android.keyguard.KeyguardViewController import com.android.systemui.animation.Interpolators import com.android.systemui.dagger.SysUISingleton import com.android.systemui.shared.system.smartspace.SmartspaceTransitionController +import com.android.systemui.statusbar.FeatureFlags import com.android.systemui.statusbar.policy.KeyguardStateController import dagger.Lazy import javax.inject.Inject @@ -89,7 +90,8 @@ class KeyguardUnlockAnimationController @Inject constructor( private val keyguardStateController: KeyguardStateController, private val keyguardViewMediator: Lazy<KeyguardViewMediator>, private val keyguardViewController: KeyguardViewController, - private val smartspaceTransitionController: SmartspaceTransitionController + private val smartspaceTransitionController: SmartspaceTransitionController, + private val featureFlags: FeatureFlags ) : KeyguardStateController.Callback { /** @@ -346,6 +348,10 @@ class KeyguardUnlockAnimationController @Inject constructor( * keyguard visible. */ private fun updateKeyguardViewMediatorIfThresholdsReached() { + if (!featureFlags.isNewKeyguardSwipeAnimationEnabled) { + return + } + val dismissAmount = keyguardStateController.dismissAmount // Hide the keyguard if we're fully dismissed, or if we're swiping to dismiss and have @@ -382,6 +388,10 @@ class KeyguardUnlockAnimationController @Inject constructor( * know if it needs to do something as a result. */ private fun updateSmartSpaceTransition() { + if (!featureFlags.isSmartSpaceSharedElementTransitionEnabled) { + return + } + val dismissAmount = keyguardStateController.dismissAmount // If we've begun a swipe, and are capable of doing the SmartSpace transition, start it! diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/FeatureFlags.java b/packages/SystemUI/src/com/android/systemui/statusbar/FeatureFlags.java index 7e676197ddad..8e5d47f19acd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/FeatureFlags.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/FeatureFlags.java @@ -84,4 +84,12 @@ public class FeatureFlags { public boolean isSmartspaceDedupingEnabled() { return isSmartspaceEnabled() && mFlagReader.isEnabled(R.bool.flag_smartspace_deduping); } + + public boolean isNewKeyguardSwipeAnimationEnabled() { + return mFlagReader.isEnabled(R.bool.flag_new_unlock_swipe_animation); + } + + public boolean isSmartSpaceSharedElementTransitionEnabled() { + return mFlagReader.isEnabled(R.bool.flag_smartspace_shared_element_transition); + } } |