Merge "CDM isDeviceAssociatedForWifiConnection returns false if no devices associated" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-02-29 04:43:28 +00:00
committed by Android (Google) Code Review

View File

@@ -369,10 +369,13 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
boolean bypassMacPermission = getContext().getPackageManager().checkPermission(
android.Manifest.permission.COMPANION_APPROVE_WIFI_CONNECTIONS, packageName)
== PackageManager.PERMISSION_GRANTED;
if (bypassMacPermission) {
return true;
}
return CollectionUtils.any(
readAllAssociations(userId, packageName),
a -> bypassMacPermission || Objects.equals(a.deviceAddress, macAddress));
a -> Objects.equals(a.deviceAddress, macAddress));
}
private void checkCanCallNotificationApi(String callingPackage) throws RemoteException {