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

Commit 9b898b8f authored by Matt Pietal's avatar Matt Pietal
Browse files

[DO NOT MERGE] DREAMING->LOCKSCREEN, lockscreen updates

This will address this transition, as well as handle all general
unocclusion, by listening to the KeyguardTransitionRepository for
events rather than attempting to coordinate individual views across
many controllers.

To enable: adb shell cmd statusbar flag 223 true

Test: atest DreamingToLockscreenTransitionViewModelTest
KeyguardStatusViewTest KeyguardStatusViewControllerTest
NotificationPanelViewControllerTest
Bug: 260631205

Change-Id: I70d5b68a8f9c6b2fa738445d46435f3f09d1f68d
parent 4d3ec5c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1272,6 +1272,9 @@
         translate into their final position. -->
    <dimen name="lockscreen_shade_keyguard_transition_distance">@dimen/lockscreen_shade_media_transition_distance</dimen>

    <!-- DREAMING -> LOCKSCREEN transition: Amount to shift lockscreen content on entering -->
    <dimen name="dreaming_to_lockscreen_transition_lockscreen_translation_y">40dp</dimen>

    <!-- The amount of vertical offset for the keyguard during the full shade transition. -->
    <dimen name="lockscreen_shade_keyguard_transition_vertical_offset">0dp</dimen>

+5 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.keyguard;

import static java.util.Collections.emptySet;

import android.content.Context;
import android.os.Trace;
import android.util.AttributeSet;
@@ -88,8 +90,9 @@ public class KeyguardStatusView extends GridLayout {
    }

    /** Sets a translationY value on every child view except for the media view. */
    public void setChildrenTranslationYExcludingMediaView(float translationY) {
        setChildrenTranslationYExcluding(translationY, Set.of(mMediaHostContainer));
    public void setChildrenTranslationY(float translationY, boolean excludeMedia) {
        setChildrenTranslationYExcluding(translationY,
                excludeMedia ? Set.of(mMediaHostContainer) : emptySet());
    }

    /** Sets a translationY value on every view except for the views in the provided set. */
+7 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.graphics.Rect;
import android.util.Slog;

import com.android.keyguard.KeyguardClockSwitch.ClockSize;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.ClockAnimations;
import com.android.systemui.statusbar.notification.AnimatableProperty;
import com.android.systemui.statusbar.notification.PropertyAnimator;
@@ -59,6 +61,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
            KeyguardUpdateMonitor keyguardUpdateMonitor,
            ConfigurationController configurationController,
            DozeParameters dozeParameters,
            FeatureFlags featureFlags,
            ScreenOffAnimationController screenOffAnimationController) {
        super(keyguardStatusView);
        mKeyguardSliceViewController = keyguardSliceViewController;
@@ -67,6 +70,8 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
        mConfigurationController = configurationController;
        mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController,
                dozeParameters, screenOffAnimationController, /* animateYPos= */ true);
        mKeyguardVisibilityHelper.setOcclusionTransitionFlagEnabled(
                featureFlags.isEnabled(Flags.UNOCCLUSION_TRANSITION));
    }

    @Override
@@ -115,8 +120,8 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
    /**
     * Sets a translationY on the views on the keyguard, except on the media view.
     */
    public void setTranslationYExcludingMedia(float translationY) {
        mView.setChildrenTranslationYExcludingMediaView(translationY);
    public void setTranslationY(float translationY, boolean excludeMedia) {
        mView.setChildrenTranslationY(translationY, excludeMedia);
    }

    /**
+9 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class KeyguardVisibilityHelper {
    private boolean mAnimateYPos;
    private boolean mKeyguardViewVisibilityAnimating;
    private boolean mLastOccludedState = false;
    private boolean mIsUnoccludeTransitionFlagEnabled = false;
    private final AnimationProperties mAnimationProperties = new AnimationProperties();

    public KeyguardVisibilityHelper(View view,
@@ -62,6 +63,10 @@ public class KeyguardVisibilityHelper {
        return mKeyguardViewVisibilityAnimating;
    }

    public void setOcclusionTransitionFlagEnabled(boolean enabled) {
        mIsUnoccludeTransitionFlagEnabled = enabled;
    }

    /**
     * Set the visibility of a keyguard view based on some new state.
     */
@@ -129,7 +134,7 @@ public class KeyguardVisibilityHelper {
                // since it may need to be cancelled due to keyguard lifecycle events.
                mScreenOffAnimationController.animateInKeyguard(
                        mView, mAnimateKeyguardStatusViewVisibleEndRunnable);
            } else if (mLastOccludedState && !isOccluded) {
            } else if (!mIsUnoccludeTransitionFlagEnabled && mLastOccludedState && !isOccluded) {
                // An activity was displayed over the lock screen, and has now gone away
                mView.setVisibility(View.VISIBLE);
                mView.setAlpha(0f);
@@ -142,8 +147,10 @@ public class KeyguardVisibilityHelper {
                        .start();
            } else {
                mView.setVisibility(View.VISIBLE);
                if (!mIsUnoccludeTransitionFlagEnabled) {
                    mView.setAlpha(1f);
                }
            }
        } else {
            mView.setVisibility(View.GONE);
            mView.setAlpha(1f);
+9 −4
Original line number Diff line number Diff line
@@ -181,10 +181,6 @@ object Flags {
    @JvmField
    val LIGHT_REVEAL_MIGRATION = unreleasedFlag(218, "light_reveal_migration", teamfood = false)

    // TODO(b/262780002): Tracking Bug
    @JvmField
    val REVAMPED_WALLPAPER_UI = unreleasedFlag(222, "revamped_wallpaper_ui", teamfood = false)

    /** Flag to control the migration of face auth to modern architecture. */
    // TODO(b/262838215): Tracking bug
    @JvmField val FACE_AUTH_REFACTOR = unreleasedFlag(220, "face_auth_refactor")
@@ -193,6 +189,15 @@ object Flags {
    // TODO(b/244313043): Tracking bug
    @JvmField val BIOMETRICS_ANIMATION_REVAMP = unreleasedFlag(221, "biometrics_animation_revamp")

    // TODO(b/262780002): Tracking Bug
    @JvmField
    val REVAMPED_WALLPAPER_UI = unreleasedFlag(222, "revamped_wallpaper_ui", teamfood = false)

    /** A different path for unocclusion transitions back to keyguard */
    // TODO(b/262859270): Tracking Bug
    @JvmField
    val UNOCCLUSION_TRANSITION = unreleasedFlag(223, "unocclusion_transition", teamfood = false)

    // 300 - power menu
    // TODO(b/254512600): Tracking Bug
    @JvmField val POWER_MENU_LITE = releasedFlag(300, "power_menu_lite")
Loading