Loading packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,16 @@ flag { } } flag { name: "communal_shade_touch_handling_fixes" namespace: "systemui" description: "Flags some minor bug fixes for opening the shade on the hub" bug: "409682586" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "dream_overlay_updated_ui" namespace: "systemui" Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +26 −11 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shade; import static com.android.systemui.Flags.shadeLaunchAccessibility; import static com.android.systemui.Flags.communalShadeTouchHandlingFixes; import static com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING; import static com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; Loading Loading @@ -155,6 +156,10 @@ public class NotificationShadeWindowViewController implements Dumpable { * intercepted and all future touch events for the gesture should be processed by this view. */ private boolean mExternalTouchIntercepted = false; /** * True if we are in the process of handling an external touch event. */ private boolean mHandlingExternalTouch = false; private boolean mIsTrackingBarGesture = false; private boolean mIsOcclusionTransitionRunning = false; private DisableSubpixelTextTransitionListener mDisableSubpixelTextTransitionListener; Loading Loading @@ -345,6 +350,10 @@ public class NotificationShadeWindowViewController implements Dumpable { * @param event The event to forward. */ public void handleExternalTouch(MotionEvent event) { try { if (communalShadeTouchHandlingFixes()) { mHandlingExternalTouch = true; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { mExternalTouchIntercepted = false; } Loading @@ -358,6 +367,9 @@ public class NotificationShadeWindowViewController implements Dumpable { if (mExternalTouchIntercepted) { mView.onTouchEvent(event); } } finally { mHandlingExternalTouch = false; } } /** Inflates the {@link R.layout#status_bar_expanded} layout and sets it up. */ Loading Loading @@ -431,6 +443,9 @@ public class NotificationShadeWindowViewController implements Dumpable { } if (!SceneContainerFlag.isEnabled() // External touches are never intended to go the hub, only for opening the // shade. && !mHandlingExternalTouch && mGlanceableHubContainerController.onTouchEvent(ev)) { // GlanceableHubContainerController is only used pre-flexiglass. return logDownDispatch(ev, "dispatched to glanceable hub container", true); Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +18 −0 Original line number Diff line number Diff line Loading @@ -522,6 +522,24 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) : verify(view, never()).onTouchEvent(any()) } @Test @EnableFlags(Flags.FLAG_COMMUNAL_SHADE_TOUCH_HANDLING_FIXES) @DisableSceneContainer fun handleExternalTouch_hubDoesNotSeeTouches() { underTest.setStatusBarViewController(phoneStatusBarViewController) whenever(view.dispatchTouchEvent(any())).thenAnswer { invocation -> interactionEventHandler.handleDispatchTouchEvent( invocation.arguments.first() as MotionEvent? ) true } underTest.handleExternalTouch(DOWN_EVENT) // Glanceable hub never receives any external touches. verify(mGlanceableHubContainerController, never()).onTouchEvent(any()) } @Test fun testGetKeyguardMessageArea() = testScope.runTest { Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,16 @@ flag { } } flag { name: "communal_shade_touch_handling_fixes" namespace: "systemui" description: "Flags some minor bug fixes for opening the shade on the hub" bug: "409682586" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "dream_overlay_updated_ui" namespace: "systemui" Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +26 −11 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shade; import static com.android.systemui.Flags.shadeLaunchAccessibility; import static com.android.systemui.Flags.communalShadeTouchHandlingFixes; import static com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING; import static com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; Loading Loading @@ -155,6 +156,10 @@ public class NotificationShadeWindowViewController implements Dumpable { * intercepted and all future touch events for the gesture should be processed by this view. */ private boolean mExternalTouchIntercepted = false; /** * True if we are in the process of handling an external touch event. */ private boolean mHandlingExternalTouch = false; private boolean mIsTrackingBarGesture = false; private boolean mIsOcclusionTransitionRunning = false; private DisableSubpixelTextTransitionListener mDisableSubpixelTextTransitionListener; Loading Loading @@ -345,6 +350,10 @@ public class NotificationShadeWindowViewController implements Dumpable { * @param event The event to forward. */ public void handleExternalTouch(MotionEvent event) { try { if (communalShadeTouchHandlingFixes()) { mHandlingExternalTouch = true; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { mExternalTouchIntercepted = false; } Loading @@ -358,6 +367,9 @@ public class NotificationShadeWindowViewController implements Dumpable { if (mExternalTouchIntercepted) { mView.onTouchEvent(event); } } finally { mHandlingExternalTouch = false; } } /** Inflates the {@link R.layout#status_bar_expanded} layout and sets it up. */ Loading Loading @@ -431,6 +443,9 @@ public class NotificationShadeWindowViewController implements Dumpable { } if (!SceneContainerFlag.isEnabled() // External touches are never intended to go the hub, only for opening the // shade. && !mHandlingExternalTouch && mGlanceableHubContainerController.onTouchEvent(ev)) { // GlanceableHubContainerController is only used pre-flexiglass. return logDownDispatch(ev, "dispatched to glanceable hub container", true); Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +18 −0 Original line number Diff line number Diff line Loading @@ -522,6 +522,24 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) : verify(view, never()).onTouchEvent(any()) } @Test @EnableFlags(Flags.FLAG_COMMUNAL_SHADE_TOUCH_HANDLING_FIXES) @DisableSceneContainer fun handleExternalTouch_hubDoesNotSeeTouches() { underTest.setStatusBarViewController(phoneStatusBarViewController) whenever(view.dispatchTouchEvent(any())).thenAnswer { invocation -> interactionEventHandler.handleDispatchTouchEvent( invocation.arguments.first() as MotionEvent? ) true } underTest.handleExternalTouch(DOWN_EVENT) // Glanceable hub never receives any external touches. verify(mGlanceableHubContainerController, never()).onTouchEvent(any()) } @Test fun testGetKeyguardMessageArea() = testScope.runTest { Loading