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

Commit 152d20e6 authored by Rishab's avatar Rishab Committed by Rishab Ghanti
Browse files

API change to support additional remote device metadata fields

Test: m com.android.btservices
Bug: 358631232
Change-Id: I01c66584db3850287d98356cb8f6d3b5affd88c4
parent d9cd5f81
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -258,6 +258,10 @@ package android.bluetooth {
    field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10
    field @FlaggedApi("com.android.bluetooth.flags.support_exclusive_manager") public static final int METADATA_EXCLUSIVE_MANAGER = 29; // 0x1d
    field public static final int METADATA_HARDWARE_VERSION = 3; // 0x3
    field @FlaggedApi("com.android.bluetooth.flags.support_remote_device_metadata") public static final int METADATA_HEAD_UNIT_BUILD = 33; // 0x21
    field @FlaggedApi("com.android.bluetooth.flags.support_remote_device_metadata") public static final int METADATA_HEAD_UNIT_MANUFACTURER_NAME = 31; // 0x1f
    field @FlaggedApi("com.android.bluetooth.flags.support_remote_device_metadata") public static final int METADATA_HEAD_UNIT_MODEL_NAME = 32; // 0x20
    field @FlaggedApi("com.android.bluetooth.flags.support_remote_device_metadata") public static final int METADATA_HEAD_UNIT_SOFTWARE_VERSION = 34; // 0x22
    field public static final int METADATA_IS_UNTETHERED_HEADSET = 6; // 0x6
    field public static final int METADATA_LE_AUDIO = 26; // 0x1a
    field public static final int METADATA_MAIN_BATTERY = 18; // 0x12
@@ -267,6 +271,7 @@ package android.bluetooth {
    field public static final int METADATA_MANUFACTURER_NAME = 0; // 0x0
    field public static final int METADATA_MAX_LENGTH = 2048; // 0x800
    field public static final int METADATA_MODEL_NAME = 1; // 0x1
    field @FlaggedApi("com.android.bluetooth.flags.support_remote_device_metadata") public static final int METADATA_MODEL_YEAR = 30; // 0x1e
    field public static final int METADATA_SOFTWARE_VERSION = 2; // 0x2
    field public static final int METADATA_UNTETHERED_CASE_BATTERY = 12; // 0xc
    field public static final int METADATA_UNTETHERED_CASE_CHARGING = 15; // 0xf
+56 −1
Original line number Diff line number Diff line
@@ -516,6 +516,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
            value = {
                METADATA_MANUFACTURER_NAME,
                METADATA_MODEL_NAME,
                METADATA_MODEL_YEAR,
                METADATA_SOFTWARE_VERSION,
                METADATA_HARDWARE_VERSION,
                METADATA_COMPANION_APP,
@@ -543,7 +544,11 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                METADATA_LE_AUDIO,
                METADATA_GMCS_CCCD,
                METADATA_GTBS_CCCD,
                METADATA_EXCLUSIVE_MANAGER
                METADATA_EXCLUSIVE_MANAGER,
                METADATA_HEAD_UNIT_MANUFACTURER_NAME,
                METADATA_HEAD_UNIT_MODEL_NAME,
                METADATA_HEAD_UNIT_BUILD,
                METADATA_HEAD_UNIT_SOFTWARE_VERSION
            })
    @Retention(RetentionPolicy.SOURCE)
    public @interface MetadataKey {}
@@ -570,6 +575,15 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     */
    @SystemApi public static final int METADATA_MODEL_NAME = 1;

    /**
     * Model year of the Bluetooth device. Data type should be {@link String} as {@link Byte} array.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_REMOTE_DEVICE_METADATA)
    @SystemApi
    public static final int METADATA_MODEL_YEAR = 30;

    /**
     * Software version of this Bluetooth device Data type should be {@link String} as {@link Byte}
     * array.
@@ -810,6 +824,47 @@ public final class BluetoothDevice implements Parcelable, Attributable {

    private static final int METADATA_MAX_KEY = METADATA_EXCLUSIVE_MANAGER;

    /**
     * Head unit manufacturer name of the Bluetooth device. Data type should be {@link String} as
     * {@link Byte} array. Should only be set/available for a car device.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_REMOTE_DEVICE_METADATA)
    @SystemApi
    public static final int METADATA_HEAD_UNIT_MANUFACTURER_NAME = 31;

    /**
     * Head unit model name of the Bluetooth device. Data type should be {@link String} as {@link
     * Byte} array. Should only be set/available for a car device.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_REMOTE_DEVICE_METADATA)
    @SystemApi
    public static final int METADATA_HEAD_UNIT_MODEL_NAME = 32;

    /**
     * Build of the overall head unit device. Not specific to hardware or software. Example can be
     * 'manufacturer_country'. Data type should be {@link String} as {@link Byte} array. Should only
     * be set/available for a car device.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_REMOTE_DEVICE_METADATA)
    @SystemApi
    public static final int METADATA_HEAD_UNIT_BUILD = 33;

    /**
     * Head unit software version of the Bluetooth device. Data type should be {@link String} as
     * {@link Byte} array. Should only be set/available for a car device.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_SUPPORT_REMOTE_DEVICE_METADATA)
    @SystemApi
    public static final int METADATA_HEAD_UNIT_SOFTWARE_VERSION = 34;

    /**
     * Device type which is used in METADATA_DEVICE_TYPE Indicates this Bluetooth device is a
     * standard Bluetooth accessory or not listed in METADATA_DEVICE_TYPE_*.