OSDN Git Service

Defend against a system server crash.
authorDaniel Sandler <dsandler@android.com>
Tue, 7 May 2013 17:53:47 +0000 (13:53 -0400)
committerDaniel Sandler <dsandler@android.com>
Tue, 7 May 2013 17:55:07 +0000 (13:55 -0400)
Bug: 8575629
Change-Id: Iafc8ab2f7460c8eacc37fc077cf5a3df16cf2911

services/java/com/android/server/NotificationManagerService.java

index cc74b92..6b38f89 100644 (file)
@@ -727,7 +727,13 @@ public class NotificationManagerService extends INotificationManager.Stub
                         && info.userid == userid) {
                     mListeners.remove(i);
                     if (info.connection != null) {
-                        mContext.unbindService(info.connection);
+                        try {
+                            mContext.unbindService(info.connection);
+                        } catch (IllegalArgumentException ex) {
+                            // something happened to the service: we think we have a connection
+                            // but it's bogus.
+                            Slog.e(TAG, "Listener " + name + " could not be unbound: " + ex);
+                        }
                     }
                 }
             }