Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8231b40 authored by Evan Chen's avatar Evan Chen Committed by Android (Google) Code Review
Browse files

Merge "Need to check isManagedByCompanionApp before calling getMacAddress()"

parents efa0f1cd 8377f912
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -775,6 +775,7 @@ public class CompanionDeviceManagerService extends SystemService {

        exemptFromAutoRevoke(packageInfo.packageName, packageInfo.applicationInfo.uid);

        if (!association.isManagedByCompanionApp()) {
            if (mCurrentlyConnectedDevices.contains(association.getDeviceMacAddress())) {
                grantDeviceProfile(association);
            }
@@ -783,6 +784,7 @@ public class CompanionDeviceManagerService extends SystemService {
                restartBleScan();
            }
        }
    }

    private void exemptFromAutoRevoke(String packageName, int uid) {
        try {
@@ -1217,6 +1219,9 @@ public class CompanionDeviceManagerService extends SystemService {
        ArrayList<ScanFilter> result = new ArrayList<>();
        ArraySet<String> addressesSeen = new ArraySet<>();
        for (AssociationInfo association : getAllAssociations()) {
            if (association.isManagedByCompanionApp()) {
                continue;
            }
            String address = association.getDeviceMacAddress();
            if (addressesSeen.contains(address)) {
                continue;