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

Commit 19e32c09 authored by Justin Weir's avatar Justin Weir
Browse files

Remove some code from NPVC and ShadeViewController

Moves one method in NPVC to its one call site. Moves another to
ShadeController and deprecates it. Helps to decouple status bar
icon hiding from NPVC.

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Manual and presubmits
Bug: 303267342
Change-Id: If60efec91aba69161d8ce3a2c3037d2721e13e62
parent aa042523
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -35,10 +35,10 @@ import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.plugins.ActivityStarter.OnDismissAction
import com.android.systemui.settings.UserTracker
import com.android.systemui.shade.ShadeController
import com.android.systemui.shade.ShadeViewController
import com.android.systemui.shade.data.repository.FakeShadeRepository
import com.android.systemui.shade.data.repository.ShadeAnimationRepository
import com.android.systemui.shade.domain.interactor.ShadeAnimationInteractorLegacyImpl
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.NotificationLockscreenUserManager
import com.android.systemui.statusbar.NotificationShadeWindowController
import com.android.systemui.statusbar.SysuiStatusBarStateController
@@ -76,7 +76,7 @@ class ActivityStarterImplTest : SysuiTestCase() {
    @Mock private lateinit var biometricUnlockController: BiometricUnlockController
    @Mock private lateinit var keyguardViewMediator: KeyguardViewMediator
    @Mock private lateinit var shadeController: ShadeController
    @Mock private lateinit var shadeViewController: ShadeViewController
    @Mock private lateinit var commandQueue: CommandQueue
    @Mock private lateinit var statusBarKeyguardViewManager: StatusBarKeyguardViewManager
    @Mock private lateinit var mActivityTransitionAnimator: ActivityTransitionAnimator
    @Mock private lateinit var lockScreenUserManager: NotificationLockscreenUserManager
@@ -105,7 +105,7 @@ class ActivityStarterImplTest : SysuiTestCase() {
                Lazy { biometricUnlockController },
                Lazy { keyguardViewMediator },
                Lazy { shadeController },
                Lazy { shadeViewController },
                commandQueue,
                shadeAnimationInteractor,
                Lazy { statusBarKeyguardViewManager },
                Lazy { notifShadeWindowController },
+1 −24
Original line number Diff line number Diff line
@@ -111,8 +111,6 @@ import com.android.keyguard.dagger.KeyguardUserSwitcherComponent;
import com.android.systemui.DejankUtils;
import com.android.systemui.Dumpable;
import com.android.systemui.Gefingerpoken;
import com.android.systemui.animation.ActivityTransitionAnimator;
import com.android.systemui.animation.TransitionAnimator;
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor;
import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants;
@@ -219,7 +217,6 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.phone.TapAgainViewController;
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController;
@@ -259,10 +256,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    private static final boolean DEBUG_DRAWABLE = false;
    /** The parallax amount of the quick settings translation when dragging down the panel. */
    public static final float QS_PARALLAX_AMOUNT = 0.175f;
    private static final long ANIMATION_DELAY_ICON_FADE_IN =
            ActivityTransitionAnimator.TIMINGS.getTotalDuration()
                    - CollapsedStatusBarFragment.FADE_IN_DURATION
                    - CollapsedStatusBarFragment.FADE_IN_DELAY - 48;
    private static final int NO_FIXED_DURATION = -1;
    private static final long SHADE_OPEN_SPRING_OUT_DURATION = 350L;
    private static final long SHADE_OPEN_SPRING_BACK_DURATION = 400L;
@@ -463,7 +456,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
     */
    private float mLinearDarkAmount;
    private boolean mPulsing;
    private boolean mHideIconsDuringLaunchAnimation = true;
    private int mStackScrollerMeasuringPass;
    /** Non-null if a heads-up notification's position is being tracked. */
    @Nullable
@@ -3157,10 +3149,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        return mUnlockedScreenOffAnimationController.isAnimationPlaying();
    }

    @Override
    public boolean shouldHideStatusBarIconsWhenExpanded() {
        if (isLaunchingActivity()) {
            return mHideIconsDuringLaunchAnimation;
            return false;
        }
        if (mHeadsUpAppearanceController != null
                && mHeadsUpAppearanceController.shouldBeVisible()) {
@@ -3257,18 +3248,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mKeyguardStatusViewController.setStatusAccessibilityImportance(mode);
    }

    @Override
    public void applyLaunchAnimationProgress(float linearProgress) {
        boolean hideIcons = TransitionAnimator.getProgress(ActivityTransitionAnimator.TIMINGS,
                linearProgress, ANIMATION_DELAY_ICON_FADE_IN, 100) == 0.0f;
        if (hideIcons != mHideIconsDuringLaunchAnimation) {
            mHideIconsDuringLaunchAnimation = hideIcons;
            if (!hideIcons) {
                mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */);
            }
        }
    }

    @Override
    public void performHapticFeedback(int constant) {
        mVibratorHelper.performHapticFeedback(mView, constant);
@@ -3471,7 +3450,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        ipw.print("mInterpolatedDarkAmount="); ipw.println(mInterpolatedDarkAmount);
        ipw.print("mLinearDarkAmount="); ipw.println(mLinearDarkAmount);
        ipw.print("mPulsing="); ipw.println(mPulsing);
        ipw.print("mHideIconsDuringLaunchAnimation="); ipw.println(mHideIconsDuringLaunchAnimation);
        ipw.print("mStackScrollerMeasuringPass="); ipw.println(mStackScrollerMeasuringPass);
        ipw.print("mPanelAlpha="); ipw.println(mPanelAlpha);
        ipw.print("mBottomAreaShadeAlpha="); ipw.println(mBottomAreaShadeAlpha);
@@ -4163,7 +4141,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        return mShadeRepository.getLegacyIsClosing().getValue();
    }

    @Override
    public void collapseWithDuration(int animationDuration) {
        mFixedDuration = animationDuration;
        collapse(false /* delayed */, 1.0f /* speedUpFactor */);
+8 −0
Original line number Diff line number Diff line
@@ -78,6 +78,14 @@ public interface ShadeController extends CoreStartable {
     */
    void animateCollapseShade(int flags, boolean force, boolean delayed, float speedUpFactor);

    /**
     * Collapses the shade with an animation duration in milliseconds.
     *
     * @deprecated use animateCollapseShade with a speed up factor instead
     */
    @Deprecated
    void collapseWithDuration(int animationDuration);

    /** Expand the shade with an animation. */
    void animateExpandShade();

+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ open class ShadeControllerEmptyImpl @Inject constructor() : ShadeController {
        delayed: Boolean,
        speedUpFactor: Float
    ) {}
    override fun collapseWithDuration(animationDuration: Int) {}
    override fun animateExpandShade() {}
    override fun animateExpandQs() {}
    override fun postAnimateCollapseShade() {}
+5 −1
Original line number Diff line number Diff line
@@ -146,6 +146,11 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {
        }
    }

    @Override
    public void collapseWithDuration(int animationDuration) {
        mNpvc.get().collapseWithDuration(animationDuration);
    }

    @Override
    protected void expandToNotifications() {
        getNpvc().expandToNotifications();
@@ -221,7 +226,6 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {
        }
    }


    @Override
    public void collapseShade(boolean animate) {
        if (animate) {
Loading