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

Commit 0340a164 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Hide manage & clear affordances on transition to KG" into tm-dev

parents b46b98ee b76c8250
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -93,6 +93,12 @@ public interface StatusBarStateController {
        default void onStateChanged(int newState) {
        }

        /**
         * Callback to be notified about upcoming state changes. Typically, is immediately followed
         * by #onStateChanged, unless there was an intentional delay in updating the state changed.
         */
        default void onUpcomingStateChanged(int upcomingState) {}

        /**
         * Callback to be notified when Dozing changes. Dozing is stored separately from state.
         */
+13 −3
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ public class StatusBarStateControllerImpl implements
            }
            mLastState = mState;
            mState = state;
            mUpcomingState = state;
            updateUpcomingState(mState);
            mUiEventLogger.log(StatusBarStateEvent.fromState(mState));
            Trace.instantForTrack(Trace.TRACE_TAG_APP, "UI Events", "StatusBarState " + tag);
            for (RankedListener rl : new ArrayList<>(mListeners)) {
@@ -223,8 +223,18 @@ public class StatusBarStateControllerImpl implements

    @Override
    public void setUpcomingState(int nextState) {
        mUpcomingState = nextState;
        recordHistoricalState(mUpcomingState /* newState */, mState /* lastState */, true);
        recordHistoricalState(nextState /* newState */, mState /* lastState */, true);
        updateUpcomingState(nextState);

    }

    private void updateUpcomingState(int upcomingState) {
        if (mUpcomingState != upcomingState) {
            mUpcomingState = upcomingState;
            for (RankedListener rl : new ArrayList<>(mListeners)) {
                rl.mListener.onUpcomingStateChanged(mUpcomingState);
            }
        }
    }

    @Override
+10 −1
Original line number Diff line number Diff line
@@ -427,6 +427,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private boolean mInHeadsUpPinnedMode;
    private boolean mHeadsUpAnimatingAway;
    private int mStatusBarState;
    private int mUpcomingStatusBarState;
    private int mCachedBackgroundColor;
    private boolean mHeadsUpGoingAwayAnimationsAllowed = true;
    private Runnable mReflingAndAnimateScroll = () -> {
@@ -690,7 +691,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                mController.hasActiveClearableNotifications(ROWS_ALL);
        boolean showFooterView = (showDismissView || mController.getVisibleNotificationCount() > 0)
                && mIsCurrentUserSetup  // see: b/193149550
                && mStatusBarState != StatusBarState.KEYGUARD
                && !onKeyguard()
                && mUpcomingStatusBarState != StatusBarState.KEYGUARD
                // quick settings don't affect notifications when not in full screen
                && (mQsExpansionFraction != 1 || !mQsFullScreen)
                && !mScreenOffAnimationController.shouldHideNotificationsFooter()
@@ -4960,6 +4962,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        updateDismissBehavior();
    }

    void setUpcomingStatusBarState(int upcomingStatusBarState) {
        mUpcomingStatusBarState = upcomingStatusBarState;
        if (mUpcomingStatusBarState != mStatusBarState) {
            updateFooter();
        }
    }

    void onStatePostChange(boolean fromShadeLocked) {
        boolean onKeyguard = onKeyguard();

+5 −0
Original line number Diff line number Diff line
@@ -309,6 +309,11 @@ public class NotificationStackScrollLayoutController {
                    mView.setStatusBarState(mBarState);
                }

                @Override
                public void onUpcomingStateChanged(int newState) {
                    mView.setUpcomingStatusBarState(newState);
                }

                @Override
                public void onStatePostChange() {
                    mView.updateSensitiveness(mStatusBarStateController.goingToFullShade(),