diff options
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index f9d49d7ce0d1..506cc441c868 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -4282,14 +4282,16 @@ public class NotificationManagerService extends SystemService { } private void doChannelWarningToast(CharSequence toastText) { - final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0; - final boolean warningEnabled = Settings.Global.getInt(getContext().getContentResolver(), - Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled) != 0; - if (warningEnabled) { - Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText, - Toast.LENGTH_SHORT); - toast.show(); - } + Binder.withCleanCallingIdentity(() -> { + final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0; + final boolean warningEnabled = Settings.Global.getInt(getContext().getContentResolver(), + Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled) != 0; + if (warningEnabled) { + Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText, + Toast.LENGTH_SHORT); + toast.show(); + } + }); } @VisibleForTesting |