BT: Fix typo and improper data type

Bug: 203490261
Test: m android.hardware.bluetooth.audio-update-api
Change-Id: I366140cdaff2c42b724444dc9855d993cd502dcd
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 0000000..7c0d825
--- /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 <name>-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 84bcc0c..e5e79cb 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 @@
 @VintfStability
 interface IBluetoothAudioProvider {
   void endSession();
-  android.hardware.common.fmq.MQDescriptor<int,android.hardware.common.fmq.UnsynchronizedWrite> 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<byte,android.hardware.common.fmq.SynchronizedReadWrite> 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 bc0d97b..693392f 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 9efafca..a7224ca 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 @@
   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 c6cb5cb..2bc1791 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 @@
 @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 0c2f87d..6cfe5cd 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 @@
 @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 810a9a1..7e997e8 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 @@
 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 900ab31..72d7fb2 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 @@
 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 0000000..ec78445
--- /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 cebd808..a2c5ae9 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 @@
      *    audioConfig.pcmConfig parameter. Invalid if streaming is offloaded
      *    from/to hardware or on failure
      */
-    MQDescriptor<int, UnsynchronizedWrite> startSession(
+    MQDescriptor<byte, SynchronizedReadWrite> startSession(
             in IBluetoothAudioPort hostIf, in AudioConfiguration audioConfig);
 
     /**
@@ -63,12 +64,12 @@
      *
      * @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 fc532f4..cb12583 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 @@
     /**
      * 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 ea05820..732427f 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 @@
         ParcelableHolder extension;
     }
     @VintfStability
-    union LeaudioCodecCapabilities {
+    union LeAudioCodecCapabilities {
         Lc3Capabilities lc3Capabilities;
         VendorCapabilities vendorCapabillities;
     }
@@ -43,5 +43,5 @@
      */
     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 a212c96..515794b 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 @@
 @VintfStability
 parcelable LeAudioConfiguration {
     @VintfStability
-    union LeAuioModeConfig {
+    union LeAudioModeConfig {
         UnicastConfiguration unicastConfig;
         BroadcastConfiguration broadcastConfig;
     }
@@ -32,6 +32,6 @@
      * 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 776b777..f5d699e 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 @@
 @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 17e746f..f3b8aed 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 @@
      */
     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 b588869..30faae3 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 @@
     /**
      * 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
      */