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

Commit 7298ec00 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I8ba68ea7,Icb95446e

* changes:
  Move Some Touch Handling out of NSSL
  Remove ScrimController from NSSL
parents 8dca2313 2cee9ecc
Loading
Loading
Loading
Loading
+72 −143
Original line number Original line Diff line number Diff line
@@ -92,7 +92,6 @@ import com.android.systemui.Dumpable;
import com.android.systemui.ExpandHelper;
import com.android.systemui.ExpandHelper;
import com.android.systemui.Interpolators;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.DragDownHelper.DragDownCallback;
import com.android.systemui.statusbar.DragDownHelper.DragDownCallback;
@@ -125,9 +124,6 @@ import com.android.systemui.statusbar.notification.row.ExpandableView;
import com.android.systemui.statusbar.notification.row.FooterView;
import com.android.systemui.statusbar.notification.row.FooterView;
import com.android.systemui.statusbar.notification.row.ForegroundServiceDungeonView;
import com.android.systemui.statusbar.notification.row.ForegroundServiceDungeonView;
import com.android.systemui.statusbar.notification.row.NotificationBlockingHelperManager;
import com.android.systemui.statusbar.notification.row.NotificationBlockingHelperManager;
import com.android.systemui.statusbar.notification.row.NotificationGuts;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.row.NotificationSnooze;
import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;
import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.HeadsUpTouchHelper;
import com.android.systemui.statusbar.phone.HeadsUpTouchHelper;
@@ -136,7 +132,6 @@ import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUi
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.NotificationGroupManager.OnGroupChangeListener;
import com.android.systemui.statusbar.phone.NotificationGroupManager.OnGroupChangeListener;
import com.android.systemui.statusbar.phone.NotificationPanelViewController;
import com.android.systemui.statusbar.phone.NotificationPanelViewController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.policy.HeadsUpUtil;
import com.android.systemui.statusbar.policy.HeadsUpUtil;
@@ -339,7 +334,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            = new HashSet<>();
            = new HashSet<>();
    private final NotificationRoundnessManager mRoundnessManager;
    private final NotificationRoundnessManager mRoundnessManager;
    private boolean mTrackingHeadsUp;
    private boolean mTrackingHeadsUp;
    private ScrimController mScrimController;
    private boolean mForceNoOverlappingRendering;
    private boolean mForceNoOverlappingRendering;
    private final ArrayList<Pair<ExpandableNotificationRow, Boolean>> mTmpList = new ArrayList<>();
    private final ArrayList<Pair<ExpandableNotificationRow, Boolean>> mTmpList = new ArrayList<>();
    private boolean mAnimationRunning;
    private boolean mAnimationRunning;
@@ -494,7 +488,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private Interpolator mHideXInterpolator = Interpolators.FAST_OUT_SLOW_IN;
    private Interpolator mHideXInterpolator = Interpolators.FAST_OUT_SLOW_IN;
    private NotificationPanelViewController mNotificationPanelController;
    private NotificationPanelViewController mNotificationPanelController;


    private final NotificationGutsManager mNotificationGutsManager;
    private final NotificationSectionsManager mSectionsManager;
    private final NotificationSectionsManager mSectionsManager;
    private final ForegroundServiceSectionController mFgsSectionController;
    private final ForegroundServiceSectionController mFgsSectionController;
    private ForegroundServiceDungeonView mFgsSectionView;
    private ForegroundServiceDungeonView mFgsSectionView;
