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

Commit d2f98086 authored by Matt Pietal's avatar Matt Pietal
Browse files

Clean up newAodTranstion() flag

It shipped many months ago.

Bug: 301915812
Test: atest KeyguardRootViewModelTest
Flag: com.android.systemui.new_aod_transition
Change-Id: I63650f7605df047dfc36e95b207bf44ad91e067c
parent b241d683
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR
import com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT
import com.android.systemui.Flags.FLAG_NEW_AOD_TRANSITION
import com.android.systemui.SysuiTestCase
import com.android.systemui.communal.data.repository.communalSceneRepository
import com.android.systemui.communal.shared.model.CommunalScenes
@@ -74,11 +73,7 @@ import platform.test.runner.parameterized.Parameters

@SmallTest
@RunWith(ParameterizedAndroidJunit4::class)
@EnableFlags(
    FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT,
    FLAG_NEW_AOD_TRANSITION,
    FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR,
)
@EnableFlags(FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR)
class KeyguardRootViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
+1 −48
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import com.android.internal.jank.InteractionJankMonitor.CUJ_SCREEN_OFF_SHOW_AOD
import com.android.keyguard.AuthInteractionProperties
import com.android.systemui.Flags
import com.android.systemui.Flags.msdlFeedback
import com.android.systemui.Flags.newAodTransition
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.Text
import com.android.systemui.common.shared.model.TintedIcon
@@ -593,7 +592,7 @@ object KeyguardRootViewBinder {
                        View.INVISIBLE
                    }
            }
            newAodTransition() -> {
            else -> {
                animateInIconTranslation()
                if (isVisible.value) {
                    CrossFadeHelper.fadeIn(this, animatorListener)
@@ -601,52 +600,6 @@ object KeyguardRootViewBinder {
                    CrossFadeHelper.fadeOut(this, animatorListener)
                }
            }
            !isVisible.value -> {
                // Let's make sure the icon are translated to 0, since we cancelled it above
                animateInIconTranslation()
                CrossFadeHelper.fadeOut(this, animatorListener)
            }
            visibility != View.VISIBLE -> {
                // No fading here, let's just appear the icons instead!
                visibility = View.VISIBLE
                alpha = 1f
                appearIcons(
                    animate = screenOffAnimationController.shouldAnimateAodIcons(),
                    iconsAppearTranslationPx,
                    animatorListener,
                )
            }
            else -> {
                // Let's make sure the icons are translated to 0, since we cancelled it above
                animateInIconTranslation()
                // We were fading out, let's fade in instead
                CrossFadeHelper.fadeIn(this, animatorListener)
            }
        }
    }

    private fun View.appearIcons(
        animate: Boolean,
        iconAppearTranslation: Int,
        animatorListener: Animator.AnimatorListener,
    ) {
        if (animate) {
            if (!MigrateClocksToBlueprint.isEnabled) {
                translationY = -iconAppearTranslation.toFloat()
            }
            alpha = 0f
            animate()
                .alpha(1f)
                .setInterpolator(Interpolators.LINEAR)
                .setDuration(AOD_ICONS_APPEAR_DURATION)
                .apply { if (MigrateClocksToBlueprint.isEnabled) animateInIconTranslation() }
                .setListener(animatorListener)
                .start()
        } else {
            alpha = 1.0f
            if (!MigrateClocksToBlueprint.isEnabled) {
                translationY = 0f
            }
        }
    }

+2 −5
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ package com.android.systemui.keyguard.ui.viewmodel
import android.graphics.Point
import android.util.MathUtils
import android.view.View.VISIBLE
import com.android.systemui.Flags.newAodTransition
import com.android.app.tracing.coroutines.launch
import com.android.systemui.common.shared.model.NotificationContainerBounds
import com.android.systemui.communal.domain.interactor.CommunalInteractor
import com.android.systemui.dagger.SysUISingleton
@@ -386,10 +386,7 @@ constructor(
                        !dozeParameters.alwaysOn -> false
                        // Don't animate when going to AOD if the display needs blanking.
                        dozeParameters.displayNeedsBlanking -> false
                        // We only want the appear animations to happen when the notifications
                        // get fully hidden, since otherwise the un-hide animation overlaps.
                        newAodTransition() -> true
                        else -> fullyHidden
                        else -> true
                    }
                AnimatableEvent(fullyHidden, animate)
            }
+0 −10
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import static android.view.MotionEvent.ACTION_UP;

import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_SCROLL_FLING;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_SHADE_CLEAR_ALL;
import static com.android.systemui.Flags.newAodTransition;
import static com.android.systemui.Flags.notificationOverExpansionClippingFix;
import static com.android.systemui.statusbar.notification.stack.NotificationPriorityBucketKt.BUCKET_SILENT;
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_SWIPE;
@@ -1549,15 +1548,6 @@ public class NotificationStackScrollLayout

    @VisibleForTesting
    public void updateInterpolatedStackHeight(float endHeight, float fraction) {
        if (!newAodTransition()) {
            // During the (AOD<=>LS) transition where dozeAmount is changing,
            // apply dozeAmount to stack height instead of expansionFraction
            // to unfurl notifications on AOD=>LS wakeup (and furl up on LS=>AOD sleep)
            final float dozeAmount = mAmbientState.getDozeAmount();
            if (0f < dozeAmount && dozeAmount < 1f) {
                fraction = 1f - dozeAmount;
            }
        }
        mAmbientState.setInterpolatedStackHeight(
                MathUtils.lerp(endHeight * StackScrollAlgorithm.START_FRACTION,
                        endHeight, fraction));
+1 −2
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static androidx.lifecycle.Lifecycle.State.RESUMED;
import static com.android.systemui.Dependency.TIME_TICK_HANDLER_NAME;
import static com.android.systemui.Flags.keyboardShortcutHelperRewrite;
import static com.android.systemui.Flags.lightRevealMigration;
import static com.android.systemui.Flags.newAodTransition;
import static com.android.systemui.Flags.relockWithPowerButtonImmediately;
import static com.android.systemui.Flags.statusBarSignalPolicyRefactor;
import static com.android.systemui.charging.WirelessChargingAnimation.UNKNOWN_BATTERY_LEVEL;
@@ -2547,7 +2546,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
            mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
                mDeviceInteractive = true;

                boolean isFlaggedOff = newAodTransition() && MigrateClocksToBlueprint.isEnabled();
                boolean isFlaggedOff = MigrateClocksToBlueprint.isEnabled();
                if (!isFlaggedOff && shouldAnimateDozeWakeup()) {
                    // If this is false, the power button must be physically pressed in order to
                    // trigger fingerprint authentication.
Loading