summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xservices/core/java/com/android/server/notification/NotificationManagerService.java10
1 files changed, 8 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 d1e0b0474b61..829b9c7692fe 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -9909,10 +9909,16 @@ public class NotificationManagerService extends SystemService {
* given NAS is bound in.
*/
private boolean isInteractionVisibleToListener(ManagedServiceInfo info, int userId) {
- boolean isAssistantService = mAssistants.isServiceTokenValidLocked(info.service);
+ boolean isAssistantService = isServiceTokenValid(info.service);
return !isAssistantService || info.isSameUser(userId);
}
+ private boolean isServiceTokenValid(IInterface service) {
+ synchronized (mNotificationLock) {
+ return mAssistants.isServiceTokenValidLocked(service);
+ }
+ }
+
private boolean isPackageSuspendedForUser(String pkg, int uid) {
final long identity = Binder.clearCallingIdentity();
int userId = UserHandle.getUserId(uid);
@@ -11169,7 +11175,7 @@ public class NotificationManagerService extends SystemService {
BackgroundThread.getHandler().post(() -> {
if (info.isSystem
|| hasCompanionDevice(info)
- || mAssistants.isServiceTokenValidLocked(info.service)) {
+ || isServiceTokenValid(info.service)) {
notifyNotificationChannelChanged(
info, pkg, user, channel, modificationType);
}