@@ -510,6 +503,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private boolean mKeyguardMediaControllorVisible;
    private boolean mKeyguardMediaControllorVisible;
    private NotificationEntry mTopHeadsUpEntry;
    private NotificationEntry mTopHeadsUpEntry;
    private long mNumHeadsUp;
    private long mNumHeadsUp;
    private NotificationStackScrollLayoutController.TouchHandler mTouchHandler;


    private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener =
    private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener =
            new ExpandableView.OnHeightChangedListener() {
            new ExpandableView.OnHeightChangedListener() {
@@ -559,7 +553,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            NotificationRoundnessManager notificationRoundnessManager,
            NotificationRoundnessManager notificationRoundnessManager,
            DynamicPrivacyController dynamicPrivacyController,
            DynamicPrivacyController dynamicPrivacyController,
            SysuiStatusBarStateController statusbarStateController,
            SysuiStatusBarStateController statusbarStateController,
            NotificationGutsManager notificationGutsManager,
            NotificationSectionsManager notificationSectionsManager,
            NotificationSectionsManager notificationSectionsManager,
            ForegroundServiceSectionController fgsSectionController,
            ForegroundServiceSectionController fgsSectionController,
            ForegroundServiceDismissalFeatureController fgsFeatureController,
            ForegroundServiceDismissalFeatureController fgsFeatureController,
@@ -573,8 +566,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        Resources res = getResources();
        Resources res = getResources();


        mRoundnessManager = notificationRoundnessManager;
        mRoundnessManager = notificationRoundnessManager;

        mNotificationGutsManager = notificationGutsManager;
        mFgsSectionController = fgsSectionController;
        mFgsSectionController = fgsSectionController;


        mSectionsManager = notificationSectionsManager;
        mSectionsManager = notificationSectionsManager;
@@ -927,7 +918,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    }
    }


    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    private void updateBackgroundDimming() {
    void updateBackgroundDimming() {
        // No need to update the background color if it's not being drawn.
        // No need to update the background color if it's not being drawn.
        if (!mShouldDrawNotificationBackground) {
        if (!mShouldDrawNotificationBackground) {
            return;
            return;
@@ -3724,58 +3715,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    }
    }


    @Override
    @Override
    @ShadeViewRefactor(RefactorComponent.INPUT)
    public boolean onTouchEvent(MotionEvent ev) {
    public boolean onTouchEvent(MotionEvent ev) {
        NotificationGuts guts = mNotificationGutsManager.getExposedGuts();
        if (mTouchHandler != null && mTouchHandler.onTouchEvent(ev)) {
        boolean isCancelOrUp = ev.getActionMasked() == MotionEvent.ACTION_CANCEL
            return true;
                || ev.getActionMasked() == MotionEvent.ACTION_UP;
        handleEmptySpaceClick(ev);
        boolean expandWantsIt = false;
        boolean swipingInProgress = mSwipingInProgress;
        if (mIsExpanded && !swipingInProgress && !mOnlyScrollingInThisMotion && guts == null) {
            if (isCancelOrUp) {
                mExpandHelper.onlyObserveMovements(false);
            }
            boolean wasExpandingBefore = mExpandingNotification;
            expandWantsIt = mExpandHelper.onTouchEvent(ev);
            if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore
                    && !mDisallowScrollingInThisMotion) {
                dispatchDownEventToScroller(ev);
            }
        }
        boolean scrollerWantsIt = false;
        if (mIsExpanded && !swipingInProgress && !mExpandingNotification
                && !mDisallowScrollingInThisMotion) {
            scrollerWantsIt = onScrollTouch(ev);
        }
        boolean horizontalSwipeWantsIt = false;
        if (!mIsBeingDragged
                && !mExpandingNotification
                && !mExpandedInThisMotion
                && !mOnlyScrollingInThisMotion
                && !mDisallowDismissInThisMotion) {
            horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev);
        }
        }


        // Check if we need to clear any snooze leavebehinds
        return super.onTouchEvent(ev);
        if (guts != null && !NotificationSwipeHelper.isTouchInView(ev, guts)
                && guts.getGutsContent() instanceof NotificationSnooze) {
            NotificationSnooze ns = (NotificationSnooze) guts.getGutsContent();
            if ((ns.isExpanded() && isCancelOrUp)
                    || (!horizontalSwipeWantsIt && scrollerWantsIt)) {
                // If the leavebehind is expanded we clear it on the next up event, otherwise we
                // clear it on the next non-horizontal swipe or expand event.
                checkSnoozeLeavebehind();
            }
        }
        if (ev.getActionMasked() == MotionEvent.ACTION_UP) {
            mCheckForLeavebehind = true;
        }
        return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || super.onTouchEvent(ev);
    }
    }


    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    private void dispatchDownEventToScroller(MotionEvent ev) {
    void dispatchDownEventToScroller(MotionEvent ev) {
        MotionEvent downEvent = MotionEvent.obtain(ev);
        MotionEvent downEvent = MotionEvent.obtain(ev);
        downEvent.setAction(MotionEvent.ACTION_DOWN);
        downEvent.setAction(MotionEvent.ACTION_DOWN);
        onScrollTouch(downEvent);
        onScrollTouch(downEvent);
@@ -3824,7 +3773,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    }
    }


    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    private boolean onScrollTouch(MotionEvent ev) {
    boolean onScrollTouch(MotionEvent ev) {
        if (!isScrollingEnabled()) {
        if (!isScrollingEnabled()) {
            return false;
            return false;
        }
        }
@@ -3913,7 +3862,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
                        customOverScrollBy((int) scrollAmount, mOwnScrollY,
                        customOverScrollBy((int) scrollAmount, mOwnScrollY,
                                range, getHeight() / 2);
                                range, getHeight() / 2);
                        // If we're scrolling, leavebehinds should be dismissed
                        // If we're scrolling, leavebehinds should be dismissed
                        checkSnoozeLeavebehind();
                        mController.checkSnoozeLeavebehind();
                    }
                    }
                }
                }
                break;
                break;
