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

Commit 9b4fcde9 authored by Justin Weir's avatar Justin Weir Committed by Android (Google) Code Review
Browse files

Merge "Revert "Long press Lockscreen status bar expands the shade"" into main

parents 4f47c90d dbd1a942
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import javax.inject.Inject

/** Accepts touch events, detects long press, and calls ShadeViewController#onStatusBarLongPress. */
@SysUISingleton
class StatusBarLongPressGestureDetector
class LongPressGestureDetector
@Inject
constructor(context: Context, val shadeViewController: ShadeViewController) {
    val gestureDetector =
+8 −11
Original line number Diff line number Diff line
@@ -2053,9 +2053,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        }
        if (mQsController.getExpanded()) {
            mQsController.flingQs(0, FLING_COLLAPSE);
        } else if (mBarState == KEYGUARD) {
            mLockscreenShadeTransitionController.goToLockedShade(
                    /* expandedView= */null, /* needsQSAnimation= */false);
        } else {
            expand(true /* animate */);
        }
@@ -3112,7 +3109,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        if (isTracking()) {
            onTrackingStopped(true);
        }
        if (isExpanded() && mBarState != KEYGUARD && !mQsController.getExpanded()) {
        if (isExpanded() && !mQsController.getExpanded()) {
            mShadeLog.d("Status Bar was long pressed. Expanding to QS.");
            expandToQs();
        } else {
@@ -5094,13 +5091,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            }
            boolean handled = mHeadsUpTouchHelper.onTouchEvent(event);

            // This touch session has already resulted in shade expansion. Ignore everything else.
            if (ShadeExpandsOnStatusBarLongPress.isEnabled()
                    && event.getActionMasked() != MotionEvent.ACTION_DOWN
                    && event.getDownTime() == mStatusBarLongPressDowntime) {
                mShadeLog.d("Touch has same down time as Status Bar long press. Ignoring.");
                return false;
            }
            if (!mHeadsUpTouchHelper.isTrackingHeadsUp() && mQsController.handleTouch(
                    event, isFullyCollapsed(), isShadeOrQsHeightAnimationRunning())) {
                if (event.getActionMasked() != MotionEvent.ACTION_MOVE) {
@@ -5108,6 +5098,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                }
                return true;
            }
            // This touch session has already resulted in shade expansion. Ignore everything else.
            if (ShadeExpandsOnStatusBarLongPress.isEnabled()
                    && event.getActionMasked() != MotionEvent.ACTION_DOWN
                    && event.getDownTime() == mStatusBarLongPressDowntime) {
                mShadeLog.d("Touch has same down time as Status Bar long press. Ignoring.");
                return false;
            }
            if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) {
                mMetricsLogger.count(COUNTER_PANEL_OPEN, 1);
                handled = true;
+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);
        };
    }
+6 −8
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@ import com.android.systemui.Dependency;
import com.android.systemui.Flags;
import com.android.systemui.Gefingerpoken;
import com.android.systemui.res.R;
import com.android.systemui.shade.LongPressGestureDetector;
import com.android.systemui.shade.ShadeExpandsOnStatusBarLongPress;
import com.android.systemui.shade.StatusBarLongPressGestureDetector;
import com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer;
import com.android.systemui.statusbar.window.StatusBarWindowControllerStore;
import com.android.systemui.user.ui.binder.StatusBarUserChipViewBinder;
@@ -69,7 +69,7 @@ public class PhoneStatusBarView extends FrameLayout {
    private InsetsFetcher mInsetsFetcher;
    private int mDensity;
    private float mFontScale;
    private StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector;
    private LongPressGestureDetector mLongPressGestureDetector;

    /**
     * Draw this many pixels into the left/right side of the cutout to optimally use the space
@@ -81,10 +81,9 @@ public class PhoneStatusBarView extends FrameLayout {
        mStatusBarWindowControllerStore = Dependency.get(StatusBarWindowControllerStore.class);
    }

    void setLongPressGestureDetector(
            StatusBarLongPressGestureDetector statusBarLongPressGestureDetector) {
    void setLongPressGestureDetector(LongPressGestureDetector longPressGestureDetector) {
        if (ShadeExpandsOnStatusBarLongPress.isEnabled()) {
            mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector;
            mLongPressGestureDetector = longPressGestureDetector;
        }
    }

@@ -208,9 +207,8 @@ public class PhoneStatusBarView extends FrameLayout {

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (ShadeExpandsOnStatusBarLongPress.isEnabled()
                && mStatusBarLongPressGestureDetector != null) {
            mStatusBarLongPressGestureDetector.handleTouch(event);
        if (ShadeExpandsOnStatusBarLongPress.isEnabled() && mLongPressGestureDetector != null) {
            mLongPressGestureDetector.handleTouch(event);
        }
        if (mTouchEventHandler == null) {
            Log.w(
+5 −5
Original line number Diff line number Diff line
@@ -34,11 +34,11 @@ import com.android.systemui.plugins.DarkIconDispatcher
import com.android.systemui.res.R
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.ui.view.WindowRootView
import com.android.systemui.shade.LongPressGestureDetector
import com.android.systemui.shade.ShadeController
import com.android.systemui.shade.ShadeExpandsOnStatusBarLongPress
import com.android.systemui.shade.ShadeLogger
import com.android.systemui.shade.ShadeViewController
import com.android.systemui.shade.StatusBarLongPressGestureDetector
import com.android.systemui.shade.domain.interactor.PanelExpansionInteractor
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator
import com.android.systemui.statusbar.data.repository.StatusBarContentInsetsProviderStore
@@ -69,7 +69,7 @@ private constructor(
    private val shadeController: ShadeController,
    private val shadeViewController: ShadeViewController,
    private val panelExpansionInteractor: PanelExpansionInteractor,
    private val statusBarLongPressGestureDetector: Provider<StatusBarLongPressGestureDetector>,
    private val longPressGestureDetector: Provider<LongPressGestureDetector>,
    private val windowRootView: Provider<WindowRootView>,
    private val shadeLogger: ShadeLogger,
    private val moveFromCenterAnimationController: StatusBarMoveFromCenterAnimationController?,
@@ -119,7 +119,7 @@ private constructor(
        addCursorSupportToIconContainers()

        if (ShadeExpandsOnStatusBarLongPress.isEnabled) {
            mView.setLongPressGestureDetector(statusBarLongPressGestureDetector.get())
            mView.setLongPressGestureDetector(longPressGestureDetector.get())
        }

        progressProvider?.setReadyToHandleTransition(true)
@@ -336,7 +336,7 @@ private constructor(
        private val shadeController: ShadeController,
        private val shadeViewController: ShadeViewController,
        private val panelExpansionInteractor: PanelExpansionInteractor,
        private val statusBarLongPressGestureDetector: Provider<StatusBarLongPressGestureDetector>,
        private val longPressGestureDetector: Provider<LongPressGestureDetector>,
        private val windowRootView: Provider<WindowRootView>,
        private val shadeLogger: ShadeLogger,
        private val viewUtil: ViewUtil,
@@ -361,7 +361,7 @@ private constructor(
                shadeController,
                shadeViewController,
                panelExpansionInteractor,
                statusBarLongPressGestureDetector,
                longPressGestureDetector,
                windowRootView,
                shadeLogger,
                statusBarMoveFromCenterAnimationController,
Loading