Make sure there are bubbles before animating due to IME changes.
Also, don't crash if we try to spring the first bubble when there are no bubbles.
Fixes: 127275756
Test: atest SystemUITests
Change-Id: I6259398d894039d42f93300d0d997d14372f07b6
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 471619e..656d757 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -582,12 +582,9 @@
int displayRotation) throws RemoteException {}
@Override
- public void onImeVisibilityChanged(boolean imeVisible, int imeHeight)
- throws RemoteException {
- if (mStackView != null) {
- mStackView.post(() -> {
- mStackView.onImeVisibilityChanged(imeVisible, imeHeight);
- });
+ public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) {
+ if (mStackView != null && mStackView.getBubbleCount() > 0) {
+ mStackView.post(() -> mStackView.onImeVisibilityChanged(imeVisible, imeHeight));
}
}