From 74fc8e81985f034c2bf3097d2415be5b75168918 Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Wed, 15 Dec 2021 23:08:12 -0800 Subject: [PATCH] BT: Fix typo and improper data type Bug: 203490261 Test: m android.hardware.bluetooth.audio-update-api Change-Id: I366140cdaff2c42b724444dc9855d993cd502dcd --- .../bluetooth/audio/BluetoothAudioStatus.aidl | 41 +++++++++++++++++++ .../audio/IBluetoothAudioProvider.aidl | 6 +-- .../bluetooth/audio/LdacQualityIndex.aidl | 8 ++-- .../bluetooth/audio/LeAudioCapabilities.aidl | 4 +- .../bluetooth/audio/LeAudioConfiguration.aidl | 4 +- .../bluetooth/audio/PcmCapabilities.aidl | 2 +- .../bluetooth/audio/PresentationPosition.aidl | 2 +- .../hardware/bluetooth/audio/SessionType.aidl | 2 +- .../bluetooth/audio/BluetoothAudioStatus.aidl | 27 ++++++++++++ .../audio/IBluetoothAudioProvider.aidl | 9 ++-- .../bluetooth/audio/LdacQualityIndex.aidl | 8 ++-- .../bluetooth/audio/LeAudioCapabilities.aidl | 4 +- .../bluetooth/audio/LeAudioConfiguration.aidl | 4 +- .../bluetooth/audio/PcmCapabilities.aidl | 2 +- .../bluetooth/audio/PresentationPosition.aidl | 4 +- .../hardware/bluetooth/audio/SessionType.aidl | 2 +- 16 files changed, 99 insertions(+), 30 deletions(-) create mode 100644 bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl create mode 100644 bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl new file mode 100644 index 0000000000..7c0d82588c --- /dev/null +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl @@ -0,0 +1,41 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.bluetooth.audio; +@Backing(type="int") @VintfStability +enum BluetoothAudioStatus { + UNKNOWN = 0, + SUCCESS = 1, + UNSUPPORTED_CODEC_CONFIGURATION = 2, + FAILURE = 3, +} diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl index 84bcc0c061..e5e79cb1c4 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -35,7 +35,7 @@ package android.hardware.bluetooth.audio; @VintfStability interface IBluetoothAudioProvider { void endSession(); - android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); - void streamStarted(in boolean status); - void streamSuspended(in boolean status); + android.hardware.common.fmq.MQDescriptor startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig); + void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); + void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status); } 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 bc0d97b8b4..693392fe51 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 { - QUALITY_HIGH = 1, - QUALITY_MID = 2, - QUALITY_LOW = 4, - QUALITY_ABR = 8, + HIGH = 1, + MID = 2, + LOW = 4, + ABR = 8, } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl index 9efafcadeb..a7224ca5da 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl @@ -38,13 +38,13 @@ parcelable LeAudioCapabilities { android.hardware.bluetooth.audio.CodecType codecType; android.hardware.bluetooth.audio.AudioLocation supportedChannel; int supportedChannelCount; - android.hardware.bluetooth.audio.LeAudioCapabilities.LeaudioCodecCapabilities leaudioCodecCapabilities; + android.hardware.bluetooth.audio.LeAudioCapabilities.LeAudioCodecCapabilities leAudioCodecCapabilities; @VintfStability parcelable VendorCapabilities { ParcelableHolder extension; } @VintfStability - union LeaudioCodecCapabilities { + union LeAudioCodecCapabilities { android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities; android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities; } diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl index c6cb5cb8f7..2bc179163f 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -35,10 +35,10 @@ package android.hardware.bluetooth.audio; @VintfStability parcelable LeAudioConfiguration { android.hardware.bluetooth.audio.LeAudioMode mode; - android.hardware.bluetooth.audio.LeAudioConfiguration.LeAuioModeConfig modeConfig; + android.hardware.bluetooth.audio.LeAudioConfiguration.LeAudioModeConfig modeConfig; android.hardware.bluetooth.audio.CodecType codecType; @VintfStability - union LeAuioModeConfig { + union LeAudioModeConfig { android.hardware.bluetooth.audio.UnicastConfiguration unicastConfig; android.hardware.bluetooth.audio.BroadcastConfiguration broadcastConfig; } 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 0c2f87d599..6cfe5cd78c 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/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl index 810a9a1653..7e997e8c8f 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl @@ -36,7 +36,7 @@ package android.hardware.bluetooth.audio; parcelable PresentationPosition { long remoteDeviceAudioDelayNanos; long transmittedOctets; - android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimeStamp; + android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimestamp; @VintfStability parcelable TimeSpec { long tvSec; diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl index 900ab318ce..72d7fb247a 100644 --- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl +++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl @@ -36,7 +36,7 @@ package android.hardware.bluetooth.audio; enum SessionType { UNKNOWN = 0, A2DP_SOFTWARE_ENCODING_DATAPATH = 1, - A2DP_HARDWARE_OFFLOAD_DATAPATH = 2, + A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 2, HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3, LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4, LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5, diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl new file mode 100644 index 0000000000..ec78445e6e --- /dev/null +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl @@ -0,0 +1,27 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.bluetooth.audio; + +@VintfStability +@Backing(type="int") +enum BluetoothAudioStatus { + UNKNOWN = 0, + SUCCESS = 1, + UNSUPPORTED_CODEC_CONFIGURATION = 2, + // General failure + FAILURE = 3 +} diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl index cebd808f5c..a2c5ae9a76 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl @@ -17,9 +17,10 @@ package android.hardware.bluetooth.audio; import android.hardware.bluetooth.audio.AudioConfiguration; +import android.hardware.bluetooth.audio.BluetoothAudioStatus; import android.hardware.bluetooth.audio.IBluetoothAudioPort; import android.hardware.common.fmq.MQDescriptor; -import android.hardware.common.fmq.UnsynchronizedWrite; +import android.hardware.common.fmq.SynchronizedReadWrite; /** * HAL interface from the Bluetooth stack to the Audio HAL @@ -55,7 +56,7 @@ interface IBluetoothAudioProvider { * audioConfig.pcmConfig parameter. Invalid if streaming is offloaded * from/to hardware or on failure */ - MQDescriptor startSession( + MQDescriptor startSession( in IBluetoothAudioPort hostIf, in AudioConfiguration audioConfig); /** @@ -63,12 +64,12 @@ interface IBluetoothAudioProvider { * * @param status true for SUCCESS or false for FAILURE */ - void streamStarted(in boolean status); + void streamStarted(in BluetoothAudioStatus status); /** * Callback for IBluetoothAudioPort.suspendStream() * * @param status true for SUCCESS or false for FAILURE */ - void streamSuspended(in boolean status); + void streamSuspended(in BluetoothAudioStatus status); } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl index fc532f4298..cb125839ef 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 */ - QUALITY_HIGH = 1, + HIGH = 1, /** * 660kbps */ - QUALITY_MID = 1 << 1, + MID = 1 << 1, /** * 330kbps */ - QUALITY_LOW = 1 << 2, + LOW = 1 << 2, /** * Adaptive Bit Rate mode */ - QUALITY_ABR = 1 << 3, + ABR = 1 << 3, } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl index ea05820b3e..732427f060 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl @@ -31,7 +31,7 @@ parcelable LeAudioCapabilities { ParcelableHolder extension; } @VintfStability - union LeaudioCodecCapabilities { + union LeAudioCodecCapabilities { Lc3Capabilities lc3Capabilities; VendorCapabilities vendorCapabillities; } @@ -43,5 +43,5 @@ parcelable LeAudioCapabilities { */ AudioLocation supportedChannel; int supportedChannelCount; - LeaudioCodecCapabilities leaudioCodecCapabilities; + LeAudioCodecCapabilities leAudioCodecCapabilities; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl index a212c9682e..515794b247 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl @@ -24,7 +24,7 @@ import android.hardware.bluetooth.audio.UnicastConfiguration; @VintfStability parcelable LeAudioConfiguration { @VintfStability - union LeAuioModeConfig { + union LeAudioModeConfig { UnicastConfiguration unicastConfig; BroadcastConfiguration broadcastConfig; } @@ -32,6 +32,6 @@ parcelable LeAudioConfiguration { * The mode of the LE audio */ LeAudioMode mode; - LeAuioModeConfig modeConfig; + LeAudioModeConfig modeConfig; CodecType codecType; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl index 776b777f50..f5d699edf1 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/PresentationPosition.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl index 17e746f5ed..f3b8aed488 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl @@ -44,9 +44,9 @@ parcelable PresentationPosition { */ long transmittedOctets; /* - * transmittedOctetsTimeStamp the value of CLOCK_MONOTONIC + * transmittedOctetsTimestamp the value of CLOCK_MONOTONIC * corresponding to transmittedOctets. If the software data path is * unused (e.g., for Hardware Offload), the value is set to zero. */ - TimeSpec transmittedOctetsTimeStamp; + TimeSpec transmittedOctetsTimestamp; } diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl index b588869a3d..30faae31c9 100644 --- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl +++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl @@ -27,7 +27,7 @@ enum SessionType { /** * The encoding of AVDTP media is done by HW and there is control only */ - A2DP_HARDWARE_OFFLOAD_DATAPATH, + A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH, /** * Used when encoded by Bluetooth Stack and streaming to Hearing Aid */