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

Commit c7873f85 authored by Andreas Miko's avatar Andreas Miko Committed by Android (Google) Code Review
Browse files

Merge changes I6437a66f,I74016ae5,If44c2088 into main

* changes:
  Teamfood NEW_AOD_TRANSITION
  Teamfood LIGHT_REVEAL_MIGRATION
  Make AOD transitions more calm
parents e1572068 26f0d31f
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static com.android.keyguard.LockIconView.ICON_UNLOCK;
import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset;
import static com.android.systemui.flags.Flags.DOZING_MIGRATION_1;
import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
import static com.android.systemui.flags.Flags.NEW_AOD_TRANSITION;
import static com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION;
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;

@@ -99,6 +100,8 @@ public class LockIconViewController implements Dumpable {
    private static final VibrationAttributes TOUCH_VIBRATION_ATTRIBUTES =
            VibrationAttributes.createForUsage(VibrationAttributes.USAGE_TOUCH);

    private static final long FADE_OUT_DURATION_MS = 250L;

    private final long mLongPressTimeout;
    @NonNull private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    @NonNull private final KeyguardViewController mKeyguardViewController;
@@ -388,6 +391,16 @@ public class LockIconViewController implements Dumpable {
            mView.updateIcon(ICON_LOCK, true);
            mView.setContentDescription(mLockedLabel);
            mView.setVisibility(View.VISIBLE);
        } else if (mIsDozing && mFeatureFlags.isEnabled(NEW_AOD_TRANSITION)) {
            mView.animate()
                    .alpha(0f)
                    .setDuration(FADE_OUT_DURATION_MS)
                    .withEndAction(() -> {
                        mView.clearIcon();
                        mView.setVisibility(View.INVISIBLE);
                        mView.setContentDescription(null);
                    })
                    .start();
        } else {
            mView.clearIcon();
            mView.setVisibility(View.INVISIBLE);
+5 −1
Original line number Diff line number Diff line
@@ -176,7 +176,11 @@ object Flags {
     */
    // TODO(b/281655028): Tracking bug
    @JvmField
    val LIGHT_REVEAL_MIGRATION = unreleasedFlag("light_reveal_migration", teamfood = false)
    val LIGHT_REVEAL_MIGRATION = unreleasedFlag("light_reveal_migration", teamfood = true)

    // TODO(b/301915812): Tracking Bug
    @JvmField
    val NEW_AOD_TRANSITION = unreleasedFlag("new_aod_transition", teamfood = true)

    /** Flag to control the migration of face auth to modern architecture. */
    // TODO(b/262838215): Tracking bug
+8 −3
Original line number Diff line number Diff line
@@ -134,7 +134,14 @@ object KeyguardQuickAffordanceViewBinder {
        vibratorHelper: VibratorHelper?,
    ) {
        if (!viewModel.isVisible) {
            view.isInvisible = true
            view.alpha = 1f
            view
                    .animate()
                    .alpha(0f)
                    .setInterpolator(Interpolators.FAST_OUT_LINEAR_IN)
                    .setDuration(EXIT_DOZE_BUTTON_REVEAL_ANIMATION_DURATION_MS)
                    .withEndAction { view.isInvisible = true }
                    .start()
            return
        }

@@ -142,11 +149,9 @@ object KeyguardQuickAffordanceViewBinder {
            view.isVisible = true
            if (viewModel.animateReveal) {
                view.alpha = 0f
                view.translationY = view.height / 2f
                view
                    .animate()
                    .alpha(1f)
                    .translationY(0f)
                    .setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN)
                    .setDuration(EXIT_DOZE_BUTTON_REVEAL_ANIMATION_DURATION_MS)
                    .start()
+32 −17
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.systemui.demomode.DemoMode
import com.android.systemui.demomode.DemoModeController
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.flags.Flags.NEW_AOD_TRANSITION
import com.android.systemui.flags.ViewRefactorFlag
import com.android.systemui.plugins.DarkIconDispatcher
import com.android.systemui.plugins.statusbar.StatusBarStateController
@@ -88,7 +89,7 @@ constructor(
    private val bubblesOptional: Optional<Bubbles>,
    demoModeController: DemoModeController,
    darkIconDispatcher: DarkIconDispatcher,
    featureFlags: FeatureFlags,
    private val featureFlags: FeatureFlags,
    private val statusBarWindowController: StatusBarWindowController,
    private val screenOffAnimationController: ScreenOffAnimationController,
    private val shelfIconsViewModel: NotificationIconContainerShelfViewModel,
@@ -299,10 +300,13 @@ constructor(
        var animate = true
        if (!bypassController.bypassEnabled) {
            animate = dozeParameters.alwaysOn && !dozeParameters.displayNeedsBlanking
            // We only want the appear animations to happen when the notifications get fully hidden,
            if (!featureFlags.isEnabled(NEW_AOD_TRANSITION)) {
                // We only want the appear animations to happen when the notifications get fully
                // hidden,
                // since otherwise the unhide animation overlaps
                animate = animate and isFullyHidden
            }
        }
        updateAodIconsVisibility(animate, false /* force */)
        updateAodNotificationIcons()
        updateAodIconColors()
@@ -657,6 +661,15 @@ constructor(
            aodIconsVisible = visible
            aodIcons!!.animate().cancel()
            if (animate) {
                if (featureFlags.isEnabled(NEW_AOD_TRANSITION)) {
                    // Let's make sure the icon are translated to 0, since we cancelled it above
                    animateInAodIconTranslation()
                    if (aodIconsVisible) {
                        CrossFadeHelper.fadeIn(aodIcons)
                    } else {
                        CrossFadeHelper.fadeOut(aodIcons)
                    }
                } else {
                    val wasFullyInvisible = aodIcons!!.visibility != View.VISIBLE
                    if (aodIconsVisible) {
                        if (wasFullyInvisible) {
@@ -665,7 +678,8 @@ constructor(
                            aodIcons!!.alpha = 1.0f
                            appearAodIcons()
                        } else {
                        // Let's make sure the icon are translated to 0, since we cancelled it above
                            // Let's make sure the icon are translated to 0, since we cancelled it
                            // above
                            animateInAodIconTranslation()
                            // We were fading out, let's fade in instead
                            CrossFadeHelper.fadeIn(aodIcons)
@@ -675,6 +689,7 @@ constructor(
                        animateInAodIconTranslation()
                        CrossFadeHelper.fadeOut(aodIcons)
                    }
                }
            } else {
                aodIcons!!.alpha = 1.0f
                if (!statusViewMigrated) {
+1 −0
Original line number Diff line number Diff line
@@ -772,6 +772,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    /**
     * @return if the view is in heads up state, i.e either still heads upped or it's disappearing.
     */
    @Override
    public boolean isHeadsUpState() {
        return mIsHeadsUp || mHeadsupDisappearRunning;
    }
Loading