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

Commit 93a035cc authored by Craig Mautner's avatar Craig Mautner
Browse files

Fix IndexOutOfBoundsException.

This fix resolves an exception thrown when the snapshot ArrayList has
no entries.

Fixes bug 6311207.

Change-Id: I84383417116a4a62eb2842792ed04096aebc8ee2
parent 1ade5ae9
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2043,7 +2043,10 @@ public class PhoneStatusBar extends BaseStatusBar {
                        snapshot.add(child);
                    }
                }
                final int N = snapshot.size();
                if (snapshot.isEmpty()) {
                    animateCollapse(false);
                    return;
                }
                new Thread(new Runnable() {
                    @Override
                    public void run() {
@@ -2059,6 +2062,7 @@ public class PhoneStatusBar extends BaseStatusBar {
                        mPile.setViewRemoval(false);

                        mPostCollapseCleanup = new Runnable() {
                            @Override
                            public void run() {
                                try {
                                    mPile.setViewRemoval(true);
@@ -2069,9 +2073,8 @@ public class PhoneStatusBar extends BaseStatusBar {

                        View sampleView = snapshot.get(0);
                        int width = sampleView.getWidth();
                        final int velocity = (int)(width * 8); // 1000/8 = 125 ms duration
                        for (View v : snapshot) {
                            final View _v = v;
                        final int velocity = width * 8; // 1000/8 = 125 ms duration
                        for (final View _v : snapshot) {
                            mHandler.postDelayed(new Runnable() {
                                @Override
                                public void run() {
@@ -2087,6 +2090,7 @@ public class PhoneStatusBar extends BaseStatusBar {
                        // synchronize the end of those animations with the start of the collaps
                        // exactly.
                        mHandler.postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                animateCollapse(false);
                            }