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

Commit c02cc64b authored by Yiyi Shen's avatar Yiyi Shen Committed by William Escande
Browse files

Add @SystemApi device type metadata key for speakers and headsets.

Bug: 289584302
Bug: 308098957
Test: m service-bluetooth
Change-Id: I78032fee7cbcb99713896ad06422f88001fbffe0
parent 7b1776a2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ aconfig_declarations {
    srcs: [
        "a2dp.aconfig",
        "audio_routing.aconfig",
        "framework.aconfig",
        "gap.aconfig",
        "gatt.aconfig",
        "hap.aconfig",
+8 −0
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"

flag {
    name: "support_metadata_device_types_apis"
    namespace: "bluetooth"
    description: "Support more device types in bt device metadata"
    bug: "289584302"
}
+2 −0
Original line number Diff line number Diff line
@@ -219,6 +219,8 @@ package android.bluetooth {
    field public static final int CONNECTION_ACCESS_NO = 2; // 0x2
    field public static final int CONNECTION_ACCESS_YES = 1; // 0x1
    field public static final String DEVICE_TYPE_DEFAULT = "Default";
    field @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis") public static final String DEVICE_TYPE_HEADSET = "Headset";
    field @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis") public static final String DEVICE_TYPE_SPEAKER = "Speaker";
    field public static final String DEVICE_TYPE_STYLUS = "Stylus";
    field public static final String DEVICE_TYPE_UNTETHERED_HEADSET = "Untethered Headset";
    field public static final String DEVICE_TYPE_WATCH = "Watch";
+21 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.bluetooth;

import static android.bluetooth.BluetoothUtils.getSyncTimeout;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -836,6 +837,26 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    @SystemApi
    public static final String DEVICE_TYPE_STYLUS = "Stylus";

    /**
     * Device type which is used in METADATA_DEVICE_TYPE
     * Indicates this Bluetooth device is a speaker.
     *
     * @hide
     */
    @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis")
    @SystemApi
    public static final String DEVICE_TYPE_SPEAKER = "Speaker";

    /**
     * Device type which is used in METADATA_DEVICE_TYPE
     * Indicates this Bluetooth device is a tethered headset.
     *
     * @hide
     */
    @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis")
    @SystemApi
    public static final String DEVICE_TYPE_HEADSET = "Headset";

    /**
     * Broadcast Action: This intent is used to broadcast the {@link UUID}
     * wrapped as a {@link android.os.ParcelUuid} of the remote device after it