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

Commit cfa9ce9e authored by Justin Weir's avatar Justin Weir
Browse files

Long press Shade status bar expands to QS

Bug: 371224114
Test: Ran affected tests
Test: Manually verified with go/shade-cujs
Flag: com.android.systemui.shade_expands_on_status_bar_long_press
Change-Id: I78d86257abbdc8c90f3359b85ee5f476b7fc7b72
parent 1ba241be
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -349,6 +349,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock private KeyguardClockPositionAlgorithm mKeyguardClockPositionAlgorithm;
    @Mock private NaturalScrollingSettingObserver mNaturalScrollingSettingObserver;
    @Mock private LargeScreenHeaderHelper mLargeScreenHeaderHelper;
    @Mock private StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector;
    protected final int mMaxUdfpsBurnInOffsetY = 5;
    protected FakeFeatureFlagsClassic mFeatureFlags = new FakeFeatureFlagsClassic();
    protected KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor;
@@ -819,6 +820,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                mNotificationShadeDepthController,
                mShadeHeaderController,
                mStatusBarTouchableRegionManager,
                () -> mStatusBarLongPressGestureDetector,
                mKeyguardStateController,
                mKeyguardBypassController,
                mScrimController,
+2 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ public class QuickSettingsControllerImplBaseTest extends SysuiTestCase {
    @Mock protected NotificationShadeDepthController mNotificationShadeDepthController;
    @Mock protected ShadeHeaderController mShadeHeaderController;
    @Mock protected StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    @Mock protected StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector;
    @Mock protected DozeParameters mDozeParameters;
    @Mock protected KeyguardStateController mKeyguardStateController;
    @Mock protected KeyguardBypassController mKeyguardBypassController;
@@ -250,6 +251,7 @@ public class QuickSettingsControllerImplBaseTest extends SysuiTestCase {
                mNotificationShadeDepthController,
                mShadeHeaderController,
                mStatusBarTouchableRegionManager,
                () -> mStatusBarLongPressGestureDetector,
                mKeyguardStateController,
                mKeyguardBypassController,
                mScrimController,
+13 −10
Original line number Diff line number Diff line
@@ -3109,20 +3109,23 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        if (isTracking()) {
            onTrackingStopped(true);
        }
        if (isExpanded() && mBarState != KEYGUARD && !mQsController.getExpanded()) {
        if (!mQsController.getExpanded()) {
            performHapticFeedback(HapticFeedbackConstants.GESTURE_START);
            if (isExpanded() && mBarState != KEYGUARD) {
                mShadeLog.d("Status Bar was long pressed. Expanding to QS.");
            expandToQs();
                mQsController.flingQs(0, FLING_EXPAND);
            } else {
                if (mBarState == KEYGUARD) {
                    mShadeLog.d("Lockscreen Status Bar was long pressed. Expanding to Notifications.");
                    mLockscreenShadeTransitionController.goToLockedShade(
                        /* expandedView= */null, /* needsQSAnimation= */false);
                            /* expandedView= */null, /* needsQSAnimation= */true);
                } else {
                    mShadeLog.d("Status Bar was long pressed. Expanding to Notifications.");
                    expandToNotifications();
                }
            }
        }
    }

    @Override
    public int getBarState() {
+9 −3
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ import kotlin.Unit;
import java.io.PrintWriter;

import javax.inject.Inject;
import javax.inject.Provider;

/** Handles QuickSettings touch handling, expansion and animation state
 * TODO (b/264460656) make this dumpable
@@ -141,6 +142,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
    private final NotificationShadeDepthController mDepthController;
    private final ShadeHeaderController mShadeHeaderController;
    private final StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    private final Provider<StatusBarLongPressGestureDetector> mStatusBarLongPressGestureDetector;
    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardBypassController mKeyguardBypassController;
    private final NotificationRemoteInputManager mRemoteInputManager;
@@ -316,6 +318,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
            NotificationShadeDepthController notificationShadeDepthController,
            ShadeHeaderController shadeHeaderController,
            StatusBarTouchableRegionManager statusBarTouchableRegionManager,
            Provider<StatusBarLongPressGestureDetector> statusBarLongPressGestureDetector,
            KeyguardStateController keyguardStateController,
            KeyguardBypassController keyguardBypassController,
            ScrimController scrimController,
@@ -364,6 +367,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
        mDepthController = notificationShadeDepthController;
        mShadeHeaderController = shadeHeaderController;
        mStatusBarTouchableRegionManager = statusBarTouchableRegionManager;
        mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector;
        mKeyguardStateController = keyguardStateController;
        mKeyguardBypassController = keyguardBypassController;
        mScrimController = scrimController;
@@ -1648,6 +1652,10 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
        if (isSplitShadeAndTouchXOutsideQs(event.getX())) {
            return false;
        }
        boolean isInStatusBar = event.getY(event.getActionIndex()) < mStatusBarMinHeight;
        if (ShadeExpandsOnStatusBarLongPress.isEnabled() && isInStatusBar) {
            mStatusBarLongPressGestureDetector.get().handleTouch(event);
        }
        final int action = event.getActionMasked();
        boolean collapsedQs = !getExpanded() && !mSplitShadeEnabled;
        boolean expandedShadeCollapsedQs = mShadeExpandedFraction == 1f
@@ -1684,9 +1692,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
        if (action == MotionEvent.ACTION_DOWN && isFullyCollapsed && isExpansionEnabled()) {
            mTwoFingerExpandPossible = true;
        }
        if (mTwoFingerExpandPossible && isOpenQsEvent(event)
                && event.getY(event.getActionIndex())
                < mStatusBarMinHeight) {
        if (mTwoFingerExpandPossible && isOpenQsEvent(event) && isInStatusBar) {
            mMetricsLogger.count(COUNTER_PANEL_OPEN_QS, 1);
            setExpandImmediate(true);
            mNotificationStackScrollLayoutController.setShouldShowShelfOnly(!mSplitShadeEnabled);
+0 −10
Original line number Diff line number Diff line
@@ -171,14 +171,12 @@ import com.android.systemui.shade.NotificationShadeWindowView;
import com.android.systemui.shade.NotificationShadeWindowViewController;
import com.android.systemui.shade.QuickSettingsController;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeExpandsOnStatusBarLongPress;
import com.android.systemui.shade.ShadeExpansionChangeEvent;
import com.android.systemui.shade.ShadeExpansionListener;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.shade.ShadeLogger;
import com.android.systemui.shade.ShadeSurface;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.shade.StatusBarLongPressGestureDetector;
import com.android.systemui.shared.recents.utilities.Utilities;
import com.android.systemui.shared.statusbar.phone.BarTransitions;
import com.android.systemui.statusbar.AutoHideUiElement;
@@ -368,7 +366,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {

    private PhoneStatusBarViewController mPhoneStatusBarViewController;
    private PhoneStatusBarTransitions mStatusBarTransitions;
    private final Provider<StatusBarLongPressGestureDetector> mStatusBarLongPressGestureDetector;
    private final AuthRippleController mAuthRippleController;
    @WindowVisibleState private int mStatusBarWindowState = WINDOW_STATE_SHOWING;
    private final NotificationShadeWindowController mNotificationShadeWindowController;
@@ -674,7 +671,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
            ShadeController shadeController,
            WindowRootViewVisibilityInteractor windowRootViewVisibilityInteractor,
            StatusBarKeyguardViewManager statusBarKeyguardViewManager,
            Provider<StatusBarLongPressGestureDetector> statusBarLongPressGestureDetector,
            ViewMediatorCallback viewMediatorCallback,
            InitController initController,
            @Named(TIME_TICK_HANDLER_NAME) Handler timeTickHandler,
@@ -782,7 +778,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        mShadeController = shadeController;
        mWindowRootViewVisibilityInteractor = windowRootViewVisibilityInteractor;
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector;
        mKeyguardViewMediatorCallback = viewMediatorCallback;
        mInitController = initController;
        mPluginDependencyProvider = pluginDependencyProvider;
@@ -1532,11 +1527,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                // to touch outside the customizer to close it, such as on the status or nav bar.
                mShadeController.onStatusBarTouch(event);
            }
            if (ShadeExpandsOnStatusBarLongPress.isEnabled()
                    && mStatusBarStateController.getState() == StatusBarState.KEYGUARD) {
                mStatusBarLongPressGestureDetector.get().handleTouch(event);
            }

            return getNotificationShadeWindowView().onTouchEvent(event);
        };
    }
Loading