summaryrefslogtreecommitdiffstats
path: root/services/java/com/android
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-06-04 16:08:02 -0400
committerJoe Onorato <joeo@android.com>2010-06-09 09:15:25 -0700
commit005847b03b2ebe3eb1a974a8a04ad51bca6636cd (patch)
tree1664f30f2320bddcf44b0af581b492589a38fcda /services/java/com/android
parentd956ae8b813da893ab6a9357acfe287c529d6ac2 (diff)
downloadframeworks_base-005847b03b2ebe3eb1a974a8a04ad51bca6636cd.zip
frameworks_base-005847b03b2ebe3eb1a974a8a04ad51bca6636cd.tar.gz
frameworks_base-005847b03b2ebe3eb1a974a8a04ad51bca6636cd.tar.bz2
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
Diffstat (limited to 'services/java/com/android')
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java6
-rw-r--r--services/java/com/android/server/status/StatusBarManagerService.java7
2 files changed, 13 insertions, 0 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index b5c2b1b..a51691c 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -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() {
diff --git a/services/java/com/android/server/status/StatusBarManagerService.java b/services/java/com/android/server/status/StatusBarManagerService.java
index 0af1ebb..925a6eb 100644
--- a/services/java/com/android/server/status/StatusBarManagerService.java
+++ b/services/java/com/android/server/status/StatusBarManagerService.java
@@ -87,6 +87,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
void onClearAll();
void onNotificationClick(String pkg, String tag, int id);
void onPanelRevealed();
+ void onNotificationError(String pkg, String tag, int id, String message);
}
/**
@@ -279,6 +280,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub
mNotificationCallbacks.onNotificationClick(pkg, tag, id);
}
+ public void onNotificationError(String pkg, String tag, int id, String message) {
+ Slog.d(TAG, "onNotificationError message=" + message);
+ // WARNING: this will call back into us to do the remove. Don't hold any locks.
+ mNotificationCallbacks.onNotificationError(pkg, tag, id, message);
+ }
+
public void onClearAllNotifications() {
mNotificationCallbacks.onClearAll();
}