Merge "Adding QS animation when going from pulsing to shade in split shade" into tm-qpr-dev am: f5bf900a96 am: 508184d11a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20551629
Change-Id: I56f51ac441aad6ad664455aea25a9adeec8c2bc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
index 905cc3f..f565f3d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
@@ -509,9 +509,14 @@
* If secure with redaction: Show bouncer, go to unlocked shade.
* If secure without redaction or no security: Go to [StatusBarState.SHADE_LOCKED].
*
+ * Split shade is special case and [needsQSAnimation] will be always overridden to true.
+ * That's because handheld shade will automatically follow notifications animation, but that's
+ * not the case for split shade.
+ *
* @param expandView The view to expand after going to the shade
* @param needsQSAnimation if this needs the quick settings to slide in from the top or if
- * that's already handled separately
+ * that's already handled separately. This argument will be ignored on
+ * split shade as there QS animation can't be handled separately.
*/
@JvmOverloads
fun goToLockedShade(expandedView: View?, needsQSAnimation: Boolean = true) {
@@ -519,7 +524,7 @@
logger.logTryGoToLockedShade(isKeyguard)
if (isKeyguard) {
val animationHandler: ((Long) -> Unit)?
- if (needsQSAnimation) {
+ if (needsQSAnimation || useSplitShade) {
// Let's use the default animation
animationHandler = null
} else {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
index 3d11ced..702f278 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
@@ -244,6 +244,14 @@
}
@Test
+ fun testGoToLockedShadeAlwaysCreatesQSAnimationInSplitShade() {
+ enableSplitShade()
+ transitionController.goToLockedShade(null, needsQSAnimation = true)
+ verify(notificationPanelController).animateToFullShade(anyLong())
+ assertNotNull(transitionController.dragDownAnimator)
+ }
+
+ @Test
fun testDragDownAmountDoesntCallOutInLockedDownShade() {
whenever(nsslController.isInLockedDownShade).thenReturn(true)
transitionController.dragDownAmount = 10f