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

Commit 04b4c7bf authored by Eugene Susla's avatar Eugene Susla
Browse files

CompanionDeviceManager

This introduces an API for apps that support companion devices to provide a
more streamlined flow for pairing and setting up the device

Bug: 30932767
Test: Using a toy app, invoke the newly introduced API (CompanionDeviceManager),
 and go through the flow. Ensure filtering works, and device is returned to
 the calling app. Ensure the calling app can pair to the selected device.
Change-Id: I0aeb653afd65e4adead13ea9c7248ec20971b04a
parent 5c162bfe
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -67,7 +67,9 @@ public final class ScanFilter implements Parcelable {
    private final byte[] mManufacturerData;
    @Nullable
    private final byte[] mManufacturerDataMask;
    private static final ScanFilter EMPTY = new ScanFilter.Builder().build() ;

    /** @hide */
    public static final ScanFilter EMPTY = new ScanFilter.Builder().build() ;


    private ScanFilter(String name, String deviceAddress, ParcelUuid uuid,
@@ -318,8 +320,12 @@ public final class ScanFilter implements Parcelable {
        return true;
    }

    // Check if the uuid pattern is contained in a list of parcel uuids.
    private boolean matchesServiceUuids(ParcelUuid uuid, ParcelUuid parcelUuidMask,
    /**
     * Check if the uuid pattern is contained in a list of parcel uuids.
     *
     * @hide
     */
    public static boolean matchesServiceUuids(ParcelUuid uuid, ParcelUuid parcelUuidMask,
            List<ParcelUuid> uuids) {
        if (uuid == null) {
            return true;
@@ -338,7 +344,7 @@ public final class ScanFilter implements Parcelable {
    }

    // Check if the uuid pattern matches the particular service uuid.
    private boolean matchesServiceUuid(UUID uuid, UUID mask, UUID data) {
    private static boolean matchesServiceUuid(UUID uuid, UUID mask, UUID data) {
        if (mask == null) {
            return uuid.equals(data);
        }