Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9422831 authored by Joshua Tsuji's avatar Joshua Tsuji Committed by Josh Tsuji
Browse files

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
parent 6583df45
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -582,12 +582,9 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe
                int displayRotation) throws RemoteException {}
                int displayRotation) throws RemoteException {}


        @Override
        @Override
        public void onImeVisibilityChanged(boolean imeVisible, int imeHeight)
        public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) {
                throws RemoteException {
            if (mStackView != null && mStackView.getBubbleCount() > 0) {
            if (mStackView != null) {
                mStackView.post(() -> mStackView.onImeVisibilityChanged(imeVisible, imeHeight));
                mStackView.post(() -> {
                    mStackView.onImeVisibilityChanged(imeVisible, imeHeight);
                });
            }
            }
        }
        }


+5 −1
Original line number Original line Diff line number Diff line
@@ -440,6 +440,10 @@ public class StackAnimationController extends
            DynamicAnimation.ViewProperty property, SpringForce spring,
            DynamicAnimation.ViewProperty property, SpringForce spring,
            float vel, float finalPosition) {
            float vel, float finalPosition) {


        if (mLayout.getChildCount() == 0) {
            return;
        }

        Log.d(TAG, String.format("Springing %s to final position %f.",
        Log.d(TAG, String.format("Springing %s to final position %f.",
                PhysicsAnimationLayout.getReadablePropertyName(property),
                PhysicsAnimationLayout.getReadablePropertyName(property),
                finalPosition));
                finalPosition));
@@ -489,7 +493,7 @@ public class StackAnimationController extends


        @Override
        @Override
        public float getValue(StackAnimationController controller) {
        public float getValue(StackAnimationController controller) {
            return mProperty.getValue(mLayout.getChildAt(0));
            return mLayout.getChildCount() > 0 ? mProperty.getValue(mLayout.getChildAt(0)) : 0;
        }
        }


        @Override
        @Override