Loading
Fix lockscreen notification shelf jump animation
Fix an animation issue when the last notification on lockscreen stack is dismissed, and the shelf needs to translate up. The height of NSSL depends on the calculation result of NotificationStackSizeCalculator.computeMaxKeyguardNotifications(), which is triggered by getLockscreenDisplayConfig, combination of several flows, including notificationStackChanged. notificationStackChanged is triggered by the height changes of NSSL, but using debounce to filter out the updates that are triggered by continuous height changes triggered by animations. When the last row is dismissed on lockscreen and we need to show the shelf only. We need to update the notification stack's height, and the according to the latest result of max notifications, calculated by computeMaxKeyguardNotifications. However, the debouncing prevented the re-calculation with the animation going on, thus lead to unpredictable update timing of the height of NotificationStackScrollLayout. This change added a new runnable for the NSSL to trigger when it needs to trigger the max notification re-calculation immediately, instead of eventually, and runs it whenever a top-level notification is removed from NSSL on lockscreen. Test: manual Bug: 330387368 Flag: com.android.server.notification.notification_minimalism Change-Id: I9adecb7a6b10988f80a67b21061e6c4fe8cc5bed