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

Commit 4817ba36 authored by Caitlin Cassidy's avatar Caitlin Cassidy Committed by Automerger Merge Worker
Browse files

Merge "[Status Bar Refactor] 2.2/N: Migrate StatusBar's panelExpansionChanged...

Merge "[Status Bar Refactor] 2.2/N: Migrate StatusBar's panelExpansionChanged callback to the correct listener interface." into sc-v2-dev am: 56b6645a

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

Change-Id: I4cb5b65e5fdee2f463082ec8f03f4438c2ecf73c
parents a1bb44f4 56b6645a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -329,7 +329,9 @@ class NotificationShadeDepthController @Inject constructor(
    /**
     * Update blurs when pulling down the shade
     */
    override fun onPanelExpansionChanged(rawFraction: Float, tracking: Boolean) {
    override fun onPanelExpansionChanged(
        rawFraction: Float, expanded: Boolean, tracking: Boolean
    ) {
        val timestamp = SystemClock.elapsedRealtimeNanos()
        val expansion = MathUtils.saturate(
                (rawFraction - panelPullDownMinFraction) / (1f - panelPullDownMinFraction))
+1 −1
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
        this.state = newState
    }

    override fun onPanelExpansionChanged(fraction: Float, tracking: Boolean) {
    override fun onPanelExpansionChanged(fraction: Float, expanded: Boolean, tracking: Boolean) {
        val collapsedEnough = fraction <= 0.9f
        if (collapsedEnough != this.collapsedEnoughToHide) {
            val couldShowPulsingHuns = canShowPulsingHuns
+2 −1
Original line number Diff line number Diff line
@@ -1093,7 +1093,8 @@ public abstract class PanelViewController {
            mBar.panelExpansionChanged(mExpandedFraction, isExpanded());
        }
        updateVisibility();
        mPanelExpansionStateManager.onPanelExpansionChanged(mExpandedFraction, mTracking);
        mPanelExpansionStateManager.onPanelExpansionChanged(
                mExpandedFraction, isExpanded(), mTracking);
    }

    public boolean isExpanded() {
+1 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
            }
        });
        panelExpansionStateManager.addListener(
                (fraction, tracking) -> setRawPanelExpansionFraction(fraction)
                (fraction, expanded, tracking) -> setRawPanelExpansionFraction(fraction)
        );

        mColors = new GradientColors();
+11 −11
Original line number Diff line number Diff line
@@ -909,7 +909,7 @@ public class StatusBar extends SystemUI implements
        lockscreenShadeTransitionController.setStatusbar(this);

        mExpansionChangedListeners = new ArrayList<>();
        addExpansionChangedListener(this::onPanelExpansionChanged);
        mPanelExpansionStateManager.addListener(this::onPanelExpansionChanged);

        mBubbleExpandListener =
                (isExpanding, key) -> mContext.getMainExecutor().execute(() -> {
@@ -1158,8 +1158,6 @@ public class StatusBar extends SystemUI implements

        mNotificationIconAreaController.setupShelf(mNotificationShelfController);
        mPanelExpansionStateManager.addListener(mWakeUpCoordinator);
        mPanelExpansionStateManager.addListener(
                this::dispatchPanelExpansionForKeyguardDismiss);

        mUserSwitcherController.init(mNotificationShadeWindowView);

@@ -1425,15 +1423,15 @@ public class StatusBar extends SystemUI implements


    /**
     * When swiping up to dismiss the lock screen, the panel expansion goes from 1f to 0f. This
     * results in the clock/notifications/other content disappearing off the top of the screen.
     * When swiping up to dismiss the lock screen, the panel expansion fraction goes from 1f to 0f.
     * This results in the clock/notifications/other content disappearing off the top of the screen.
     *
     * We also use the expansion amount to animate in the app/launcher surface from the bottom of
     * We also use the expansion fraction to animate in the app/launcher surface from the bottom of
     * the screen, 'pushing' off the notifications and other content. To do this, we dispatch the
     * expansion amount to the KeyguardViewMediator if we're in the process of dismissing the
     * expansion fraction to the KeyguardViewMediator if we're in the process of dismissing the
     * keyguard.
     */
    private void dispatchPanelExpansionForKeyguardDismiss(float expansion, boolean trackingTouch) {
    private void dispatchPanelExpansionForKeyguardDismiss(float fraction, boolean trackingTouch) {
        // Things that mean we're not dismissing the keyguard, and should ignore this expansion:
        // - Keyguard isn't even visible.
        // - Keyguard is visible, but can't be dismissed (swiping up will show PIN/password prompt).
@@ -1452,12 +1450,14 @@ public class StatusBar extends SystemUI implements
                || mKeyguardViewMediator.isAnimatingBetweenKeyguardAndSurfaceBehindOrWillBe()
                || mKeyguardUnlockAnimationController.isUnlockingWithSmartSpaceTransition()) {
            mKeyguardStateController.notifyKeyguardDismissAmountChanged(
                    1f - expansion, trackingTouch);
                    1f - fraction, trackingTouch);
        }
    }

    private void onPanelExpansionChanged(float frac, boolean expanded) {
        if (frac == 0 || frac == 1) {
    private void onPanelExpansionChanged(float fraction, boolean expanded, boolean tracking) {
        dispatchPanelExpansionForKeyguardDismiss(fraction, tracking);

        if (fraction == 0 || fraction == 1) {
            if (getNavigationBarView() != null) {
                getNavigationBarView().onStatusBarPanelStateChanged();
            }
Loading