Loading packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +2 −3 Original line number Diff line number Diff line Loading @@ -144,9 +144,8 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private void setPanelExpansion(float expansion) { mCurrentExpansion = expansion; mCentralSurfaces.setBouncerShowing(expansion != KeyguardBouncer.EXPANSION_HIDDEN); mCentralSurfaces.setBouncerShowingOverDream( mCurrentExpansion != KeyguardBouncer.EXPANSION_HIDDEN); mStatusBarKeyguardViewManager.onPanelExpansionChanged(mCurrentExpansion, false, true); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +17 −7 Original line number Diff line number Diff line Loading @@ -468,6 +468,7 @@ public class CentralSurfaces extends CoreStartable implements */ protected int mState; // TODO: remove this. Just use StatusBarStateController protected boolean mBouncerShowing; private boolean mBouncerShowingOverDream; private final PhoneStatusBarPolicy mIconPolicy; Loading Loading @@ -3467,7 +3468,19 @@ public class CentralSurfaces extends CoreStartable implements mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); updateScrimController(); updateNotificationPanelTouchState(); if (!mBouncerShowing) { updatePanelExpansionForKeyguard(); } } /** * Sets whether the bouncer over dream is showing. Note that the bouncer over dream is handled * independently of the rest of the notification panel. As a result, setting this state via * {@link #setBouncerShowing(boolean)} leads to unintended side effects from states modified * behind the dream. */ public void setBouncerShowingOverDream(boolean bouncerShowingOverDream) { mBouncerShowingOverDream = bouncerShowingOverDream; } /** Loading Loading @@ -3612,13 +3625,10 @@ public class CentralSurfaces extends CoreStartable implements * collapse the panel after we expanded it, and thus we would end up with a blank * Keyguard. */ public void updateNotificationPanelTouchState() { void updateNotificationPanelTouchState() { boolean goingToSleepWithoutAnimation = isGoingToSleep() && !mDozeParameters.shouldControlScreenOff(); boolean bouncerShowingOverDream = isBouncerShowing() && mDreamOverlayStateController.isOverlayActive(); boolean disabled = bouncerShowingOverDream || (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) boolean disabled = (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) || goingToSleepWithoutAnimation; mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled); mNotificationIconAreaController.setAnimationsEnabled(!disabled); Loading Loading @@ -4146,7 +4156,7 @@ public class CentralSurfaces extends CoreStartable implements } public boolean isBouncerShowingOverDream() { return isBouncerShowing() && mDreamOverlayStateController.isOverlayActive(); return mBouncerShowingOverDream; } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +2 −2 Original line number Diff line number Diff line Loading @@ -418,14 +418,14 @@ 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 // situations, such keeping your finger down while swiping to unlock to an app // that is locked in landscape (the rotation will cancel the touch event). expand = false; } else if (mCentralSurfaces.isBouncerShowingOverDream()) { expand = false; } else { // If we get a cancel, put the shade back to the state it was in when the // gesture started Loading packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +23 −22 Original line number Diff line number Diff line Loading @@ -160,28 +160,6 @@ 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 @@ -442,6 +420,29 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { verify(mUiEventLogger).log(BouncerSwipeTouchHandler.DreamEvent.DREAM_BOUNCER_FULLY_VISIBLE); } /** * Ensures {@link CentralSurfaces} */ @Test public void testInformBouncerShowingOnExpand() { swipeToPosition(1f, Direction.UP, 0); verify(mCentralSurfaces).setBouncerShowingOverDream(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).setBouncerShowingOverDream(false); } private void swipeToPosition(float percent, Direction direction, float velocityY) { Mockito.clearInvocations(mTouchSession); mTouchHandler.onSessionStart(mTouchSession); Loading Loading
packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +2 −3 Original line number Diff line number Diff line Loading @@ -144,9 +144,8 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private void setPanelExpansion(float expansion) { mCurrentExpansion = expansion; mCentralSurfaces.setBouncerShowing(expansion != KeyguardBouncer.EXPANSION_HIDDEN); mCentralSurfaces.setBouncerShowingOverDream( mCurrentExpansion != KeyguardBouncer.EXPANSION_HIDDEN); mStatusBarKeyguardViewManager.onPanelExpansionChanged(mCurrentExpansion, false, true); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +17 −7 Original line number Diff line number Diff line Loading @@ -468,6 +468,7 @@ public class CentralSurfaces extends CoreStartable implements */ protected int mState; // TODO: remove this. Just use StatusBarStateController protected boolean mBouncerShowing; private boolean mBouncerShowingOverDream; private final PhoneStatusBarPolicy mIconPolicy; Loading Loading @@ -3467,7 +3468,19 @@ public class CentralSurfaces extends CoreStartable implements mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); updateScrimController(); updateNotificationPanelTouchState(); if (!mBouncerShowing) { updatePanelExpansionForKeyguard(); } } /** * Sets whether the bouncer over dream is showing. Note that the bouncer over dream is handled * independently of the rest of the notification panel. As a result, setting this state via * {@link #setBouncerShowing(boolean)} leads to unintended side effects from states modified * behind the dream. */ public void setBouncerShowingOverDream(boolean bouncerShowingOverDream) { mBouncerShowingOverDream = bouncerShowingOverDream; } /** Loading Loading @@ -3612,13 +3625,10 @@ public class CentralSurfaces extends CoreStartable implements * collapse the panel after we expanded it, and thus we would end up with a blank * Keyguard. */ public void updateNotificationPanelTouchState() { void updateNotificationPanelTouchState() { boolean goingToSleepWithoutAnimation = isGoingToSleep() && !mDozeParameters.shouldControlScreenOff(); boolean bouncerShowingOverDream = isBouncerShowing() && mDreamOverlayStateController.isOverlayActive(); boolean disabled = bouncerShowingOverDream || (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) boolean disabled = (!mDeviceInteractive && !mDozeServiceHost.isPulsing()) || goingToSleepWithoutAnimation; mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled); mNotificationIconAreaController.setAnimationsEnabled(!disabled); Loading Loading @@ -4146,7 +4156,7 @@ public class CentralSurfaces extends CoreStartable implements } public boolean isBouncerShowingOverDream() { return isBouncerShowing() && mDreamOverlayStateController.isOverlayActive(); return mBouncerShowingOverDream; } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +2 −2 Original line number Diff line number Diff line Loading @@ -418,14 +418,14 @@ 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 // situations, such keeping your finger down while swiping to unlock to an app // that is locked in landscape (the rotation will cancel the touch event). expand = false; } else if (mCentralSurfaces.isBouncerShowingOverDream()) { expand = false; } else { // If we get a cancel, put the shade back to the state it was in when the // gesture started Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +23 −22 Original line number Diff line number Diff line Loading @@ -160,28 +160,6 @@ 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 @@ -442,6 +420,29 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { verify(mUiEventLogger).log(BouncerSwipeTouchHandler.DreamEvent.DREAM_BOUNCER_FULLY_VISIBLE); } /** * Ensures {@link CentralSurfaces} */ @Test public void testInformBouncerShowingOnExpand() { swipeToPosition(1f, Direction.UP, 0); verify(mCentralSurfaces).setBouncerShowingOverDream(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).setBouncerShowingOverDream(false); } private void swipeToPosition(float percent, Direction direction, float velocityY) { Mockito.clearInvocations(mTouchSession); mTouchHandler.onSessionStart(mTouchSession); Loading