From 018aa621aaaafd6adb810b2102eb3e503a14f708 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 20 Apr 2017 11:31:30 -0400 Subject: [PATCH] Move companion device check to the handler To return faster to the app that's creating channels, since companion device manager has to read from xml. Fixes: 37534164 Test: runtest systemui-notification, manual with an app with strict mode on. Change-Id: I78909ba3ca6b33302fb78756b49c9014de5aeb12 --- .../NotificationManagerService.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index c2892049e64d5..81a8e68b30440 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -5089,14 +5089,14 @@ public class NotificationManagerService extends SystemService { if (!serviceInfo.enabledAndUserMatches(UserHandle.getCallingUserId())) { continue; } - if (!hasCompanionDevice(serviceInfo)) { - continue; - } + mHandler.post(new Runnable() { @Override public void run() { - notifyNotificationChannelChanged( - serviceInfo, pkg, user, channel, modificationType); + if (hasCompanionDevice(serviceInfo)) { + notifyNotificationChannelChanged( + serviceInfo, pkg, user, channel, modificationType); + } } }); } @@ -5112,14 +5112,14 @@ public class NotificationManagerService extends SystemService { if (!serviceInfo.enabledAndUserMatches(UserHandle.getCallingUserId())) { continue; } - if (!hasCompanionDevice(serviceInfo)) { - continue; - } + mHandler.post(new Runnable() { @Override public void run() { - notifyNotificationChannelGroupChanged( - serviceInfo, pkg, user, group, modificationType); + if (hasCompanionDevice(serviceInfo)) { + notifyNotificationChannelGroupChanged( + serviceInfo, pkg, user, group, modificationType); + } } }); }