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

Commit 2c6b4cd8 authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Android (Google) Code Review
Browse files

Merge "Made BluetoothClass#doesClassMatch public."

parents 6f50489a 5f48e31c
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.bluetooth;

import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
@@ -327,21 +328,26 @@ public final class BluetoothClass implements Parcelable {
        return Arrays.copyOfRange(bytes, 1, bytes.length);
    }

    /** @hide */
    @UnsupportedAppUsage
    public static final int PROFILE_HEADSET = 0;
    /** @hide */
    @UnsupportedAppUsage

    public static final int PROFILE_A2DP = 1;

    /** @hide */
    @SystemApi
    public static final int PROFILE_OPP = 2;
    /** @hide */

    public static final int PROFILE_HID = 3;

    /** @hide */
    @SystemApi
    public static final int PROFILE_PANU = 4;

    /** @hide */
    @SystemApi
    public static final int PROFILE_NAP = 5;

    /** @hide */
    @SystemApi
    public static final int PROFILE_A2DP_SINK = 6;

    /**
@@ -350,11 +356,9 @@ public final class BluetoothClass implements Parcelable {
     * given class bits might support specified profile. It is not accurate for all
     * devices. It tries to err on the side of false positives.
     *
     * @param profile The profile to be checked
     * @return True if this device might support specified profile.
     * @hide
     * @param profile the profile to be checked
     * @return whether this device supports specified profile
     */
    @UnsupportedAppUsage
    public boolean doesClassMatch(int profile) {
        if (profile == PROFILE_A2DP) {
            if (hasService(Service.RENDER)) {