Skip to content

Commit 592647e

Browse files
Craig MautnerAndroid (Google) Code Review
authored andcommitted
Merge "Fix IndexOutOfBoundsException."
2 parents 1bee28f + 93a035c commit 592647e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,10 @@ public void onClick(View v) {
20472047
snapshot.add(child);
20482048
}
20492049
}
2050-
final int N = snapshot.size();
2050+
if (snapshot.isEmpty()) {
2051+
animateCollapse(false);
2052+
return;
2053+
}
20512054
new Thread(new Runnable() {
20522055
@Override
20532056
public void run() {
@@ -2063,6 +2066,7 @@ public void run() {
20632066
mPile.setViewRemoval(false);
20642067

20652068
mPostCollapseCleanup = new Runnable() {
2069+
@Override
20662070
public void run() {
20672071
try {
20682072
mPile.setViewRemoval(true);
@@ -2073,9 +2077,8 @@ public void run() {
20732077

20742078
View sampleView = snapshot.get(0);
20752079
int width = sampleView.getWidth();
2076-
final int velocity = (int)(width * 8); // 1000/8 = 125 ms duration
2077-
for (View v : snapshot) {
2078-
final View _v = v;
2080+
final int velocity = width * 8; // 1000/8 = 125 ms duration
2081+
for (final View _v : snapshot) {
20792082
mHandler.postDelayed(new Runnable() {
20802083
@Override
20812084
public void run() {
@@ -2091,6 +2094,7 @@ public void run() {
20912094
// synchronize the end of those animations with the start of the collaps
20922095
// exactly.
20932096
mHandler.postDelayed(new Runnable() {
2097+
@Override
20942098
public void run() {
20952099
animateCollapse(false);
20962100
}

0 commit comments

Comments
 (0)