Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 505bcb2a authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Add flags for new unlock and smartspace transition." into sc-dev am: bba0b75b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15054108

Change-Id: I53b86fc67f27b2d102ab7728f9fd302bd1041461
parents 8b8e8cc1 bba0b75b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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>
+11 −1
Original line number Diff line number Diff line
@@ -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!
+8 −0
Original line number Diff line number Diff line
@@ -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);
    }
}