@@ -4031,44 +3980,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    @Override
    @Override
    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    public boolean onInterceptTouchEvent(MotionEvent ev) {
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        initDownStates(ev);
        if (mTouchHandler != null && mTouchHandler.onInterceptTouchEvent(ev)) {
        handleEmptySpaceClick(ev);
            return true;

        NotificationGuts guts = mNotificationGutsManager.getExposedGuts();
        boolean expandWantsIt = false;
        boolean swipingInProgress = mSwipingInProgress;
        if (!swipingInProgress && !mOnlyScrollingInThisMotion && guts == null) {
            expandWantsIt = mExpandHelper.onInterceptTouchEvent(ev);
        }
        boolean scrollWantsIt = false;
        if (!swipingInProgress && !mExpandingNotification) {
            scrollWantsIt = onInterceptTouchEventScroll(ev);
        }
        boolean swipeWantsIt = false;
        if (!mIsBeingDragged
                && !mExpandingNotification
                && !mExpandedInThisMotion
                && !mOnlyScrollingInThisMotion
                && !mDisallowDismissInThisMotion) {
            swipeWantsIt = mSwipeHelper.onInterceptTouchEvent(ev);
        }
        // Check if we need to clear any snooze leavebehinds
        boolean isUp = ev.getActionMasked() == MotionEvent.ACTION_UP;
        if (!NotificationSwipeHelper.isTouchInView(ev, guts) && isUp && !swipeWantsIt &&
                !expandWantsIt && !scrollWantsIt) {
            mCheckForLeavebehind = false;
            mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */,
                    false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */,
                    false /* resetMenu */);
        }
        if (ev.getActionMasked() == MotionEvent.ACTION_UP) {
            mCheckForLeavebehind = true;
        }
        }
        return swipeWantsIt || scrollWantsIt || expandWantsIt || super.onInterceptTouchEvent(ev);
        return super.onInterceptTouchEvent(ev);
    }
    }


    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    private void handleEmptySpaceClick(MotionEvent ev) {
    void handleEmptySpaceClick(MotionEvent ev) {
        switch (ev.getActionMasked()) {
        switch (ev.getActionMasked()) {
            case MotionEvent.ACTION_MOVE:
            case MotionEvent.ACTION_MOVE:
                final float touchSlop = getTouchSlop(ev);
                final float touchSlop = getTouchSlop(ev);
@@ -4087,7 +4006,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    }
    }


    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    private void initDownStates(MotionEvent ev) {
    void initDownStates(MotionEvent ev) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            mExpandedInThisMotion = false;
            mExpandedInThisMotion = false;
            mOnlyScrollingInThisMotion = !mScroller.isFinished();
            mOnlyScrollingInThisMotion = !mScroller.isFinished();
@@ -4109,7 +4028,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    }
    }


    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    private boolean onInterceptTouchEventScroll(MotionEvent ev) {
    boolean onInterceptTouchEventScroll(MotionEvent ev) {
        if (!isScrollingEnabled()) {
        if (!isScrollingEnabled()) {
            return false;
            return false;
        }
        }
@@ -4304,29 +4223,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        return false;
        return false;
    }
    }


    @ShadeViewRefactor(RefactorComponent.INPUT)
    public void closeControlsIfOutsideTouch(MotionEvent ev) {
        NotificationGuts guts = mNotificationGutsManager.getExposedGuts();
        NotificationMenuRowPlugin menuRow = mSwipeHelper.getCurrentMenuRow();
        View translatingParentView = mSwipeHelper.getTranslatingParentView();
        View view = null;
        if (guts != null && !guts.getGutsContent().isLeavebehind()) {
            // Only close visible guts if they're not a leavebehind.
            view = guts;
        } else if (menuRow != null && menuRow.isMenuVisible()
                && translatingParentView != null) {
            // Checking menu
            view = translatingParentView;
        }
        if (view != null && !NotificationSwipeHelper.isTouchInView(ev, view)) {
            // Touch was outside visible guts / menu notification, close what's visible
            mNotificationGutsManager.closeAndSaveGuts(false /* removeLeavebehind */,
                    false /* force */, true /* removeControls */, -1 /* x */, -1 /* y */,
                    false /* resetMenu */);
            resetExposedMenuView(true /* animate */, true /* force */);
        }
    }

    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
    void setSwipingInProgress(boolean swiping) {
    void setSwipingInProgress(boolean swiping) {
        mSwipingInProgress = swiping;
        mSwipingInProgress = swiping;
@@ -4362,32 +4258,15 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        return Math.max(mMaxLayoutHeight - mContentHeight, 0);
        return Math.max(mMaxLayoutHeight - mContentHeight, 0);
    }
    }


    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    void checkSnoozeLeavebehind() {
        if (mCheckForLeavebehind) {
            mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */,
                    false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */,
                    false /* resetMenu */);
            mCheckForLeavebehind = false;
        }
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    void resetCheckSnoozeLeavebehind() {
        mCheckForLeavebehind = true;
    }

    @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
    @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
    void onExpansionStarted() {
    void onExpansionStarted() {
        mIsExpansionChanging = true;
        mIsExpansionChanging = true;
        mAmbientState.setExpansionChanging(true);
        mAmbientState.setExpansionChanging(true);
        checkSnoozeLeavebehind();
    }
    }


    @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
    @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
    void onExpansionStopped() {
    void onExpansionStopped() {
        mIsExpansionChanging = false;
        mIsExpansionChanging = false;
        resetCheckSnoozeLeavebehind();
        mAmbientState.setExpansionChanging(false);
        mAmbientState.setExpansionChanging(false);
        if (!mIsExpanded) {
        if (!mIsExpanded) {
            resetScrollPosition();
            resetScrollPosition();
@@ -5171,12 +5050,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mRoundnessManager.setTrackingHeadsUp(row);
        mRoundnessManager.setTrackingHeadsUp(row);
    }
    }


    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    public void setScrimController(ScrimController scrimController) {
        mScrimController = scrimController;
        mScrimController.setScrimBehindChangeRunnable(this::updateBackgroundDimming);
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    public void forceNoOverlappingRendering(boolean force) {
    public void forceNoOverlappingRendering(boolean force) {
        mForceNoOverlappingRendering = force;
        mForceNoOverlappingRendering = force;
@@ -5802,6 +5675,58 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mAmbientState.setHasAlertEntries(numHeadsUp > 0);
        mAmbientState.setHasAlertEntries(numHeadsUp > 0);
    }
    }


    boolean getSwipingInProgress() {
        return mSwipingInProgress;
    }

    public boolean getIsExpanded() {
        return mIsExpanded;
    }

    boolean getOnlyScrollingInThisMotion() {
        return mOnlyScrollingInThisMotion;
    }

    ExpandHelper getExpandHelper() {
        return mExpandHelper;
    }

    boolean isExpandingNotification() {
        return mExpandingNotification;
    }

    boolean getDisallowScrollingInThisMotion() {
        return mDisallowScrollingInThisMotion;
    }

    boolean isBeingDragged() {
        return mIsBeingDragged;
    }

    boolean getExpandedInThisMotion() {
        return mExpandedInThisMotion;
    }

    boolean getDisallowDismissInThisMotion() {
        return mDisallowDismissInThisMotion;
    }

    void setCheckForLeaveBehind(boolean checkForLeaveBehind) {
        mCheckForLeavebehind = checkForLeaveBehind;
    }

    void setTouchHandler(NotificationStackScrollLayoutController.TouchHandler touchHandler) {
        mTouchHandler = touchHandler;
    }

    boolean isSwipingInProgress() {
        return mSwipingInProgress;
    }

    boolean getCheckSnoozeLeaveBehind() {
        return mCheckForLeavebehind;
    }

    /**
    /**
     * A listener that is notified when the empty space below the notifications is clicked on
     * A listener that is notified when the empty space below the notifications is clicked on
     */
     */
@@ -5897,7 +5822,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    }
    }


    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    void resetExposedMenuView(boolean animate, boolean force) {
    private void resetExposedMenuView(boolean animate, boolean force) {
        mSwipeHelper.resetExposedMenuView(animate, force);
        mSwipeHelper.resetExposedMenuView(animate, force);
    }
    }


@@ -6255,6 +6180,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mKeyguardMediaControllorVisible = keyguardMediaControllorVisible;
        mKeyguardMediaControllorVisible = keyguardMediaControllorVisible;
    }
    }


    void resetCheckSnoozeLeavebehind() {
        setCheckForLeaveBehind(true);
    }

    // ---------------------- DragDownHelper.OnDragDownListener ------------------------------------
    // ---------------------- DragDownHelper.OnDragDownListener ------------------------------------


    @ShadeViewRefactor(RefactorComponent.INPUT)
    @ShadeViewRefactor(RefactorComponent.INPUT)
