summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Pitsch <gpitsch@google.com>2017-04-18 17:41:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-18 17:41:53 +0000
commit4b0d2bf70aa1fd9345ab7b7a693fd96878ce1663 (patch)
treed6e306bf66c9077b6fb468c128d3a2c226fd0b5b
parent190fe086df0c3a054e09dafc6fe459b929af0756 (diff)
parent1d063a1b775389e5f11291fbf86765b1c026ea2c (diff)
Merge "Don't let toasting throw a runtime exception." into oc-dev
-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);
+ }
}
}