Debugging bad notification sorts.

Bug: 16626175
Change-Id: I6cc7ee5f853c846e3aed6f9750e8fb6bc5aed699
This commit is contained in:
Daniel Sandler
2014-08-05 15:57:38 -04:00
committed by Dan Sandler
parent 256a22663d
commit 41da5ff98f

View File

@@ -1642,7 +1642,23 @@ public class NotificationManagerService extends SystemService {
applyZenModeLocked(r);
mRankingHelper.sort(mNotificationList);
try {
mRankingHelper.sort(mNotificationList);
} catch (RuntimeException ex) {
// Don't crash the system server if something bad happened.
Log.e(TAG, "Extreme badness during notification sort", ex);
Log.e(TAG, "Current notification list: ");
for (int ii=0; ii < mNotificationList.size(); ii++) {
NotificationRecord nr = mNotificationList.get(ii);
Log.e(TAG, String.format(
" [%d] %s (group %s, rank %d, sortkey %s, proxy %s)",
ii, nr, nr.getGroupKey(), nr.getAuthoritativeRank(),
nr.getNotification().getSortKey(),
nr.getRankingProxy()));
}
// STOPSHIP: remove once b/16626175 is found
throw ex;
}
if (notification.icon != 0) {
StatusBarNotification oldSbn = (old != null) ? old.sbn : null;