Merge "CDM isDeviceAssociatedForWifiConnection returns false if no devices associated" into rvc-dev am: 823539be20

Change-Id: I9c264c94e9ff92b08132c2c7061d4c3f321cfc99
This commit is contained in:
Automerger Merge Worker
2020-02-29 04:52:08 +00:00

View File

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