@@ -6307,7 +6236,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        @Override
        @Override
        public void onTouchSlopExceeded() {
        public void onTouchSlopExceeded() {
            cancelLongPress();
            cancelLongPress();
            checkSnoozeLeavebehind();
            mController.checkSnoozeLeavebehind();
        }
        }


        @Override
        @Override
+143 −13

File changed.

Preview size limit exceeded, changes collapsed.

+1 −3
Original line number Original line Diff line number Diff line
@@ -3140,15 +3140,13 @@ public class NotificationPanelViewController extends PanelViewController {
    public void initDependencies(
    public void initDependencies(
            StatusBar statusBar,
            StatusBar statusBar,
            NotificationGroupManager groupManager,
            NotificationGroupManager groupManager,
            NotificationShelfController notificationShelfController,
            NotificationShelfController notificationShelfController) {
            ScrimController scrimController) {
        setStatusBar(statusBar);
        setStatusBar(statusBar);
        setGroupManager(mGroupManager);
        setGroupManager(mGroupManager);
        mNotificationStackScrollLayoutController.setNotificationPanelController(this);
        mNotificationStackScrollLayoutController.setNotificationPanelController(this);
        mNotificationStackScrollLayoutController.setStatusBar(statusBar);
        mNotificationStackScrollLayoutController.setStatusBar(statusBar);
        mNotificationStackScrollLayoutController.setGroupManager(groupManager);
        mNotificationStackScrollLayoutController.setGroupManager(groupManager);
        mNotificationStackScrollLayoutController.setShelfController(notificationShelfController);
        mNotificationStackScrollLayoutController.setShelfController(notificationShelfController);
        mNotificationStackScrollLayoutController.setScrimController(scrimController);
        updateShowEmptyShadeView();
        updateShowEmptyShadeView();
        mNotificationShelfController = notificationShelfController;
        mNotificationShelfController = notificationShelfController;
        updateMaxDisplayedNotifications(true);
        updateMaxDisplayedNotifications(true);
+6 −2
Original line number Original line Diff line number Diff line
@@ -52,6 +52,7 @@ import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.util.InjectionInflationController;
import com.android.systemui.util.InjectionInflationController;
@@ -83,6 +84,7 @@ public class NotificationShadeWindowViewController {
    private final NotificationShadeWindowView mView;
    private final NotificationShadeWindowView mView;
    private final ShadeController mShadeController;
    private final ShadeController mShadeController;
    private final NotificationShadeDepthController mDepthController;
    private final NotificationShadeDepthController mDepthController;
    private final NotificationStackScrollLayoutController mNotificationStackScrollLayoutController;


    private GestureDetector mGestureDetector;
    private GestureDetector mGestureDetector;
    private View mBrightnessMirror;
    private View mBrightnessMirror;
@@ -130,7 +132,8 @@ public class NotificationShadeWindowViewController {
            NotificationShadeDepthController depthController,
            NotificationShadeDepthController depthController,
            NotificationShadeWindowView notificationShadeWindowView,
            NotificationShadeWindowView notificationShadeWindowView,
            NotificationPanelViewController notificationPanelViewController,
            NotificationPanelViewController notificationPanelViewController,
            SuperStatusBarViewFactory statusBarViewFactory) {
            SuperStatusBarViewFactory statusBarViewFactory,
            NotificationStackScrollLayoutController notificationStackScrollLayoutController) {
        mInjectionInflationController = injectionInflationController;
        mInjectionInflationController = injectionInflationController;
        mCoordinator = coordinator;
        mCoordinator = coordinator;
        mPulseExpansionHandler = pulseExpansionHandler;
        mPulseExpansionHandler = pulseExpansionHandler;
@@ -152,6 +155,7 @@ public class NotificationShadeWindowViewController {
        mNotificationPanelViewController = notificationPanelViewController;
        mNotificationPanelViewController = notificationPanelViewController;
        mDepthController = depthController;
        mDepthController = depthController;
        mStatusBarViewFactory = statusBarViewFactory;
        mStatusBarViewFactory = statusBarViewFactory;
        mNotificationStackScrollLayoutController = notificationStackScrollLayoutController;


        // This view is not part of the newly inflated expanded status bar.
        // This view is not part of the newly inflated expanded status bar.
        mBrightnessMirror = mView.findViewById(R.id.brightness_mirror);
        mBrightnessMirror = mView.findViewById(R.id.brightness_mirror);
@@ -245,7 +249,7 @@ public class NotificationShadeWindowViewController {
                    }
                    }
                }
                }
                if (isDown) {
                if (isDown) {
                    mStackScrollLayout.closeControlsIfOutsideTouch(ev);
                    mNotificationStackScrollLayoutController.closeControlsIfOutsideTouch(ev);
                }
                }
                if (mStatusBarStateController.isDozing()) {
                if (mStatusBarStateController.isDozing()) {
                    mService.mDozeScrimController.extendPulse();
                    mService.mDozeScrimController.extendPulse();
+14 −1
Original line number Original line Diff line number Diff line
@@ -141,6 +141,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
    private ScrimView mScrimBehind;
    private ScrimView mScrimBehind;
    private ScrimView mScrimForBubble;
    private ScrimView mScrimForBubble;


    private Runnable mScrimBehindChangeRunnable;

    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final DozeParameters mDozeParameters;
    private final DozeParameters mDozeParameters;
@@ -241,6 +243,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        mScrimInFront = scrimInFront;
        mScrimInFront = scrimInFront;
        mScrimForBubble = scrimForBubble;
        mScrimForBubble = scrimForBubble;


        if (mScrimBehindChangeRunnable != null) {
            mScrimBehind.setChangeRunnable(mScrimBehindChangeRunnable);
            mScrimBehindChangeRunnable = null;
        }

        final ScrimState[] states = ScrimState.values();
        final ScrimState[] states = ScrimState.values();
        for (int i = 0; i < states.length; i++) {
        for (int i = 0; i < states.length; i++) {
            states[i].init(mScrimInFront, mScrimBehind, mScrimForBubble, mDozeParameters,
            states[i].init(mScrimInFront, mScrimBehind, mScrimForBubble, mDozeParameters,
@@ -934,8 +941,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
    }
    }


    public void setScrimBehindChangeRunnable(Runnable changeRunnable) {
    public void setScrimBehindChangeRunnable(Runnable changeRunnable) {
        // TODO: remove this. This is necessary because of an order-of-operations limitation.
        // The fix is to move more of these class into @StatusBarScope
        if (mScrimBehind == null) {
            mScrimBehindChangeRunnable = changeRunnable;
        } else {
            mScrimBehind.setChangeRunnable(changeRunnable);
            mScrimBehind.setChangeRunnable(changeRunnable);
        }
        }
    }


    public void setCurrentUser(int currentUser) {
    public void setCurrentUser(int currentUser) {
        // Don't care in the base class.
        // Don't care in the base class.
Loading