From 3ad4cdd10727d0453269aa56815705996cea9608 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Tue, 17 Apr 2018 09:36:30 -0400 Subject: [PATCH] Don't crash apps on notification error Apps cannot recover from this error, and crashing is a bad user experience. Test: none Bug: 30529567 Change-Id: I088ab04f8efeb5fa2483520141c54e90ff441ba4 --- .../notification/NotificationManagerService.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index d5b2ee3461872..d112c0212fa6e 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -782,18 +782,8 @@ public class NotificationManagerService extends SystemService { @Override public void onNotificationError(int callingUid, int callingPid, String pkg, String tag, int id, int uid, int initialPid, String message, int userId) { - Slog.d(TAG, "onNotification error pkg=" + pkg + " tag=" + tag + " id=" + id - + "; will crashApplication(uid=" + uid + ", pid=" + initialPid + ")"); cancelNotification(callingUid, callingPid, pkg, tag, id, 0, 0, false, userId, REASON_ERROR, null); - long ident = Binder.clearCallingIdentity(); - try { - ActivityManager.getService().crashApplication(uid, initialPid, pkg, -1, - "Bad notification posted from package " + pkg - + ": " + message); - } catch (RemoteException e) { - } - Binder.restoreCallingIdentity(ident); } @Override