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

Commit 673c8f98 authored by Justin Weir's avatar Justin Weir
Browse files

Inline last call to ShadeViewController.disableHeader

Also moves initialization of ShadeHeaderController to ShadeStartable
along with some other start up code that didn't belong in
ShadeController.

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Updated and ran affected test
Bug: 303267342
Change-Id: Ib19e447b85b383d447bec2abc60833e77db5d63d
parent 5cc2c23b
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -17,8 +17,6 @@
package com.android.systemui.shade
package com.android.systemui.shade


import com.android.systemui.assist.AssistManager
import com.android.systemui.assist.AssistManager
import com.android.systemui.log.LogBuffer
import com.android.systemui.shade.TouchLogger.Companion.logTouchesTo
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.NotificationPresenter
import com.android.systemui.statusbar.NotificationPresenter
import com.android.systemui.statusbar.NotificationShadeWindowController
import com.android.systemui.statusbar.NotificationShadeWindowController
@@ -29,7 +27,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
/** A base class for non-empty implementations of ShadeController. */
/** A base class for non-empty implementations of ShadeController. */
@OptIn(ExperimentalCoroutinesApi::class)
@OptIn(ExperimentalCoroutinesApi::class)
abstract class BaseShadeControllerImpl(
abstract class BaseShadeControllerImpl(
    private val touchLog: LogBuffer,
    protected val commandQueue: CommandQueue,
    protected val commandQueue: CommandQueue,
    protected val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
    protected val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
    protected val notificationShadeWindowController: NotificationShadeWindowController,
    protected val notificationShadeWindowController: NotificationShadeWindowController,
@@ -40,7 +37,7 @@ abstract class BaseShadeControllerImpl(
    private val postCollapseActions = ArrayList<Runnable>()
    private val postCollapseActions = ArrayList<Runnable>()


    override fun start() {
    override fun start() {
        logTouchesTo(touchLog)
        // Do nothing by default
    }
    }


    final override fun animateExpandShade() {
    final override fun animateExpandShade() {
+0 −11
Original line number Original line Diff line number Diff line
@@ -336,7 +336,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    private final ScrimController mScrimController;
    private final ScrimController mScrimController;
    private final LockscreenShadeTransitionController mLockscreenShadeTransitionController;
    private final LockscreenShadeTransitionController mLockscreenShadeTransitionController;
    private final TapAgainViewController mTapAgainViewController;
    private final TapAgainViewController mTapAgainViewController;
    private final ShadeHeaderController mShadeHeaderController;
    private final boolean mVibrateOnOpening;
    private final boolean mVibrateOnOpening;
    private final VelocityTracker mVelocityTracker = VelocityTracker.obtain();
    private final VelocityTracker mVelocityTracker = VelocityTracker.obtain();
    private final FlingAnimationUtils mFlingAnimationUtilsClosing;
    private final FlingAnimationUtils mFlingAnimationUtilsClosing;
@@ -734,7 +733,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            FragmentService fragmentService,
            FragmentService fragmentService,
            IStatusBarService statusBarService,
            IStatusBarService statusBarService,
            ContentResolver contentResolver,
            ContentResolver contentResolver,
            ShadeHeaderController shadeHeaderController,
            ScreenOffAnimationController screenOffAnimationController,
            ScreenOffAnimationController screenOffAnimationController,
            LockscreenGestureLogger lockscreenGestureLogger,
            LockscreenGestureLogger lockscreenGestureLogger,
            ShadeExpansionStateManager shadeExpansionStateManager,
            ShadeExpansionStateManager shadeExpansionStateManager,
@@ -881,7 +879,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mSplitShadeEnabled =
        mSplitShadeEnabled =
                mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
                mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
        mView.setWillNotDraw(!DEBUG_DRAWABLE);
        mView.setWillNotDraw(!DEBUG_DRAWABLE);
        mShadeHeaderController = shadeHeaderController;
        mLayoutInflater = layoutInflater;
        mLayoutInflater = layoutInflater;
        mFeatureFlags = featureFlags;
        mFeatureFlags = featureFlags;
        mAnimateBack = predictiveBackAnimateShade();
        mAnimateBack = predictiveBackAnimateShade();
@@ -1116,9 +1113,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        }
        }


        mTapAgainViewController.init();
        mTapAgainViewController.init();
        mShadeHeaderController.init();
        mShadeHeaderController.setShadeCollapseAction(
                () -> collapse(/* delayed= */ false , /* speedUpFactor= */ 1.0f));
        mKeyguardUnfoldTransition.ifPresent(u -> u.setup(mView));
        mKeyguardUnfoldTransition.ifPresent(u -> u.setup(mView));
        mNotificationPanelUnfoldAnimationController.ifPresent(controller ->
        mNotificationPanelUnfoldAnimationController.ifPresent(controller ->
                controller.setup(mNotificationContainerParent));
                controller.setup(mNotificationContainerParent));
@@ -3596,11 +3590,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        return mKeyHandler;
        return mKeyHandler;
    }
    }


    @Override
    public void disableHeader(int state1, int state2, boolean animated) {
        mShadeHeaderController.disable(state1, state2, animated);
    }

    @Override
    @Override
    public boolean closeUserSwitcherIfOpen() {
    public boolean closeUserSwitcherIfOpen() {
        if (mKeyguardUserSwitcherController != null) {
        if (mKeyguardUserSwitcherController != null) {
+4 −9
Original line number Original line Diff line number Diff line
@@ -21,15 +21,13 @@ import android.os.Looper;
import android.util.Log;
import android.util.Log;
import android.view.MotionEvent;
import android.view.MotionEvent;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.view.WindowManagerGlobal;


import com.android.systemui.DejankUtils;
import com.android.systemui.DejankUtils;
import com.android.systemui.assist.AssistManager;
import com.android.systemui.assist.AssistManager;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.log.LogBuffer;
import com.android.systemui.log.dagger.ShadeTouchLog;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.scene.domain.interactor.WindowRootViewVisibilityInteractor;
import com.android.systemui.scene.domain.interactor.WindowRootViewVisibilityInteractor;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;
@@ -81,7 +79,6 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {
    public ShadeControllerImpl(
    public ShadeControllerImpl(
            CommandQueue commandQueue,
            CommandQueue commandQueue,
            @Main Executor mainExecutor,
            @Main Executor mainExecutor,
            @ShadeTouchLog LogBuffer touchLog,
            WindowRootViewVisibilityInteractor windowRootViewVisibilityInteractor,
            WindowRootViewVisibilityInteractor windowRootViewVisibilityInteractor,
            KeyguardStateController keyguardStateController,
            KeyguardStateController keyguardStateController,
            StatusBarStateController statusBarStateController,
            StatusBarStateController statusBarStateController,
@@ -89,13 +86,12 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {
            StatusBarWindowController statusBarWindowController,
            StatusBarWindowController statusBarWindowController,
            DeviceProvisionedController deviceProvisionedController,
            DeviceProvisionedController deviceProvisionedController,
            NotificationShadeWindowController notificationShadeWindowController,
            NotificationShadeWindowController notificationShadeWindowController,
            WindowManager windowManager,
            @DisplayId int displayId,
            Lazy<NotificationPanelViewController> shadeViewControllerLazy,
            Lazy<NotificationPanelViewController> shadeViewControllerLazy,
            Lazy<AssistManager> assistManagerLazy,
            Lazy<AssistManager> assistManagerLazy,
            Lazy<NotificationGutsManager> gutsManager
            Lazy<NotificationGutsManager> gutsManager
    ) {
    ) {
        super(touchLog,
        super(commandQueue,
                commandQueue,
                statusBarKeyguardViewManager,
                statusBarKeyguardViewManager,
                notificationShadeWindowController,
                notificationShadeWindowController,
                assistManagerLazy);
                assistManagerLazy);
@@ -110,7 +106,7 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {
        mGutsManager = gutsManager;
        mGutsManager = gutsManager;
        mNotificationShadeWindowController = notificationShadeWindowController;
        mNotificationShadeWindowController = notificationShadeWindowController;
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mDisplayId = windowManager.getDefaultDisplay().getDisplayId();
        mDisplayId = displayId;
        mKeyguardStateController = keyguardStateController;
        mKeyguardStateController = keyguardStateController;
        mAssistManagerLazy = assistManagerLazy;
        mAssistManagerLazy = assistManagerLazy;
    }
    }
@@ -385,7 +381,6 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {


    @Override
    @Override
    public void start() {
    public void start() {
        super.start();
        getNpvc().setTrackingStartedListener(this::runPostCollapseActions);
        getNpvc().setTrackingStartedListener(this::runPostCollapseActions);
        getNpvc().setOpenCloseListener(
        getNpvc().setOpenCloseListener(
                new OpenCloseListener() {
                new OpenCloseListener() {
+0 −1
Original line number Original line Diff line number Diff line
@@ -70,7 +70,6 @@ constructor(
    assistManagerLazy: Lazy<AssistManager>,
    assistManagerLazy: Lazy<AssistManager>,
) :
) :
    BaseShadeControllerImpl(
    BaseShadeControllerImpl(
        touchLog,
        commandQueue,
        commandQueue,
        statusBarKeyguardViewManager,
        statusBarKeyguardViewManager,
        notificationShadeWindowController,
        notificationShadeWindowController,
+0 −7
Original line number Original line Diff line number Diff line
@@ -36,13 +36,6 @@ interface ShadeViewController {
    /** Returns whether status bar icons should be hidden when the shade is expanded. */
    /** Returns whether status bar icons should be hidden when the shade is expanded. */
    fun shouldHideStatusBarIconsWhenExpanded(): Boolean
    fun shouldHideStatusBarIconsWhenExpanded(): Boolean


    /**
     * Disables the shade header.
     *
     * @see ShadeHeaderController.disable
     */
    fun disableHeader(state1: Int, state2: Int, animated: Boolean)

    /** If the latency tracker is enabled, begins tracking expand latency. */
    /** If the latency tracker is enabled, begins tracking expand latency. */
    @Deprecated("No longer supported. Do not add new calls to this.")
    @Deprecated("No longer supported. Do not add new calls to this.")
    fun startExpandLatencyTracking()
    fun startExpandLatencyTracking()
Loading