From 4dd1b26caf2aaeee25429bc369b75c1187a4fd43 Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Wed, 12 Jan 2022 20:20:23 -0800 Subject: [PATCH] BtAudio: Replace bitmask capabilities with vector Bug: 203490261 Test: m android.hardware.bluetooth.audio-update-api Change-Id: I258e9912ab740990cab61772f0d6893a64d372d9 --- .../hardware/bluetooth/audio/AacCapabilities.aidl | 4 ++-- .../hardware/bluetooth/audio/AacObjectType.aidl | 8 ++++---- .../hardware/bluetooth/audio/AptxCapabilities.aidl | 2 +- .../android/hardware/bluetooth/audio/ChannelMode.aidl | 6 +++--- .../hardware/bluetooth/audio/LdacCapabilities.aidl | 4 ++-- .../hardware/bluetooth/audio/LdacChannelMode.aidl | 8 ++++---- .../hardware/bluetooth/audio/LdacQualityIndex.aidl | 8 ++++---- .../hardware/bluetooth/audio/PcmCapabilities.aidl | 2 +- .../hardware/bluetooth/audio/SbcAllocMethod.aidl | 4 ++-- .../hardware/bluetooth/audio/SbcCapabilities.aidl | 4 ++-- .../hardware/bluetooth/audio/SbcChannelMode.aidl | 10 +++++----- .../hardware/bluetooth/audio/AacCapabilities.aidl | 6 ++---- .../hardware/bluetooth/audio/AacObjectType.aidl | 8 ++++---- .../hardware/bluetooth/audio/AptxCapabilities.aidl | 3 +-- .../android/hardware/bluetooth/audio/ChannelMode.aidl | 6 +++--- .../hardware/bluetooth/audio/LdacCapabilities.aidl | 6 ++---- .../hardware/bluetooth/audio/LdacChannelMode.aidl | 8 ++++---- .../hardware/bluetooth/audio/LdacQualityIndex.aidl | 8 ++++---- .../hardware/bluetooth/audio/PcmCapabilities.aidl | 2 +- .../hardware/bluetooth/audio/SbcAllocMethod.aidl | 4 ++-- .../hardware/bluetooth/audio/SbcCapabilities.aidl | 6 ++---- .../hardware/bluetooth/audio/SbcChannelMode.aidl | 10 +++++----- 22 files changed, 60 insertions(+), 67 deletions(-) diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl index ad44c26f59..899b8ca6db 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacCapabilities.aidl @@ -34,9 +34,9 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable AacCapabilities { - android.hardware.bluetooth.audio.AacObjectType objectType; + android.hardware.bluetooth.audio.AacObjectType[] objectType; int[] sampleRateHz; - android.hardware.bluetooth.audio.ChannelMode channelMode; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; boolean variableBitRateSupported; byte[] bitsPerSample; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl index c129c66b40..2148244d06 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AacObjectType.aidl @@ -34,8 +34,8 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum AacObjectType { - MPEG2_LC = 1, - MPEG4_LC = 2, - MPEG4_LTP = 4, - MPEG4_SCALABLE = 8, + MPEG2_LC = 0, + MPEG4_LC = 1, + MPEG4_LTP = 2, + MPEG4_SCALABLE = 3, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl index 4767b696ec..08a38e26e1 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AptxCapabilities.aidl @@ -35,6 +35,6 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable AptxCapabilities { int[] sampleRateHz; - android.hardware.bluetooth.audio.ChannelMode channelMode; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; byte[] bitsPerSample; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl index 3ca93c3e03..c3bc7410e4 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -34,7 +34,7 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum ChannelMode { - UNKNOWN = 1, - MONO = 2, - STEREO = 4, + UNKNOWN = 0, + MONO = 1, + STEREO = 2, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl index 19e041a15c..aa4e4c8793 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacCapabilities.aidl @@ -35,7 +35,7 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable LdacCapabilities { int[] sampleRateHz; - android.hardware.bluetooth.audio.LdacChannelMode channelMode; - android.hardware.bluetooth.audio.LdacQualityIndex qualityIndex; + android.hardware.bluetooth.audio.LdacChannelMode[] channelMode; + android.hardware.bluetooth.audio.LdacQualityIndex[] qualityIndex; byte[] bitsPerSample; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl index a9d6c5e14e..88d6faff53 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacChannelMode.aidl @@ -34,8 +34,8 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum LdacChannelMode { - UNKNOWN = 1, - STEREO = 2, - DUAL = 4, - MONO = 8, + UNKNOWN = 0, + STEREO = 1, + DUAL = 2, + MONO = 3, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl index 693392fe51..35e435867e 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -34,8 +34,8 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum LdacQualityIndex { - HIGH = 1, - MID = 2, - LOW = 4, - ABR = 8, + HIGH = 0, + MID = 1, + LOW = 2, + ABR = 3, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl index 6cfe5cd78c..0c2f87d599 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -35,7 +35,7 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable PcmCapabilities { int[] sampleRateHz; - android.hardware.bluetooth.audio.ChannelMode channelMode; + android.hardware.bluetooth.audio.ChannelMode[] channelMode; byte[] bitsPerSample; int[] dataIntervalUs; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl index 5170f164a3..091f6d7246 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcAllocMethod.aidl @@ -34,6 +34,6 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum SbcAllocMethod { - ALLOC_MD_S = 1, - ALLOC_MD_L = 2, + ALLOC_MD_S = 0, + ALLOC_MD_L = 1, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl index ec3aa0f262..c8d7e7e74e 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcCapabilities.aidl @@ -35,10 +35,10 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable SbcCapabilities { int[] sampleRateHz; - android.hardware.bluetooth.audio.SbcChannelMode channelMode; + android.hardware.bluetooth.audio.SbcChannelMode[] channelMode; byte[] blockLength; byte[] numSubbands; - android.hardware.bluetooth.audio.SbcAllocMethod allocMethod; + android.hardware.bluetooth.audio.SbcAllocMethod[] allocMethod; byte[] bitsPerSample; int minBitpool; int maxBitpool; diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl index 88fca4aac4..6441a99877 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SbcChannelMode.aidl @@ -34,9 +34,9 @@ package android.hardware.bluetooth.audio; @Backing(type="byte") @VintfStability enum SbcChannelMode { - UNKNOWN = 1, - JOINT_STEREO = 2, - STEREO = 4, - DUAL = 8, - MONO = 16, + UNKNOWN = 0, + JOINT_STEREO = 1, + STEREO = 2, + DUAL = 3, + MONO = 4, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl index 43038836aa..c4153e9ffd 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacCapabilities.aidl @@ -24,11 +24,9 @@ import android.hardware.bluetooth.audio.ChannelMode; */ @VintfStability parcelable AacCapabilities { - /* bitfield */ - AacObjectType objectType; + AacObjectType[] objectType; int[] sampleRateHz; - /* bitfield */ - ChannelMode channelMode; + ChannelMode[] channelMode; boolean variableBitRateSupported; byte[] bitsPerSample; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl index 480e422e1c..4e9958c855 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AacObjectType.aidl @@ -22,17 +22,17 @@ enum AacObjectType { /** * MPEG-2 Low Complexity. Support is Mandatory. */ - MPEG2_LC = 1, + MPEG2_LC, /** * MPEG-4 Low Complexity. Support is Optional. */ - MPEG4_LC = 1 << 1, + MPEG4_LC, /** * MPEG-4 Long Term Prediction. Support is Optional. */ - MPEG4_LTP = 1 << 2, + MPEG4_LTP, /** * MPEG-4 Scalable. Support is Optional. */ - MPEG4_SCALABLE = 1 << 3, + MPEG4_SCALABLE, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl index 6a37fc6a41..f5605d31fe 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AptxCapabilities.aidl @@ -24,7 +24,6 @@ import android.hardware.bluetooth.audio.ChannelMode; @VintfStability parcelable AptxCapabilities { int[] sampleRateHz; - /* bitfield */ - ChannelMode channelMode; + ChannelMode[] channelMode; byte[] bitsPerSample; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl index 2df879d837..66138724ae 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/ChannelMode.aidl @@ -19,7 +19,7 @@ package android.hardware.bluetooth.audio; @VintfStability @Backing(type="byte") enum ChannelMode { - UNKNOWN = 1, - MONO = 1 << 1, - STEREO = 1 << 2, + UNKNOWN, + MONO, + STEREO, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl index 44cca7e071..1dbec0896b 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacCapabilities.aidl @@ -26,9 +26,7 @@ import android.hardware.bluetooth.audio.LdacQualityIndex; @VintfStability parcelable LdacCapabilities { int[] sampleRateHz; - /* bitfiled */ - LdacChannelMode channelMode; - /* bitfiled */ - LdacQualityIndex qualityIndex; + LdacChannelMode[] channelMode; + LdacQualityIndex[] qualityIndex; byte[] bitsPerSample; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl index 3acca32fc2..3cc910f49c 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacChannelMode.aidl @@ -22,8 +22,8 @@ package android.hardware.bluetooth.audio; @VintfStability @Backing(type="byte") enum LdacChannelMode { - UNKNOWN = 1, - STEREO = 1 << 1, - DUAL = 1 << 2, - MONO = 1 << 3, + UNKNOWN, + STEREO, + DUAL, + MONO, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl index cb125839ef..9993b8b6d2 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl @@ -22,17 +22,17 @@ enum LdacQualityIndex { /** * 990kbps */ - HIGH = 1, + HIGH, /** * 660kbps */ - MID = 1 << 1, + MID, /** * 330kbps */ - LOW = 1 << 2, + LOW, /** * Adaptive Bit Rate mode */ - ABR = 1 << 3, + ABR, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl index f5d699edf1..776b777f50 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl @@ -24,7 +24,7 @@ import android.hardware.bluetooth.audio.ChannelMode; @VintfStability parcelable PcmCapabilities { int[] sampleRateHz; - ChannelMode channelMode; + ChannelMode[] channelMode; byte[] bitsPerSample; /** * Data interval for data transfer diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl index 7047e346dc..1159f30374 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcAllocMethod.aidl @@ -22,9 +22,9 @@ enum SbcAllocMethod { /** * SNR */ - ALLOC_MD_S = 1, + ALLOC_MD_S, /** * Loudness */ - ALLOC_MD_L = 1 << 1, + ALLOC_MD_L, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl index cf62ed4e5e..743a1f73e2 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcCapabilities.aidl @@ -25,12 +25,10 @@ import android.hardware.bluetooth.audio.SbcChannelMode; @VintfStability parcelable SbcCapabilities { int[] sampleRateHz; - /* bitfield */ - SbcChannelMode channelMode; + SbcChannelMode[] channelMode; byte[] blockLength; byte[] numSubbands; - /* bitfield */ - SbcAllocMethod allocMethod; + SbcAllocMethod[] allocMethod; byte[] bitsPerSample; /* * range from 2 to 250. diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl index 7eb38cd9f7..68e32670e8 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SbcChannelMode.aidl @@ -19,9 +19,9 @@ package android.hardware.bluetooth.audio; @VintfStability @Backing(type="byte") enum SbcChannelMode { - UNKNOWN = 1, - JOINT_STEREO = 1 << 1, - STEREO = 1 << 2, - DUAL = 1 << 3, - MONO = 1 << 4, + UNKNOWN, + JOINT_STEREO, + STEREO, + DUAL, + MONO, }