Loading core/java/android/app/NotificationManager.java +11 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app; import static android.Manifest.permission.POST_NOTIFICATIONS; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.service.notification.Flags.notificationClassification; import android.annotation.CallbackExecutor; Loading Loading @@ -1597,6 +1599,9 @@ public class NotificationManager { * Returns whether notifications from the calling package are enabled. */ public boolean areNotificationsEnabled() { if (Flags.nmBinderPerfPermissionCheck()) { return mContext.checkSelfPermission(POST_NOTIFICATIONS) == PERMISSION_GRANTED; } else { INotificationManager service = getService(); try { return service.areNotificationsEnabled(mContext.getPackageName()); Loading @@ -1604,6 +1609,7 @@ public class NotificationManager { throw e.rethrowFromSystemServer(); } } } /** * Gets whether all notifications posted by this app can appear outside of the Loading core/java/android/app/notification.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,13 @@ flag { bug: "367996732" } flag { name: "nm_binder_perf_permission_check" namespace: "systemui" description: "Use PermissionManager for areNotificationsEnabled() instead of NMS" bug: "362981561" } flag { name: "no_sbnholder" namespace: "systemui" Loading Loading
core/java/android/app/NotificationManager.java +11 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app; import static android.Manifest.permission.POST_NOTIFICATIONS; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.service.notification.Flags.notificationClassification; import android.annotation.CallbackExecutor; Loading Loading @@ -1597,6 +1599,9 @@ public class NotificationManager { * Returns whether notifications from the calling package are enabled. */ public boolean areNotificationsEnabled() { if (Flags.nmBinderPerfPermissionCheck()) { return mContext.checkSelfPermission(POST_NOTIFICATIONS) == PERMISSION_GRANTED; } else { INotificationManager service = getService(); try { return service.areNotificationsEnabled(mContext.getPackageName()); Loading @@ -1604,6 +1609,7 @@ public class NotificationManager { throw e.rethrowFromSystemServer(); } } } /** * Gets whether all notifications posted by this app can appear outside of the Loading
core/java/android/app/notification.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,13 @@ flag { bug: "367996732" } flag { name: "nm_binder_perf_permission_check" namespace: "systemui" description: "Use PermissionManager for areNotificationsEnabled() instead of NMS" bug: "362981561" } flag { name: "no_sbnholder" namespace: "systemui" Loading