Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +10 −15 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_N import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.StatusBarState.SHADE_LOCKED; import static com.android.systemui.statusbar.VibratorHelper.TOUCH_VIBRATION_ATTRIBUTES; import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_FOLD_TO_AOD; import static com.android.systemui.util.DumpUtilsKt.asIndenting; Loading Loading @@ -5480,6 +5481,15 @@ public final class NotificationPanelViewController implements Dumpable { mBarState = statusBarState; mKeyguardShowing = keyguardShowing; boolean fromShadeToKeyguard = statusBarState == KEYGUARD && (oldState == SHADE || oldState == SHADE_LOCKED); if (mSplitShadeEnabled && fromShadeToKeyguard) { // user can go to keyguard from different shade states and closing animation // may not fully run - we always want to make sure we close QS when that happens // as we never need QS open in fresh keyguard state closeQs(); } if (oldState == KEYGUARD && (goingToFullShade || statusBarState == StatusBarState.SHADE_LOCKED)) { Loading @@ -5499,27 +5509,12 @@ public final class NotificationPanelViewController implements Dumpable { mKeyguardStatusBarViewController.animateKeyguardStatusBarIn(); mNotificationStackScrollLayoutController.resetScrollPosition(); // Only animate header if the header is visible. If not, it will partially // animate out // the top of QS if (!mQsExpanded) { // TODO(b/185683835) Nicer clipping when using new spacial model if (mSplitShadeEnabled) { mQs.animateHeaderSlidingOut(); } } } else { // this else branch means we are doing one of: // - from KEYGUARD to SHADE (but not fully expanded as when swiping from the top) // - from SHADE to KEYGUARD // - from SHADE_LOCKED to SHADE // - getting notified again about the current SHADE or KEYGUARD state if (mSplitShadeEnabled && oldState == SHADE && statusBarState == KEYGUARD) { // user can go to keyguard from different shade states and closing animation // may not fully run - we always want to make sure we close QS when that happens // as we never need QS open in fresh keyguard state closeQs(); } final boolean animatingUnlockedShadeToKeyguard = oldState == SHADE && statusBarState == KEYGUARD && mScreenOffAnimationController.isKeyguardShowDelayed(); Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -1102,6 +1102,17 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { mStatusBarStateController.setState(KEYGUARD); assertThat(mNotificationPanelViewController.isQsExpanded()).isEqualTo(false); assertThat(mNotificationPanelViewController.isQsExpandImmediate()).isEqualTo(false); } @Test public void testLockedSplitShadeTransitioningToKeyguard_closesQS() { enableSplitShade(true); mStatusBarStateController.setState(SHADE_LOCKED); mNotificationPanelViewController.setQsExpanded(true); mStatusBarStateController.setState(KEYGUARD); assertThat(mNotificationPanelViewController.isQsExpanded()).isEqualTo(false); assertThat(mNotificationPanelViewController.isQsExpandImmediate()).isEqualTo(false); Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +10 −15 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_N import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.StatusBarState.SHADE_LOCKED; import static com.android.systemui.statusbar.VibratorHelper.TOUCH_VIBRATION_ATTRIBUTES; import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_FOLD_TO_AOD; import static com.android.systemui.util.DumpUtilsKt.asIndenting; Loading Loading @@ -5480,6 +5481,15 @@ public final class NotificationPanelViewController implements Dumpable { mBarState = statusBarState; mKeyguardShowing = keyguardShowing; boolean fromShadeToKeyguard = statusBarState == KEYGUARD && (oldState == SHADE || oldState == SHADE_LOCKED); if (mSplitShadeEnabled && fromShadeToKeyguard) { // user can go to keyguard from different shade states and closing animation // may not fully run - we always want to make sure we close QS when that happens // as we never need QS open in fresh keyguard state closeQs(); } if (oldState == KEYGUARD && (goingToFullShade || statusBarState == StatusBarState.SHADE_LOCKED)) { Loading @@ -5499,27 +5509,12 @@ public final class NotificationPanelViewController implements Dumpable { mKeyguardStatusBarViewController.animateKeyguardStatusBarIn(); mNotificationStackScrollLayoutController.resetScrollPosition(); // Only animate header if the header is visible. If not, it will partially // animate out // the top of QS if (!mQsExpanded) { // TODO(b/185683835) Nicer clipping when using new spacial model if (mSplitShadeEnabled) { mQs.animateHeaderSlidingOut(); } } } else { // this else branch means we are doing one of: // - from KEYGUARD to SHADE (but not fully expanded as when swiping from the top) // - from SHADE to KEYGUARD // - from SHADE_LOCKED to SHADE // - getting notified again about the current SHADE or KEYGUARD state if (mSplitShadeEnabled && oldState == SHADE && statusBarState == KEYGUARD) { // user can go to keyguard from different shade states and closing animation // may not fully run - we always want to make sure we close QS when that happens // as we never need QS open in fresh keyguard state closeQs(); } final boolean animatingUnlockedShadeToKeyguard = oldState == SHADE && statusBarState == KEYGUARD && mScreenOffAnimationController.isKeyguardShowDelayed(); Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -1102,6 +1102,17 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { mStatusBarStateController.setState(KEYGUARD); assertThat(mNotificationPanelViewController.isQsExpanded()).isEqualTo(false); assertThat(mNotificationPanelViewController.isQsExpandImmediate()).isEqualTo(false); } @Test public void testLockedSplitShadeTransitioningToKeyguard_closesQS() { enableSplitShade(true); mStatusBarStateController.setState(SHADE_LOCKED); mNotificationPanelViewController.setQsExpanded(true); mStatusBarStateController.setState(KEYGUARD); assertThat(mNotificationPanelViewController.isQsExpanded()).isEqualTo(false); assertThat(mNotificationPanelViewController.isQsExpandImmediate()).isEqualTo(false); Loading