Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +11 −8 Original line number Diff line number Diff line Loading @@ -2053,6 +2053,9 @@ 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 */); } Loading Loading @@ -3109,7 +3112,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (isTracking()) { onTrackingStopped(true); } if (isExpanded() && !mQsController.getExpanded()) { if (isExpanded() && mBarState != KEYGUARD && !mQsController.getExpanded()) { mShadeLog.d("Status Bar was long pressed. Expanding to QS."); expandToQs(); } else { Loading Loading @@ -5091,13 +5094,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } boolean handled = mHeadsUpTouchHelper.onTouchEvent(event); if (!mHeadsUpTouchHelper.isTrackingHeadsUp() && mQsController.handleTouch( event, isFullyCollapsed(), isShadeOrQsHeightAnimationRunning())) { if (event.getActionMasked() != MotionEvent.ACTION_MOVE) { mShadeLog.logMotionEvent(event, "onTouch: handleQsTouch handled event"); } return true; } // This touch session has already resulted in shade expansion. Ignore everything else. if (ShadeExpandsOnStatusBarLongPress.isEnabled() && event.getActionMasked() != MotionEvent.ACTION_DOWN Loading @@ -5105,6 +5101,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump 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) { mShadeLog.logMotionEvent(event, "onTouch: handleQsTouch handled event"); } return true; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) { mMetricsLogger.count(COUNTER_PANEL_OPEN, 1); handled = true; Loading packages/SystemUI/src/com/android/systemui/shade/LongPressGestureDetector.kt→packages/SystemUI/src/com/android/systemui/shade/StatusBarLongPressGestureDetector.kt +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import javax.inject.Inject /** Accepts touch events, detects long press, and calls ShadeViewController#onStatusBarLongPress. */ @SysUISingleton class LongPressGestureDetector class StatusBarLongPressGestureDetector @Inject constructor(context: Context, val shadeViewController: ShadeViewController) { val gestureDetector = Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -171,12 +171,14 @@ 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; Loading Loading @@ -366,6 +368,7 @@ 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; Loading Loading @@ -671,6 +674,7 @@ 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, Loading Loading @@ -778,6 +782,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mShadeController = shadeController; mWindowRootViewVisibilityInteractor = windowRootViewVisibilityInteractor; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector; mKeyguardViewMediatorCallback = viewMediatorCallback; mInitController = initController; mPluginDependencyProvider = pluginDependencyProvider; Loading Loading @@ -1527,6 +1532,11 @@ 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 packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +8 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -69,7 +69,7 @@ public class PhoneStatusBarView extends FrameLayout { private InsetsFetcher mInsetsFetcher; private int mDensity; private float mFontScale; private LongPressGestureDetector mLongPressGestureDetector; private StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector; /** * Draw this many pixels into the left/right side of the cutout to optimally use the space Loading @@ -81,9 +81,10 @@ public class PhoneStatusBarView extends FrameLayout { mStatusBarWindowControllerStore = Dependency.get(StatusBarWindowControllerStore.class); } void setLongPressGestureDetector(LongPressGestureDetector longPressGestureDetector) { void setLongPressGestureDetector( StatusBarLongPressGestureDetector statusBarLongPressGestureDetector) { if (ShadeExpandsOnStatusBarLongPress.isEnabled()) { mLongPressGestureDetector = longPressGestureDetector; mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector; } } Loading Loading @@ -207,8 +208,9 @@ public class PhoneStatusBarView extends FrameLayout { @Override public boolean onTouchEvent(MotionEvent event) { if (ShadeExpandsOnStatusBarLongPress.isEnabled() && mLongPressGestureDetector != null) { mLongPressGestureDetector.handleTouch(event); if (ShadeExpandsOnStatusBarLongPress.isEnabled() && mStatusBarLongPressGestureDetector != null) { mStatusBarLongPressGestureDetector.handleTouch(event); } if (mTouchEventHandler == null) { Log.w( Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +5 −5 Original line number Diff line number Diff line Loading @@ -33,11 +33,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 Loading Loading @@ -68,7 +68,7 @@ private constructor( private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val panelExpansionInteractor: PanelExpansionInteractor, private val longPressGestureDetector: Provider<LongPressGestureDetector>, private val statusBarLongPressGestureDetector: Provider<StatusBarLongPressGestureDetector>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val moveFromCenterAnimationController: StatusBarMoveFromCenterAnimationController?, Loading Loading @@ -118,7 +118,7 @@ private constructor( addCursorSupportToIconContainers() if (ShadeExpandsOnStatusBarLongPress.isEnabled) { mView.setLongPressGestureDetector(longPressGestureDetector.get()) mView.setLongPressGestureDetector(statusBarLongPressGestureDetector.get()) } progressProvider?.setReadyToHandleTransition(true) Loading Loading @@ -335,7 +335,7 @@ private constructor( private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val panelExpansionInteractor: PanelExpansionInteractor, private val longPressGestureDetector: Provider<LongPressGestureDetector>, private val statusBarLongPressGestureDetector: Provider<StatusBarLongPressGestureDetector>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val viewUtil: ViewUtil, Loading @@ -360,7 +360,7 @@ private constructor( shadeController, shadeViewController, panelExpansionInteractor, longPressGestureDetector, statusBarLongPressGestureDetector, windowRootView, shadeLogger, statusBarMoveFromCenterAnimationController, Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +11 −8 Original line number Diff line number Diff line Loading @@ -2053,6 +2053,9 @@ 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 */); } Loading Loading @@ -3109,7 +3112,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump if (isTracking()) { onTrackingStopped(true); } if (isExpanded() && !mQsController.getExpanded()) { if (isExpanded() && mBarState != KEYGUARD && !mQsController.getExpanded()) { mShadeLog.d("Status Bar was long pressed. Expanding to QS."); expandToQs(); } else { Loading Loading @@ -5091,13 +5094,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } boolean handled = mHeadsUpTouchHelper.onTouchEvent(event); if (!mHeadsUpTouchHelper.isTrackingHeadsUp() && mQsController.handleTouch( event, isFullyCollapsed(), isShadeOrQsHeightAnimationRunning())) { if (event.getActionMasked() != MotionEvent.ACTION_MOVE) { mShadeLog.logMotionEvent(event, "onTouch: handleQsTouch handled event"); } return true; } // This touch session has already resulted in shade expansion. Ignore everything else. if (ShadeExpandsOnStatusBarLongPress.isEnabled() && event.getActionMasked() != MotionEvent.ACTION_DOWN Loading @@ -5105,6 +5101,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump 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) { mShadeLog.logMotionEvent(event, "onTouch: handleQsTouch handled event"); } return true; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) { mMetricsLogger.count(COUNTER_PANEL_OPEN, 1); handled = true; Loading
packages/SystemUI/src/com/android/systemui/shade/LongPressGestureDetector.kt→packages/SystemUI/src/com/android/systemui/shade/StatusBarLongPressGestureDetector.kt +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import javax.inject.Inject /** Accepts touch events, detects long press, and calls ShadeViewController#onStatusBarLongPress. */ @SysUISingleton class LongPressGestureDetector class StatusBarLongPressGestureDetector @Inject constructor(context: Context, val shadeViewController: ShadeViewController) { val gestureDetector = Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -171,12 +171,14 @@ 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; Loading Loading @@ -366,6 +368,7 @@ 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; Loading Loading @@ -671,6 +674,7 @@ 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, Loading Loading @@ -778,6 +782,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mShadeController = shadeController; mWindowRootViewVisibilityInteractor = windowRootViewVisibilityInteractor; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector; mKeyguardViewMediatorCallback = viewMediatorCallback; mInitController = initController; mPluginDependencyProvider = pluginDependencyProvider; Loading Loading @@ -1527,6 +1532,11 @@ 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
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +8 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -69,7 +69,7 @@ public class PhoneStatusBarView extends FrameLayout { private InsetsFetcher mInsetsFetcher; private int mDensity; private float mFontScale; private LongPressGestureDetector mLongPressGestureDetector; private StatusBarLongPressGestureDetector mStatusBarLongPressGestureDetector; /** * Draw this many pixels into the left/right side of the cutout to optimally use the space Loading @@ -81,9 +81,10 @@ public class PhoneStatusBarView extends FrameLayout { mStatusBarWindowControllerStore = Dependency.get(StatusBarWindowControllerStore.class); } void setLongPressGestureDetector(LongPressGestureDetector longPressGestureDetector) { void setLongPressGestureDetector( StatusBarLongPressGestureDetector statusBarLongPressGestureDetector) { if (ShadeExpandsOnStatusBarLongPress.isEnabled()) { mLongPressGestureDetector = longPressGestureDetector; mStatusBarLongPressGestureDetector = statusBarLongPressGestureDetector; } } Loading Loading @@ -207,8 +208,9 @@ public class PhoneStatusBarView extends FrameLayout { @Override public boolean onTouchEvent(MotionEvent event) { if (ShadeExpandsOnStatusBarLongPress.isEnabled() && mLongPressGestureDetector != null) { mLongPressGestureDetector.handleTouch(event); if (ShadeExpandsOnStatusBarLongPress.isEnabled() && mStatusBarLongPressGestureDetector != null) { mStatusBarLongPressGestureDetector.handleTouch(event); } if (mTouchEventHandler == null) { Log.w( Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +5 −5 Original line number Diff line number Diff line Loading @@ -33,11 +33,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 Loading Loading @@ -68,7 +68,7 @@ private constructor( private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val panelExpansionInteractor: PanelExpansionInteractor, private val longPressGestureDetector: Provider<LongPressGestureDetector>, private val statusBarLongPressGestureDetector: Provider<StatusBarLongPressGestureDetector>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val moveFromCenterAnimationController: StatusBarMoveFromCenterAnimationController?, Loading Loading @@ -118,7 +118,7 @@ private constructor( addCursorSupportToIconContainers() if (ShadeExpandsOnStatusBarLongPress.isEnabled) { mView.setLongPressGestureDetector(longPressGestureDetector.get()) mView.setLongPressGestureDetector(statusBarLongPressGestureDetector.get()) } progressProvider?.setReadyToHandleTransition(true) Loading Loading @@ -335,7 +335,7 @@ private constructor( private val shadeController: ShadeController, private val shadeViewController: ShadeViewController, private val panelExpansionInteractor: PanelExpansionInteractor, private val longPressGestureDetector: Provider<LongPressGestureDetector>, private val statusBarLongPressGestureDetector: Provider<StatusBarLongPressGestureDetector>, private val windowRootView: Provider<WindowRootView>, private val shadeLogger: ShadeLogger, private val viewUtil: ViewUtil, Loading @@ -360,7 +360,7 @@ private constructor( shadeController, shadeViewController, panelExpansionInteractor, longPressGestureDetector, statusBarLongPressGestureDetector, windowRootView, shadeLogger, statusBarMoveFromCenterAnimationController, Loading