Merge "Don't let toasting throw a runtime exception." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4b0d2bf70a
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user