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
This commit is contained in:
Julia Reynolds
2017-04-20 11:31:30 -04:00
parent 0db9724b6c
commit 018aa621aa

View File

@@ -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);
}
}
});
}