summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index cc3948ed1a59..f6addc0d87e8 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3229,8 +3229,12 @@ public class NotificationManagerService extends SystemService {
private void doDebugOnlyToast(CharSequence toastText) {
if (Build.IS_DEBUGGABLE) {
- Toast toast = Toast.makeText(getContext(), toastText, Toast.LENGTH_LONG);
- toast.show();
+ try {
+ Toast toast = Toast.makeText(getContext(), toastText, Toast.LENGTH_LONG);
+ toast.show();
+ } catch (RuntimeException e) {
+ Slog.w(TAG, "Unable to toast with text: " + toastText, e);
+ }
}
}