Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +13 −13 Original line number Diff line number Diff line Loading @@ -4618,20 +4618,20 @@ public final class NotificationPanelViewController implements Dumpable { return false; } // If the view that would receive the touch is disabled, just have status bar // eat the gesture. if (event.getAction() == MotionEvent.ACTION_DOWN && !mView.isEnabled()) { Log.v(TAG, String.format( "onTouchForwardedFromStatusBar: " + "panel view disabled, eating touch at (%d,%d)", (int) event.getX(), (int) event.getY() ) ); if (event.getAction() == MotionEvent.ACTION_DOWN) { // If the view that would receive the touch is disabled, just have status // bar eat the gesture. if (!mView.isEnabled()) { mShadeLog.logMotionEvent(event, "onTouchForwardedFromStatusBar: panel view disabled"); return true; } if (isFullyCollapsed() && event.getY() < 1f) { // b/235889526 Eat events on the top edge of the phone when collapsed mShadeLog.logMotionEvent(event, "top edge touch ignored"); return true; } } return mView.dispatchTouchEvent(event); } }; Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -843,13 +843,24 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { public void handleTouchEventFromStatusBar_panelAndViewEnabled_viewReceivesEvent() { when(mCommandQueue.panelsEnabled()).thenReturn(true); when(mView.isEnabled()).thenReturn(true); MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0); MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0); mNotificationPanelViewController.getStatusBarTouchEventHandler().handleTouchEvent(event); verify(mView).dispatchTouchEvent(event); } @Test public void handleTouchEventFromStatusBar_topEdgeTouch_viewNeverReceivesEvent() { when(mCommandQueue.panelsEnabled()).thenReturn(true); when(mView.isEnabled()).thenReturn(true); MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0); mNotificationPanelViewController.getStatusBarTouchEventHandler().handleTouchEvent(event); verify(mView, never()).dispatchTouchEvent(event); } @Test public void testA11y_initializeNode() { AccessibilityNodeInfo nodeInfo = new AccessibilityNodeInfo(); Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +13 −13 Original line number Diff line number Diff line Loading @@ -4618,20 +4618,20 @@ public final class NotificationPanelViewController implements Dumpable { return false; } // If the view that would receive the touch is disabled, just have status bar // eat the gesture. if (event.getAction() == MotionEvent.ACTION_DOWN && !mView.isEnabled()) { Log.v(TAG, String.format( "onTouchForwardedFromStatusBar: " + "panel view disabled, eating touch at (%d,%d)", (int) event.getX(), (int) event.getY() ) ); if (event.getAction() == MotionEvent.ACTION_DOWN) { // If the view that would receive the touch is disabled, just have status // bar eat the gesture. if (!mView.isEnabled()) { mShadeLog.logMotionEvent(event, "onTouchForwardedFromStatusBar: panel view disabled"); return true; } if (isFullyCollapsed() && event.getY() < 1f) { // b/235889526 Eat events on the top edge of the phone when collapsed mShadeLog.logMotionEvent(event, "top edge touch ignored"); return true; } } return mView.dispatchTouchEvent(event); } }; Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -843,13 +843,24 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { public void handleTouchEventFromStatusBar_panelAndViewEnabled_viewReceivesEvent() { when(mCommandQueue.panelsEnabled()).thenReturn(true); when(mView.isEnabled()).thenReturn(true); MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0); MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0); mNotificationPanelViewController.getStatusBarTouchEventHandler().handleTouchEvent(event); verify(mView).dispatchTouchEvent(event); } @Test public void handleTouchEventFromStatusBar_topEdgeTouch_viewNeverReceivesEvent() { when(mCommandQueue.panelsEnabled()).thenReturn(true); when(mView.isEnabled()).thenReturn(true); MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0); mNotificationPanelViewController.getStatusBarTouchEventHandler().handleTouchEvent(event); verify(mView, never()).dispatchTouchEvent(event); } @Test public void testA11y_initializeNode() { AccessibilityNodeInfo nodeInfo = new AccessibilityNodeInfo(); Loading