From 6b68a567515952204cf5b140cf58531d6cf1af84 Mon Sep 17 00:00:00 2001 From: Alexander Roederer Date: Thu, 27 Apr 2023 18:00:31 +0000 Subject: [PATCH] Adds wtf log for notify listener failures Adds wtf log whenever DeadObjectException: unable to notify listener is thrown from NotificationManagerService on posted, removed, or ranking updated. The goal is to track Binder transaction failures occuring when the binder is full. Bug: 249848655 Test: Only adds more specific exception logging Change-Id: I82013d7cff36c19d89f3d6f6b25814bb8476f578 --- .../server/notification/NotificationManagerService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index d1d6f5f10bc6c..4b3fac95246d4 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -11481,6 +11481,8 @@ public class NotificationManagerService extends SystemService { StatusBarNotificationHolder sbnHolder = new StatusBarNotificationHolder(sbn); try { listener.onNotificationPosted(sbnHolder, rankingUpdate); + } catch (android.os.DeadObjectException ex) { + Slog.wtf(TAG, "unable to notify listener (posted): " + info, ex); } catch (RemoteException ex) { Slog.e(TAG, "unable to notify listener (posted): " + info, ex); } @@ -11502,6 +11504,8 @@ public class NotificationManagerService extends SystemService { reason = REASON_LISTENER_CANCEL; } listener.onNotificationRemoved(sbnHolder, rankingUpdate, stats, reason); + } catch (android.os.DeadObjectException ex) { + Slog.wtf(TAG, "unable to notify listener (removed): " + info, ex); } catch (RemoteException ex) { Slog.e(TAG, "unable to notify listener (removed): " + info, ex); } @@ -11512,6 +11516,8 @@ public class NotificationManagerService extends SystemService { final INotificationListener listener = (INotificationListener) info.service; try { listener.onNotificationRankingUpdate(rankingUpdate); + } catch (android.os.DeadObjectException ex) { + Slog.wtf(TAG, "unable to notify listener (ranking update): " + info, ex); } catch (RemoteException ex) { Slog.e(TAG, "unable to notify listener (ranking update): " + info, ex); }