diff options
| author | Julia Reynolds <juliacr@google.com> | 2017-07-10 10:51:01 -0400 |
|---|---|---|
| committer | Julia Reynolds <juliacr@google.com> | 2017-07-13 11:35:46 -0400 |
| commit | 0f17000fb3b417fbc6129b47385c5f3c3dfd2de5 (patch) | |
| tree | 8f1143338cba478b948ac78c2a26a480986d65e0 /core/java/android/app/NotificationChannel.java | |
| parent | 080361ee313c4eae07ca1d17edafb371672fc76e (diff) | |
Fix system crash
Change-Id: I47d6d79682bfe907544f9282c26e350576618ce2
Fixes: 63474899
Test: runtest systemui-notification
Diffstat (limited to 'core/java/android/app/NotificationChannel.java')
| -rw-r--r-- | core/java/android/app/NotificationChannel.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index 143d147ab4e7..d6e36914ac6c 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -15,11 +15,6 @@ */ package android.app; -import org.json.JSONException; -import org.json.JSONObject; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlSerializer; - import android.annotation.SystemApi; import android.app.NotificationManager.Importance; import android.content.Intent; @@ -31,6 +26,11 @@ import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.text.TextUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlSerializer; + import java.io.IOException; import java.util.Arrays; @@ -743,7 +743,7 @@ public final class NotificationChannel implements Parcelable { private static String longArrayToString(long[] values) { StringBuffer sb = new StringBuffer(); - if (values != null) { + if (values != null && values.length > 0) { for (int i = 0; i < values.length - 1; i++) { sb.append(values[i]).append(DELIMITER); } |
