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

Commit 3888941d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix CDM association filtering" into sc-dev am: 59436521

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13857871

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I79e825b21d020e4d6fef427f470deb2886cfe1f2
parents 965cfe77 59436521
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -963,7 +963,8 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
    private Set<Association> getAllAssociations(int userId, @Nullable String packageFilter) {
        return CollectionUtils.filter(
                getAllAssociations(userId),
                a -> Objects.equals(packageFilter, a.getPackageName()));
                // Null filter == get all associations
                a -> packageFilter == null || Objects.equals(packageFilter, a.getPackageName()));
    }

    private Set<Association> getAllAssociations() {
@@ -983,8 +984,10 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
            int userId, @Nullable String packageFilter, @Nullable String addressFilter) {
        return CollectionUtils.filter(
                getAllAssociations(userId),
                a -> Objects.equals(packageFilter, a.getPackageName())
                        && Objects.equals(addressFilter, a.getDeviceMacAddress()));
                // Null filter == get all associations
                a -> (packageFilter == null || Objects.equals(packageFilter, a.getPackageName()))
                        && (addressFilter == null
                                || Objects.equals(addressFilter, a.getDeviceMacAddress())));
    }

    private Set<Association> readAllAssociations(int userId) {