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

Commit c1b24f12 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

NSSL takes Runnable instead of ShadeController

Bug: 296118689
Test: manual
Flag: NA
Change-Id: Iefe85dc6e657fa7e582f58283cf088efc76e1489
parent 84cffef4
Loading
Loading
Loading
Loading
+4 −17
Original line number Diff line number Diff line
@@ -94,9 +94,7 @@ import com.android.systemui.flags.RefactorFlag;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.res.R;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.TouchLogger;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.EmptyShadeView;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.StatusBarState;
@@ -145,8 +143,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private static final String TAG = "StackScroller";
    private static final boolean SPEW = Log.isLoggable(TAG, Log.VERBOSE);

    // Delay in milli-seconds before shade closes for clear all.
    private static final int DELAY_BEFORE_SHADE_CLOSE = 200;
    private boolean mShadeNeedsToClose = false;

    @VisibleForTesting
@@ -481,7 +477,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private final Rect mTmpRect = new Rect();
    private ClearAllListener mClearAllListener;
    private ClearAllAnimationListener mClearAllAnimationListener;
    private ShadeController mShadeController;
    private Runnable mClearAllFinishedWhilePanelExpandedRunnable;
    private Consumer<Boolean> mOnStackYChanged;

    private Interpolator mHideXInterpolator = Interpolators.FAST_OUT_SLOW_IN;
@@ -4315,21 +4311,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            if (mShadeNeedsToClose) {
                mShadeNeedsToClose = false;
                if (mIsExpanded) {
                    collapseShadeDelayed();
                    mClearAllFinishedWhilePanelExpandedRunnable.run();
                }
            }
        }
    }

    private void collapseShadeDelayed() {
        postDelayed(
                () -> {
                    mShadeController.animateCollapseShade(
                            CommandQueue.FLAG_EXCLUDE_NONE);
                },
                DELAY_BEFORE_SHADE_CLOSE /* delayMillis */);
    }

    private void clearHeadsUpDisappearRunning() {
        for (int i = 0; i < getChildCount(); i++) {
            View view = getChildAt(i);
@@ -5680,8 +5667,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mFooterClearAllListener = listener;
    }

    void setShadeController(ShadeController shadeController) {
        mShadeController = shadeController;
    void setClearAllFinishedWhilePanelExpandedRunnable(Runnable runnable) {
        mClearAllFinishedWhilePanelExpandedRunnable = runnable;
    }

    /**
+8 −1
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.power.domain.interactor.PowerInteractor;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.LockscreenShadeTransitionController;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationLockscreenUserManager.UserChangedListener;
@@ -152,6 +153,8 @@ public class NotificationStackScrollLayoutController implements Dumpable {
    private static final String TAG = "StackScrollerController";
    private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
    private static final String HIGH_PRIORITY = "high_priority";
    /** Delay in milli-seconds before shade closes for clear all. */
    private static final int DELAY_BEFORE_SHADE_CLOSE = 200;

    private final boolean mAllowLongPress;
    private final NotificationGutsManager mNotificationGutsManager;
@@ -770,7 +773,11 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                mView.setIsRemoteInputActive(active);
            }
        });
        mView.setShadeController(mShadeController);
        mView.setClearAllFinishedWhilePanelExpandedRunnable(()-> {
            final Runnable doCollapseRunnable = () ->
                    mShadeController.animateCollapseShade(CommandQueue.FLAG_EXCLUDE_NONE);
            mView.postDelayed(doCollapseRunnable, /* delayMillis = */ DELAY_BEFORE_SHADE_CLOSE);
        });
        mDumpManager.registerDumpable(mView);

        mKeyguardBypassController.registerOnBypassStateChangedListener(