Loading packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +3 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,9 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private void setPanelExpansion(float expansion) { mCurrentExpansion = expansion; mCentralSurfaces.setBouncerShowing(expansion != KeyguardBouncer.EXPANSION_HIDDEN); mStatusBarKeyguardViewManager.onPanelExpansionChanged(mCurrentExpansion, false, true); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +6 −5 Original line number Diff line number Diff line Loading @@ -3467,9 +3467,7 @@ public class CentralSurfaces extends CoreStartable implements mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); updateScrimController(); if (!mBouncerShowing) { updatePanelExpansionForKeyguard(); } updateNotificationPanelTouchState(); } /** Loading Loading @@ -3613,10 +3611,13 @@ public class CentralSurfaces extends CoreStartable implements * collapse the panel after we expanded it, and thus we would end up with a blank * Keyguard. */ void updateNotificationPanelTouchState() { public void updateNotificationPanelTouchState() { boolean goingToSleepWithoutAnimation = isGoingToSleep() && !mDozeParameters.shouldControlScreenOff(); boolean disabled = (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) boolean bouncerShowingOverDream = isBouncerShowing() && mDreamOverlayStateController.isOverlayActive(); boolean disabled = bouncerShowingOverDream || (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) || goingToSleepWithoutAnimation; mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled); mNotificationIconAreaController.setAnimationsEnabled(!disabled); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +2 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,8 @@ public abstract class PanelViewController { expand = false; } else if (onKeyguard) { expand = true; } else if (mCentralSurfaces.isBouncerShowingOverDream()) { expand = false; } else if (mKeyguardStateController.isKeyguardFadingAway()) { // If we're in the middle of dismissing the keyguard, don't expand due to the // cancelled gesture. Gesture cancellation during an unlock is expected in some Loading packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +23 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,28 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { 2)).isTrue(); } /** * Ensures {@link CentralSurfaces} */ @Test public void testInformBouncerShowingOnExpand() { swipeToPosition(1f, Direction.UP, 0); verify(mCentralSurfaces).setBouncerShowing(true); } /** * Ensures {@link CentralSurfaces} */ @Test public void testInformBouncerHidingOnCollapse() { // Must swipe up to set initial state. swipeToPosition(1f, Direction.UP, 0); Mockito.clearInvocations(mCentralSurfaces); swipeToPosition(0f, Direction.DOWN, 0); verify(mCentralSurfaces).setBouncerShowing(false); } private enum Direction { DOWN, UP, Loading Loading @@ -397,6 +419,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { } private void swipeToPosition(float percent, Direction direction, float velocityY) { Mockito.clearInvocations(mTouchSession); mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class); Loading Loading
packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +3 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,9 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private void setPanelExpansion(float expansion) { mCurrentExpansion = expansion; mCentralSurfaces.setBouncerShowing(expansion != KeyguardBouncer.EXPANSION_HIDDEN); mStatusBarKeyguardViewManager.onPanelExpansionChanged(mCurrentExpansion, false, true); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +6 −5 Original line number Diff line number Diff line Loading @@ -3467,9 +3467,7 @@ public class CentralSurfaces extends CoreStartable implements mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); updateScrimController(); if (!mBouncerShowing) { updatePanelExpansionForKeyguard(); } updateNotificationPanelTouchState(); } /** Loading Loading @@ -3613,10 +3611,13 @@ public class CentralSurfaces extends CoreStartable implements * collapse the panel after we expanded it, and thus we would end up with a blank * Keyguard. */ void updateNotificationPanelTouchState() { public void updateNotificationPanelTouchState() { boolean goingToSleepWithoutAnimation = isGoingToSleep() && !mDozeParameters.shouldControlScreenOff(); boolean disabled = (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) boolean bouncerShowingOverDream = isBouncerShowing() && mDreamOverlayStateController.isOverlayActive(); boolean disabled = bouncerShowingOverDream || (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) || goingToSleepWithoutAnimation; mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled); mNotificationIconAreaController.setAnimationsEnabled(!disabled); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +2 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,8 @@ public abstract class PanelViewController { expand = false; } else if (onKeyguard) { expand = true; } else if (mCentralSurfaces.isBouncerShowingOverDream()) { expand = false; } else if (mKeyguardStateController.isKeyguardFadingAway()) { // If we're in the middle of dismissing the keyguard, don't expand due to the // cancelled gesture. Gesture cancellation during an unlock is expected in some Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +23 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,28 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { 2)).isTrue(); } /** * Ensures {@link CentralSurfaces} */ @Test public void testInformBouncerShowingOnExpand() { swipeToPosition(1f, Direction.UP, 0); verify(mCentralSurfaces).setBouncerShowing(true); } /** * Ensures {@link CentralSurfaces} */ @Test public void testInformBouncerHidingOnCollapse() { // Must swipe up to set initial state. swipeToPosition(1f, Direction.UP, 0); Mockito.clearInvocations(mCentralSurfaces); swipeToPosition(0f, Direction.DOWN, 0); verify(mCentralSurfaces).setBouncerShowing(false); } private enum Direction { DOWN, UP, Loading Loading @@ -397,6 +419,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { } private void swipeToPosition(float percent, Direction direction, float velocityY) { Mockito.clearInvocations(mTouchSession); mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerCaptor = ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class); Loading