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

Commit 92096a18 authored by Craig Mautner's avatar Craig Mautner Committed by The Android Automerger
Browse files

Fix IndexOutOfBoundsException.

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

Fixes bug 6311207.

Change-Id: I84383417116a4a62eb2842792ed04096aebc8ee2
parent 4d07a53c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2047,7 +2047,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() {
@@ -2063,6 +2066,7 @@ public class PhoneStatusBar extends BaseStatusBar {
                        mPile.setViewRemoval(false);

                        mPostCollapseCleanup = new Runnable() {
                            @Override
                            public void run() {
                                try {
                                    mPile.setViewRemoval(true);
@@ -2073,9 +2077,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() {
@@ -2091,6 +2094,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);
                            }