From 2def12c612304ec826daa5b7f6545728a31ba534 Mon Sep 17 00:00:00 2001 From: Ɓukasz Rymanowski Date: Fri, 11 Oct 2024 09:10:18 +0000 Subject: BluetoothLeAudio: Use new API flag for API changes on Mono errata Since API change is later then we want deliver stack changes, we use new flag for API changes Bug: 330847930 Bug: 372840605 Test: mmm packages/modules/Bluetooth Flag: com::android::bluetooth:flags::leaudio_mono_location_errata_api Change-Id: Icb811d399078f8b8bde2c84672f3519b983c34bf --- framework/api/system-current.txt | 6 +++--- framework/java/android/bluetooth/BluetoothLeAudio.java | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'framework') diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt index 8fb6d6940a..d4aadc4e9f 100644 --- a/framework/api/system-current.txt +++ b/framework/api/system-current.txt @@ -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 diff --git a/framework/java/android/bluetooth/BluetoothLeAudio.java b/framework/java/android/bluetooth/BluetoothLeAudio.java index c11efe1683..6bc4a73de9 100644 --- a/framework/java/android/bluetooth/BluetoothLeAudio.java +++ b/framework/java/android/bluetooth/BluetoothLeAudio.java @@ -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; } -- cgit v1.2.3-59-g8ed1b