Handle errors inflating notifications (and their icons).

On an inflation error, the StatusBarService cleans up, removes / doesn't add
the views, and calls into the StatusBarManagerService, which tells the
NotificationManagerService to remove the notification.

That then calls all the way back into the StatusBarService, but I think being
extra careful is okay.  Throughout the status bar, it's all keyed off of the
IBinder key, so if the app comes in with a good notification while we're
cleaning up, we won't lose the new notification or anything like that.

Change-Id: Iea78a637495a8b67810c214b951d5ddb93becacb
This commit is contained in:
Joe Onorato
2010-06-04 16:08:02 -04:00
parent d956ae8b81
commit 005847b03b
6 changed files with 113 additions and 56 deletions

View File

@@ -303,6 +303,12 @@ class NotificationManagerService extends INotificationManager.Stub
updateLightsLocked();
}
}
public void onNotificationError(String pkg, String tag, int id, String message) {
Slog.d(TAG, "onNotification error pkg=" + pkg + " tag=" + tag + " id=" + id);
cancelNotification(pkg, tag, id, 0, 0);
// TODO: Tell the activity manager.
}
};
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {