diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 38ed67731ab03..80f6a941bfa09 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2710,6 +2710,7 @@ public class NotificationManagerService extends SystemService { if (callback != null && !appIsForeground && !isSystemToast) { boolean block; + long id = Binder.clearCallingIdentity(); try { block = mPlatformCompat.isChangeEnabledByPackageName( CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK, pkg, @@ -2719,6 +2720,8 @@ public class NotificationManagerService extends SystemService { Slog.e(TAG, "Unexpected exception while checking block background custom toasts" + " change", e); block = false; + } finally { + Binder.restoreCallingIdentity(id); } if (block) { // TODO(b/144152069): Remove informative toast