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

Commit 12ae2f47 authored by Łukasz Rymanowski (xWF)'s avatar Łukasz Rymanowski (xWF) Committed by Gerrit Code Review
Browse files

Merge "BluetoothLeAudio: Use new API flag for API changes on Mono errata" into main

parents 64b3b492 2def12c6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -479,11 +479,11 @@ package android.bluetooth {
    field public static final int AUDIO_LOCATION_FRONT_RIGHT = 2; // 0x2
    field public static final int AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = 128; // 0x80
    field public static final int AUDIO_LOCATION_FRONT_RIGHT_WIDE = 33554432; // 0x2000000
    field @Deprecated @FlaggedApi("com.android.bluetooth.flags.leaudio_mono_location_errata") public static final int AUDIO_LOCATION_INVALID = 0; // 0x0
    field @Deprecated @FlaggedApi("com.android.bluetooth.flags.leaudio_mono_location_errata_api") public static final int AUDIO_LOCATION_INVALID = 0; // 0x0
    field public static final int AUDIO_LOCATION_LEFT_SURROUND = 67108864; // 0x4000000
    field public static final int AUDIO_LOCATION_LOW_FREQ_EFFECTS_ONE = 8; // 0x8
    field public static final int AUDIO_LOCATION_LOW_FREQ_EFFECTS_TWO = 512; // 0x200
    field @FlaggedApi("com.android.bluetooth.flags.leaudio_mono_location_errata") public static final int AUDIO_LOCATION_MONO = 0; // 0x0
    field @FlaggedApi("com.android.bluetooth.flags.leaudio_mono_location_errata_api") public static final int AUDIO_LOCATION_MONO = 0; // 0x0
    field public static final int AUDIO_LOCATION_RIGHT_SURROUND = 134217728; // 0x8000000
    field public static final int AUDIO_LOCATION_SIDE_LEFT = 1024; // 0x400
    field public static final int AUDIO_LOCATION_SIDE_RIGHT = 2048; // 0x800
@@ -496,7 +496,7 @@ package android.bluetooth {
    field public static final int AUDIO_LOCATION_TOP_FRONT_RIGHT = 8192; // 0x2000
    field public static final int AUDIO_LOCATION_TOP_SIDE_LEFT = 262144; // 0x40000
    field public static final int AUDIO_LOCATION_TOP_SIDE_RIGHT = 524288; // 0x80000
    field @FlaggedApi("com.android.bluetooth.flags.leaudio_mono_location_errata") public static final int AUDIO_LOCATION_UNKNOWN = -2147483648; // 0x80000000
    field @FlaggedApi("com.android.bluetooth.flags.leaudio_mono_location_errata_api") public static final int AUDIO_LOCATION_UNKNOWN = -2147483648; // 0x80000000
    field public static final String EXTRA_LE_AUDIO_GROUP_ID = "android.bluetooth.extra.LE_AUDIO_GROUP_ID";
    field public static final int GROUP_STREAM_STATUS_IDLE = 0; // 0x0
    field public static final int GROUP_STREAM_STATUS_STREAMING = 1; // 0x1
+5 −4
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
     *     with a meaning MONO.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_LEAUDIO_MONO_LOCATION_ERRATA)
    @FlaggedApi(Flags.FLAG_LEAUDIO_MONO_LOCATION_ERRATA_API)
    @Deprecated
    @SystemApi
    public static final int AUDIO_LOCATION_INVALID = 0;
@@ -377,7 +377,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_LEAUDIO_MONO_LOCATION_ERRATA)
    @FlaggedApi(Flags.FLAG_LEAUDIO_MONO_LOCATION_ERRATA_API)
    @SystemApi
    public static final int AUDIO_LOCATION_MONO = 0;

@@ -386,7 +386,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_LEAUDIO_MONO_LOCATION_ERRATA)
    @FlaggedApi(Flags.FLAG_LEAUDIO_MONO_LOCATION_ERRATA_API)
    @SystemApi
    public static final int AUDIO_LOCATION_UNKNOWN = 0x01 << 31;

@@ -1186,6 +1186,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
    @SystemApi
    @RequiresBluetoothConnectPermission
    @RequiresPermission(allOf = {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED})
    @SuppressWarnings("FlaggedApi") // Due to deprecated AUDIO_LOCATION_INVALID
    public @AudioLocation int getAudioLocation(@NonNull BluetoothDevice device) {
        if (VDBG) log("getAudioLocation()");
        final IBluetoothLeAudio service = getService();
@@ -1200,7 +1201,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
            }
        }

        if (Flags.leaudioMonoLocationErrata()
        if (Flags.leaudioMonoLocationErrataApi()
                && CompatChanges.isChangeEnabled(LEAUDIO_MONO_LOCATION_ERRATA)) {
            return AUDIO_LOCATION_UNKNOWN;
        }