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

Commit c2d6b9d6 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[CS] Remove CentralSurfaces#isPulsing.

Have NotificationShadeWindowViewController ask DozeServiceHost directly
for the pulsing status.

Bug: 277764509
Test: verified via logging that the shade gets pulsing=true when
receiving notif on AOD, false otherwise
Test: verified you can open the shade while pulsing
Test: atest NotificationShadeWindowViewControllerTest

Change-Id: I41f6d0abfbcb5d817e52920565493a727d4c2627
parent c4702116
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.DozeServiceHost;
import com.android.systemui.statusbar.phone.PhoneStatusBarViewController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
@@ -118,6 +119,7 @@ public class NotificationShadeWindowViewController {
    private NotificationStackScrollLayout mStackScrollLayout;
    private PhoneStatusBarViewController mStatusBarViewController;
    private final CentralSurfaces mService;
    private final DozeServiceHost mDozeServiceHost;
    private final BackActionInteractor mBackActionInteractor;
    private final PowerInteractor mPowerInteractor;
    private final NotificationShadeWindowController mNotificationShadeWindowController;
@@ -152,6 +154,7 @@ public class NotificationShadeWindowViewController {
            StatusBarWindowStateController statusBarWindowStateController,
            LockIconViewController lockIconViewController,
            CentralSurfaces centralSurfaces,
            DozeServiceHost dozeServiceHost,
            BackActionInteractor backActionInteractor,
            PowerInteractor powerInteractor,
            NotificationShadeWindowController controller,
@@ -189,6 +192,7 @@ public class NotificationShadeWindowViewController {
        mShadeLogger = shadeLogger;
        mLockIconViewController.init();
        mService = centralSurfaces;
        mDozeServiceHost = dozeServiceHost;
        mPowerInteractor = powerInteractor;
        mNotificationShadeWindowController = controller;
        mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
@@ -391,7 +395,7 @@ public class NotificationShadeWindowViewController {

            @Override
            public boolean shouldInterceptTouchEvent(MotionEvent ev) {
                if (mStatusBarStateController.isDozing() && !mService.isPulsing()
                if (mStatusBarStateController.isDozing() && !mDozeServiceHost.isPulsing()
                        && !mDockManager.isDocked()) {
                    if (ev.getAction() == MotionEvent.ACTION_DOWN) {
                        mShadeLogger.d("NSWVC: capture all touch events in always-on");
@@ -445,7 +449,7 @@ public class NotificationShadeWindowViewController {
            public boolean handleTouchEvent(MotionEvent ev) {
                boolean handled = false;
                if (mStatusBarStateController.isDozing()) {
                    handled = !mService.isPulsing();
                    handled = !mDozeServiceHost.isPulsing();
                }

                if (mStatusBarKeyguardViewManager.onTouch(ev)) {
+0 −2
Original line number Diff line number Diff line
@@ -200,8 +200,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {

    void onKeyguardViewManagerStatesUpdated();

    boolean isPulsing();

    boolean isOccluded();

    boolean isDeviceInVrMode();
+0 −1
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ abstract class CentralSurfacesEmptyImpl : CentralSurfaces {
    override fun getKeyguardMessageArea(): AuthKeyguardMessageArea? = null
    override fun isLaunchingActivityOverLockscreen() = false
    override fun onKeyguardViewManagerStatesUpdated() {}
    override fun isPulsing() = false
    override fun isOccluded() = false
    override fun isDeviceInVrMode() = false
    override fun getPresenter(): NotificationPresenter? = null
+1 −6
Original line number Diff line number Diff line
@@ -1708,11 +1708,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        logStateToEventlog();
    }

    @Override
    public boolean isPulsing() {
        return mDozeServiceHost.isPulsing();
    }

    /**
     * When the keyguard is showing and covered by a "showWhenLocked" activity it
     * is occluded. This is controlled by {@link com.android.server.policy.PhoneWindowManager}
@@ -2852,7 +2847,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                    // cancelling a sleep), from the power button, on a device with a power button
                    // FPS, and 'press to unlock' is required.
                    mShouldDelayWakeUpAnimation =
                            !isPulsing()
                            !mDozeServiceHost.isPulsing()
                                    && mStatusBarStateController.getDozeAmount() == 1f
                                    && mWakefulnessLifecycle.getLastWakeReason()
                                    == PowerManager.WAKE_REASON_POWER_BUTTON
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ public final class DozeServiceHost implements DozeHost {
        return mDozingRequested;
    }

    boolean isPulsing() {
    public boolean isPulsing() {
        return mPulsing;
    }

Loading