diff options
author | Joe Onorato <joeo@android.com> | 2010-02-18 07:45:17 -0500 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-02-18 07:45:17 -0500 |
commit | 34fcf971037f33605e8009946d3acc686819dd6d (patch) | |
tree | dea746268a6f82e9eb3afb919024c26e7be0b2ee | |
parent | 5d72a8dda22cdb0c8e1ded1ca5e5122b0c25bcc7 (diff) | |
download | base-34fcf971037f33605e8009946d3acc686819dd6d.tar.gz |
Don't crash the system process when apps give us a bad foreground service notification.
-rw-r--r-- | services/java/com/android/server/am/ServiceRecord.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java index 89761a8860de..2f2cc32a9e0d 100644 --- a/services/java/com/android/server/am/ServiceRecord.java +++ b/services/java/com/android/server/am/ServiceRecord.java @@ -29,6 +29,7 @@ import android.os.Binder; import android.os.IBinder; import android.os.RemoteException; import android.os.SystemClock; +import android.util.Log; import java.io.PrintWriter; import java.util.ArrayList; @@ -267,6 +268,9 @@ class ServiceRecord extends Binder { int[] outId = new int[1]; inm.enqueueNotification(localPackageName, localForegroundId, localForegroundNoti, outId); + } catch (RuntimeException e) { + Log.w(ActivityManagerService.TAG, "Error showing notification for service", + e); } catch (RemoteException e) { } } @@ -288,6 +292,9 @@ class ServiceRecord extends Binder { } try { inm.cancelNotification(localPackageName, localForegroundId); + } catch (RuntimeException e) { + Log.w(ActivityManagerService.TAG, "Error canceling notification for" + + " service", e); } catch (RemoteException e) { } } |