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

Commit bdf6b002 authored by Christine Hallstrom's avatar Christine Hallstrom
Browse files

Add API for DCK connection interval

Add BluetoothGatt#CONNECTION_PRIORITY_DCK value to be used to set
connection priority to a value best supporting the Digital Car Key
implementation.

Note that the exact values defined will likely change, as it is
recommended to provide a range to the controller rather than a single
value for min and max.

Bug: 267229740
Test: Builds (functional changes to be added in follow-up CL, this is
adding the API and config value only)

Change-Id: Iff02e69caad079a627ff04ae6d593f58c897e16d
parent bcf51872
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@
    <integer name="gatt_balanced_priority_max_interval">40</integer>
    <integer name="gatt_low_power_min_interval">80</integer>
    <integer name="gatt_low_power_max_interval">100</integer>
    <integer name="gatt_dck_priority_min_interval">24</integer>
    <integer name="gatt_dck_priority_max_interval">24</integer>

    <!-- min/max connection intervals/latencies for companion devices -->
    <!-- Primary companion -->
+1 −0
Original line number Diff line number Diff line
@@ -609,6 +609,7 @@ package android.bluetooth {
    method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean writeDescriptor(android.bluetooth.BluetoothGattDescriptor);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int writeDescriptor(@NonNull android.bluetooth.BluetoothGattDescriptor, @NonNull byte[]);
    field public static final int CONNECTION_PRIORITY_BALANCED = 0; // 0x0
    field public static final int CONNECTION_PRIORITY_DCK = 3; // 0x3
    field public static final int CONNECTION_PRIORITY_HIGH = 1; // 0x1
    field public static final int CONNECTION_PRIORITY_LOW_POWER = 2; // 0x2
    field public static final int GATT_CONNECTION_CONGESTED = 143; // 0x8f
+8 −0
Original line number Diff line number Diff line
@@ -149,6 +149,14 @@ public final class BluetoothGatt implements BluetoothProfile {
    /** Connection parameter update - Request low power, reduced data rate connection parameters. */
    public static final int CONNECTION_PRIORITY_LOW_POWER = 2;

    /**
     * Connection parameter update - Request the priority preferred for Digital Car Key for a
     * lower latency connection. This connection parameter will consume more power than
     * {@link BluetoothGatt#CONNECTION_PRIORITY_BALANCED}, so it is recommended that apps do not use
     * this unless it specifically fits their use case.
     */
    public static final int CONNECTION_PRIORITY_DCK = 3;

    /**
     * Connection subrate request - Balanced.
     *