Merge "Make VehicleHalUtils vendor available."
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 6a0cfa5..a8846b0 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -41,7 +41,12 @@
enabled: true,
},
java: {
- platform_apis: true,
+ sdk_version: "module_current",
+ min_sdk_version: "31",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.car.framework",
+ ],
},
ndk: {
vndk: {
diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
index a9797bb..7f4a777 100644
--- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
@@ -28,8 +28,7 @@
if (getDeviceName() != DeviceManager::kPrimaryDevice) {
GTEST_SKIP() << "No primary device on this factory"; // returns
}
- EXPECT_TRUE(
- DeviceManager::getInstance().reset(getFactoryName(), DeviceManager::kPrimaryDevice));
+ EXPECT_TRUE(DeviceManager::getInstance().resetPrimary(getFactoryName()));
// Must use IDevicesFactory directly because DeviceManager always uses
// the latest interfaces version and corresponding methods for opening
diff --git a/audio/core/all-versions/vts/functional/DeviceManager.h b/audio/core/all-versions/vts/functional/DeviceManager.h
index c8e0167..6bb39ed 100644
--- a/audio/core/all-versions/vts/functional/DeviceManager.h
+++ b/audio/core/all-versions/vts/functional/DeviceManager.h
@@ -96,40 +96,83 @@
}
};
-using FactoryAndDevice = std::tuple<std::string, std::string>;
-class DeviceManager : public InterfaceManager<DeviceManager, FactoryAndDevice, IDevice> {
+namespace impl {
+
+class PrimaryDeviceManager
+ : public InterfaceManager<PrimaryDeviceManager, std::string, IPrimaryDevice> {
public:
- static DeviceManager& getInstance() {
- static DeviceManager instance;
- return instance;
+ static sp<IPrimaryDevice> createInterfaceInstance(const std::string& factoryName) {
+ sp<IDevicesFactory> factory = DevicesFactoryManager::getInstance().get(factoryName);
+ return openPrimaryDevice(factory);
}
+
+ bool reset(const std::string& factoryName) __attribute__((warn_unused_result)) {
+#if MAJOR_VERSION <= 5
+ return InterfaceManager::reset(factoryName, true);
+#elif MAJOR_VERSION >= 6
+ {
+ sp<IPrimaryDevice> device = getExisting(factoryName);
+ if (device != nullptr) {
+ auto ret = device->close();
+ ALOGE_IF(!ret.isOk(), "PrimaryDevice %s close failed: %s", factoryName.c_str(),
+ ret.description().c_str());
+ }
+ }
+ return InterfaceManager::reset(factoryName, false);
+#endif
+ }
+
+ private:
+ static sp<IPrimaryDevice> openPrimaryDevice(const sp<IDevicesFactory>& factory) {
+ if (factory == nullptr) return {};
+ Result result;
+ sp<IPrimaryDevice> primaryDevice;
+#if !(MAJOR_VERSION == 7 && MINOR_VERSION == 1)
+ sp<IDevice> device;
+#if MAJOR_VERSION == 2
+ auto ret = factory->openDevice(IDevicesFactory::Device::PRIMARY, returnIn(result, device));
+ if (ret.isOk() && result == Result::OK && device != nullptr) {
+ primaryDevice = IPrimaryDevice::castFrom(device);
+ }
+#elif MAJOR_VERSION >= 4
+ auto ret = factory->openPrimaryDevice(returnIn(result, device));
+ if (ret.isOk() && result == Result::OK && device != nullptr) {
+ primaryDevice = IPrimaryDevice::castFrom(device);
+ }
+#endif
+ if (!ret.isOk() || result != Result::OK || primaryDevice == nullptr) {
+ ALOGW("Primary device can not be opened, transaction: %s, result %d, device %p",
+ ret.description().c_str(), result, device.get());
+ return nullptr;
+ }
+#else // V7.1
+ auto ret = factory->openPrimaryDevice_7_1(returnIn(result, primaryDevice));
+ if (!ret.isOk() || result != Result::OK) {
+ ALOGW("Primary device can not be opened, transaction: %s, result %d",
+ ret.description().c_str(), result);
+ return nullptr;
+ }
+#endif
+ return primaryDevice;
+ }
+};
+
+using FactoryAndDevice = std::tuple<std::string, std::string>;
+class RegularDeviceManager
+ : public InterfaceManager<RegularDeviceManager, FactoryAndDevice, IDevice> {
+ public:
static sp<IDevice> createInterfaceInstance(const FactoryAndDevice& factoryAndDevice) {
auto [factoryName, name] = factoryAndDevice;
sp<IDevicesFactory> factory = DevicesFactoryManager::getInstance().get(factoryName);
return openDevice(factory, name);
}
- using InterfaceManager::reset;
-
- static constexpr const char* kPrimaryDevice = "primary";
sp<IDevice> get(const std::string& factoryName, const std::string& name) {
- if (name == kPrimaryDevice) {
- (void)getPrimary(factoryName); // for initializing primaryDevice if needed.
- }
return InterfaceManager::get(std::make_tuple(factoryName, name));
}
- sp<IPrimaryDevice> getPrimary(const std::string& factoryName) {
- if (primaryDevice == nullptr) {
- sp<IDevicesFactory> factory = DevicesFactoryManager::getInstance().get(factoryName);
- primaryDevice = openPrimaryDevice(factory);
- }
- return primaryDevice;
- }
+
bool reset(const std::string& factoryName, const std::string& name)
__attribute__((warn_unused_result)) {
- if (name == kPrimaryDevice) {
- primaryDevice.clear();
- }
#if MAJOR_VERSION <= 5
return InterfaceManager::reset(std::make_tuple(factoryName, name), true);
#elif MAJOR_VERSION >= 6
@@ -144,9 +187,6 @@
return InterfaceManager::reset(std::make_tuple(factoryName, name), false);
#endif
}
- bool resetPrimary(const std::string& factoryName) __attribute__((warn_unused_result)) {
- return reset(factoryName, kPrimaryDevice);
- }
private:
static sp<IDevice> openDevice(const sp<IDevicesFactory>& factory, const std::string& name) {
@@ -155,9 +195,7 @@
sp<IDevice> device;
#if MAJOR_VERSION == 2
IDevicesFactory::Device dev = IDevicesFactory::IDevicesFactory::Device(-1);
- if (name == AUDIO_HARDWARE_MODULE_ID_PRIMARY) {
- dev = IDevicesFactory::Device::PRIMARY;
- } else if (name == AUDIO_HARDWARE_MODULE_ID_A2DP) {
+ if (name == AUDIO_HARDWARE_MODULE_ID_A2DP) {
dev = IDevicesFactory::Device::A2DP;
} else if (name == AUDIO_HARDWARE_MODULE_ID_USB) {
dev = IDevicesFactory::Device::USB;
@@ -179,47 +217,62 @@
}
return device;
}
+};
- static sp<IPrimaryDevice> openPrimaryDevice(const sp<IDevicesFactory>& factory) {
- if (factory == nullptr) return {};
- Result result;
- sp<IDevice> device;
- sp<IPrimaryDevice> primaryDevice;
-#if MAJOR_VERSION == 2
- auto ret = factory->openDevice(IDevicesFactory::Device::PRIMARY, returnIn(result, device));
- if (ret.isOk() && result == Result::OK && device != nullptr) {
- primaryDevice = IPrimaryDevice::castFrom(device);
+} // namespace impl
+
+class DeviceManager {
+ public:
+ static DeviceManager& getInstance() {
+ static DeviceManager instance;
+ return instance;
+ }
+
+ static constexpr const char* kPrimaryDevice = "primary";
+
+ sp<IDevice> get(const std::string& factoryName, const std::string& name) {
+ if (name == kPrimaryDevice) {
+ auto primary = getPrimary(factoryName);
+ return primary ? deviceFromPrimary(primary) : nullptr;
}
-#elif MAJOR_VERSION >= 4 && (MAJOR_VERSION < 7 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0))
- auto ret = factory->openPrimaryDevice(returnIn(result, device));
- if (ret.isOk() && result == Result::OK && device != nullptr) {
- primaryDevice = IPrimaryDevice::castFrom(device);
- }
-#elif MAJOR_VERSION == 7 && MINOR_VERSION == 1
- auto ret = factory->openPrimaryDevice_7_1(returnIn(result, primaryDevice));
- if (ret.isOk() && result == Result::OK && primaryDevice != nullptr) {
- auto getDeviceRet = primaryDevice->getDevice();
- if (getDeviceRet.isOk()) {
- device = getDeviceRet;
- } else {
- primaryDevice.clear();
- ALOGW("Primary device can not downcast, transaction: %s, primary %p",
- getDeviceRet.description().c_str(), primaryDevice.get());
- return {};
- }
- }
-#endif
- if (!ret.isOk() || result != Result::OK || device == nullptr) {
- ALOGW("Primary device can not be opened, transaction: %s, result %d, device %p",
- ret.description().c_str(), result, device.get());
- return {};
- }
- return primaryDevice;
+ return mDevices.get(factoryName, name);
+ }
+
+ sp<IPrimaryDevice> getPrimary(const std::string& factoryName) {
+ return mPrimary.get(factoryName);
+ }
+
+ bool reset(const std::string& factoryName, const std::string& name)
+ __attribute__((warn_unused_result)) {
+ return name == kPrimaryDevice ? resetPrimary(factoryName)
+ : mDevices.reset(factoryName, name);
+ }
+
+ bool resetPrimary(const std::string& factoryName) __attribute__((warn_unused_result)) {
+ return mPrimary.reset(factoryName);
+ }
+
+ static void waitForInstanceDestruction() {
+ // Does not matter which device manager to use.
+ impl::RegularDeviceManager::waitForInstanceDestruction();
}
private:
- // There can only be one primary device across all HAL modules.
- // A reference to a complete interface is used because in V7.1 IDevice can not
- // be upcasted to IPrimaryDevice.
- sp<IPrimaryDevice> primaryDevice;
+ sp<IDevice> deviceFromPrimary(const sp<IPrimaryDevice>& primary) {
+#if MAJOR_VERSION == 7 && MINOR_VERSION == 1
+ auto ret = primary->getDevice();
+ if (ret.isOk()) {
+ return ret;
+ } else {
+ ALOGW("Error retrieving IDevice from primary: transaction: %s, primary %p",
+ ret.description().c_str(), primary.get());
+ return nullptr;
+ }
+#else
+ return primary;
+#endif
+ }
+
+ impl::PrimaryDeviceManager mPrimary;
+ impl::RegularDeviceManager mDevices;
};
diff --git a/automotive/audiocontrol/aidl/Android.bp b/automotive/audiocontrol/aidl/Android.bp
index 5e69429..890d7a0 100644
--- a/automotive/audiocontrol/aidl/Android.bp
+++ b/automotive/audiocontrol/aidl/Android.bp
@@ -13,6 +13,10 @@
name: "android.hardware.automotive.audiocontrol",
vendor_available: true,
srcs: ["android/hardware/automotive/audiocontrol/*.aidl"],
+ imports: [
+ "android.hardware.audio.common",
+ "android.media.audio.common.types",
+ ],
stability: "vintf",
backend: {
java: {
@@ -24,5 +28,7 @@
],
},
},
- versions: ["1"],
+ versions: [
+ "1",
+ ],
}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
index 3dc393a..58a3667 100644
--- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioFocusChange.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 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 interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// 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 changes to the AIDL files built
+// 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
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl
similarity index 87%
copy from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
copy to automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl
index 766f637..91ce035 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -31,10 +31,10 @@
// 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="byte") @VintfStability
-enum LeAudioMode {
- UNKNOWN = 0,
- UNICAST = 1,
- BROADCAST = 2,
+package android.hardware.automotive.audiocontrol;
+@VintfStability
+parcelable AudioGainConfigInfo {
+ int zoneId;
+ String devicePortAddress;
+ int volumeIndex;
}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl
index 6d729e2..23abb46 100644
--- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/DuckingInfo.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 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 interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// 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 changes to the AIDL files built
+// 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
@@ -22,4 +38,5 @@
String[] deviceAddressesToDuck;
String[] deviceAddressesToUnduck;
String[] usagesHoldingFocus;
+ @nullable android.hardware.audio.common.PlaybackTrackMetadata[] playbackMetaDataHoldingFocus;
}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl
index bc4162b..8dc5ffe 100644
--- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioControl.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 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 interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// 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 changes to the AIDL files built
+// 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
@@ -18,10 +34,16 @@
package android.hardware.automotive.audiocontrol;
@VintfStability
interface IAudioControl {
+ /**
+ * @deprecated use {@link android.hardware.audio.common.PlaybackTrackMetadata} instead.
+ */
oneway void onAudioFocusChange(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange);
oneway void onDevicesToDuckChange(in android.hardware.automotive.audiocontrol.DuckingInfo[] duckingInfos);
oneway void onDevicesToMuteChange(in android.hardware.automotive.audiocontrol.MutingInfo[] mutingInfos);
oneway void registerFocusListener(in android.hardware.automotive.audiocontrol.IFocusListener listener);
oneway void setBalanceTowardRight(in float value);
oneway void setFadeTowardFront(in float value);
+ oneway void onAudioFocusChangeWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusChange);
+ oneway void setAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains);
+ oneway void registerGainCallback(in android.hardware.automotive.audiocontrol.IAudioGainCallback callback);
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl
similarity index 82%
copy from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
copy to automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl
index 766f637..17a087f 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -31,10 +31,8 @@
// 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="byte") @VintfStability
-enum LeAudioMode {
- UNKNOWN = 0,
- UNICAST = 1,
- BROADCAST = 2,
+package android.hardware.automotive.audiocontrol;
+@VintfStability
+interface IAudioGainCallback {
+ oneway void onAudioDeviceGainsChanged(in android.hardware.automotive.audiocontrol.Reasons[] reasons, in android.hardware.automotive.audiocontrol.AudioGainConfigInfo[] gains);
}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl
index f00f042..3e17552 100644
--- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/IFocusListener.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 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 interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// 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 changes to the AIDL files built
+// 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
@@ -20,4 +36,6 @@
interface IFocusListener {
oneway void abandonAudioFocus(in String usage, in int zoneId);
oneway void requestAudioFocus(in String usage, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain);
+ oneway void abandonAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId);
+ oneway void requestAudioFocusWithMetaData(in android.hardware.audio.common.PlaybackTrackMetadata playbackMetaData, in int zoneId, in android.hardware.automotive.audiocontrol.AudioFocusChange focusGain);
}
diff --git a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl
index ab902ec..b25ed0f 100644
--- a/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/MutingInfo.aidl
@@ -1,14 +1,30 @@
+/*
+ * Copyright (C) 2020 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 interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// 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 changes to the AIDL files built
+// 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
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl
similarity index 79%
copy from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
copy to automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl
index 766f637..c1e22d4 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/automotive/audiocontrol/aidl/aidl_api/android.hardware.automotive.audiocontrol/current/android/hardware/automotive/audiocontrol/Reasons.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -31,10 +31,17 @@
// 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="byte") @VintfStability
-enum LeAudioMode {
- UNKNOWN = 0,
- UNICAST = 1,
- BROADCAST = 2,
+package android.hardware.automotive.audiocontrol;
+@Backing(type="int") @VintfStability
+enum Reasons {
+ FORCED_MASTER_MUTE = 1,
+ REMOTE_MUTE = 2,
+ TCU_MUTE = 4,
+ ADAS_DUCKING = 8,
+ NAV_DUCKING = 16,
+ PROJECTION_DUCKING = 32,
+ THERMAL_LIMITATION = 64,
+ SUSPEND_EXIT_VOL_LIMITATION = 128,
+ EXTERNAL_AMP_VOL_FEEDBACK = 256,
+ OTHER = -2147483648,
}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl
new file mode 100644
index 0000000..68bfeab
--- /dev/null
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/AudioGainConfigInfo.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 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.automotive.audiocontrol;
+
+/**
+ * NOTE:
+ * Was expecting to reuse android.media.audio types... Limit info to minimum to prevent
+ * duplicating aidl_api. Will follow up if AudioGainConfig is exposed by android.media AIDL API.
+ */
+@VintfStability
+parcelable AudioGainConfigInfo {
+ /**
+ * The identifier for the audio zone the audio device port associated to this gain belongs to.
+ *
+ */
+ int zoneId;
+
+ /**
+ * The Audio Output Device Port Address.
+ *
+ * This is the address that can be retrieved at JAVA layer using the introspection
+ * {@link android.media.AudioManager#listAudioDevicePorts} API then
+ * {@link audio.media.AudioDeviceInfo#getAddress} API.
+ *
+ * At HAL layer, it corresponds to audio_port_v7.audio_port_device_ext.address.
+ *
+ * Devices that does not have an address will indicate an empty string "".
+ */
+ String devicePortAddress;
+
+ /**
+ * UI Index of the corresponding AudioGain in AudioPort.gains.
+ */
+ int volumeIndex;
+}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl
index e95fe9b..513af47 100644
--- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/DuckingInfo.aidl
@@ -14,41 +14,51 @@
* limitations under the License.
*/
- package android.hardware.automotive.audiocontrol;
+package android.hardware.automotive.audiocontrol;
- /**
- * The current ducking information for a single audio zone.
- *
- * <p>This includes devices to duck, as well as unduck based on the contents of a previous
- * {@link DuckingInfo}. Additionally, the current usages holding focus in the specified zone are
- * included, which were used to determine which addresses to duck.
- */
- @VintfStability
- parcelable DuckingInfo {
- /**
- * ID of the associated audio zone
- */
- int zoneId;
+import android.hardware.audio.common.PlaybackTrackMetadata;
- /**
- * List of addresses for audio output devices that should be ducked.
- *
- * <p>The provided address strings are defined in audio_policy_configuration.xml.
- */
- String[] deviceAddressesToDuck;
+/**
+ * The current ducking information for a single audio zone.
+ *
+ * <p>This includes devices to duck, as well as unduck based on the contents of a previous
+ * {@link DuckingInfo}. Additionally, the current usages holding focus in the specified zone are
+ * included, which were used to determine which addresses to duck.
+ */
+@VintfStability
+parcelable DuckingInfo {
+ /**
+ * ID of the associated audio zone
+ */
+ int zoneId;
- /**
- * List of addresses for audio output devices that were previously be ducked and should now be
- * unducked.
- *
- * <p>The provided address strings are defined in audio_policy_configuration.xml.
- */
- String[] deviceAddressesToUnduck;
+ /**
+ * List of addresses for audio output devices that should be ducked.
+ *
+ * <p>The provided address strings are defined in audio_policy_configuration.xml.
+ */
+ String[] deviceAddressesToDuck;
- /**
- * List of usages currently holding focus for this audio zone.
- *
- * <p> See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
- */
- String[] usagesHoldingFocus;
- }
\ No newline at end of file
+ /**
+ * List of addresses for audio output devices that were previously be ducked and should now be
+ * unducked.
+ *
+ * <p>The provided address strings are defined in audio_policy_configuration.xml.
+ */
+ String[] deviceAddressesToUnduck;
+
+ /**
+ * List of usages currently holding focus for this audio zone.
+ *
+ * This field was deprecated in version 2.
+ * Use playbackMetaDataHoldingFocus instead.
+ *
+ * <p> See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
+ */
+ String[] usagesHoldingFocus;
+
+ /**
+ * List of output stream metadata associated with the current focus holder for this audio zone
+ */
+ @nullable PlaybackTrackMetadata[] playbackMetaDataHoldingFocus;
+}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl
index 3a02245..0ffcd5e 100644
--- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioControl.aidl
@@ -16,10 +16,43 @@
package android.hardware.automotive.audiocontrol;
+/**
+ * Important note on Metadata:
+ * Metadata qualifies a playback track for an output stream.
+ * This is highly closed to {@link android.media.AudioAttributes}.
+ * It allows to identify the audio stream rendered / requesting / abandonning the focus.
+ *
+ * AudioControl 1.0 was limited to identification through {@code AttributeUsage} listed as
+ * {@code audioUsage} in audio_policy_configuration.xsd.
+ *
+ * Any new OEM needs would not be possible without extension.
+ *
+ * Relying on {@link android.hardware.automotive.audiocontrol.PlaybackTrackMetadata} allows
+ * to use a combination of {@code AttributeUsage}, {@code AttributeContentType} and
+ * {@code AttributeTags} to identify the use case / routing thanks to
+ * {@link android.media.audiopolicy.AudioProductStrategy}.
+ * The belonging to a strategy is deduced by an AOSP logic (in sync at native and java layer).
+ *
+ * IMPORTANT NOTE ON TAGS:
+ * To limit the possibilies and prevent from confusion, we expect the String to follow
+ * a given formalism that will be enforced.
+ *
+ * 1 / By convention, tags shall be a "key=value" pair.
+ * Vendor must namespace their tag's key (for example com.google.strategy=VR) to avoid conflicts.
+ * vendor specific applications and must be prefixed by "VX_". Vendor must
+ *
+ * 2 / Tags reported here shall be the same as the tags used to define a given
+ * {@link android.media.audiopolicy.AudioProductStrategy} and so in
+ * audio_policy_engine_configuration.xml file.
+ */
+import android.hardware.audio.common.PlaybackTrackMetadata;
import android.hardware.automotive.audiocontrol.AudioFocusChange;
+import android.hardware.automotive.audiocontrol.AudioGainConfigInfo;
import android.hardware.automotive.audiocontrol.DuckingInfo;
-import android.hardware.automotive.audiocontrol.MutingInfo;
+import android.hardware.automotive.audiocontrol.IAudioGainCallback;
import android.hardware.automotive.audiocontrol.IFocusListener;
+import android.hardware.automotive.audiocontrol.MutingInfo;
+import android.hardware.automotive.audiocontrol.Reasons;
/**
* Interacts with the car's audio subsystem to manage audio sources and volumes
@@ -36,8 +69,12 @@
* The HAL is not required to wait for an callback of AUDIOFOCUS_GAIN before playing audio, nor
* is it required to stop playing audio in the event of a AUDIOFOCUS_LOSS callback is received.
*
+ * This method was deprecated in version 2 to allow getting rid of usages limitation.
+ * Use {@link IAudioControl#onAudioFocusChangeWithMetaData} instead.
+ *
* @param usage The audio usage associated with the focus change {@code AttributeUsage}. See
* {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
+ * @deprecated use {@link android.hardware.audio.common.PlaybackTrackMetadata} instead.
* @param zoneId The identifier for the audio zone that the HAL is playing the stream in
* @param focusChange the AudioFocusChange that has occurred.
*/
@@ -52,19 +89,19 @@
* @param duckingInfos an array of {@link DuckingInfo} objects for the audio zones where audio
* focus has changed.
*/
- oneway void onDevicesToDuckChange(in DuckingInfo[] duckingInfos);
+ oneway void onDevicesToDuckChange(in DuckingInfo[] duckingInfos);
- /**
- * Notifies HAL of changes in output devices that the HAL should apply muting to.
- *
- * This will be called in response to changes in audio mute state for each volume group
- * and will include a {@link MutingInfo} object per audio zone that experienced a mute state
- * event.
- *
- * @param mutingInfos an array of {@link MutingInfo} objects for the audio zones where audio
- * mute state has changed.
- */
- oneway void onDevicesToMuteChange(in MutingInfo[] mutingInfos);
+ /**
+ * Notifies HAL of changes in output devices that the HAL should apply muting to.
+ *
+ * This will be called in response to changes in audio mute state for each volume group
+ * and will include a {@link MutingInfo} object per audio zone that experienced a mute state
+ * event.
+ *
+ * @param mutingInfos an array of {@link MutingInfo} objects for the audio zones where audio
+ * mute state has changed.
+ */
+ oneway void onDevicesToMuteChange(in MutingInfo[] mutingInfos);
/**
* Registers focus listener to be used by HAL for requesting and abandoning audio focus.
@@ -99,4 +136,51 @@
* range.
*/
oneway void setFadeTowardFront(in float value);
-}
\ No newline at end of file
+
+ /**
+ * Notifies HAL of changes in audio focus status for focuses requested or abandoned by the HAL.
+ *
+ * This will be called in response to IFocusListener's requestAudioFocus and
+ * abandonAudioFocus, as well as part of any change in focus being held by the HAL due focus
+ * request from other activities or services.
+ *
+ * The HAL is not required to wait for an callback of AUDIOFOCUS_GAIN before playing audio, nor
+ * is it required to stop playing audio in the event of a AUDIOFOCUS_LOSS callback is received.
+ *
+ * @param playbackMetaData The output stream metadata associated with the focus request
+ * @param zoneId The identifier for the audio zone that the HAL is playing the stream in
+ * @param focusChange the AudioFocusChange that has occurred.
+ */
+ oneway void onAudioFocusChangeWithMetaData(in PlaybackTrackMetadata playbackMetaData,
+ in int zoneId, in AudioFocusChange focusChange);
+
+ /**
+ * Notifies HAL of changes in output devices that the HAL should apply gain change to
+ * and the reason(s) why
+ *
+ * This may be called in response to changes in audio focus, and will include a list of
+ * {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo} objects per audio zone
+ * that experienced a change in audo focus.
+ *
+ * @param reasons List of reasons that triggered the given gains changed.
+ * This must be one or more of the
+ * {@link android.hardware.automotive.audiocontrol.Reasons} constants.
+ *
+ * @param gains List of gains the change is intended to.
+ */
+ oneway void setAudioDeviceGainsChanged(in Reasons[] reasons, in AudioGainConfigInfo[] gains);
+
+ /**
+ * Registers callback to be used by HAL for reporting unexpected gain(s) changed and the
+ * reason(s) why.
+ *
+ * It is expected that there will only ever be a single callback registered. If the
+ * observer dies, the HAL implementation must unregister observer automatically. If called when
+ * a listener is already registered, the existing one should be unregistered and replaced with
+ * the new callback.
+ *
+ * @param callback The {@link android.hardware.automotive.audiocontrol.IAudioGainCallback}
+ * interface.
+ */
+ oneway void registerGainCallback(in IAudioGainCallback callback);
+}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl
new file mode 100644
index 0000000..17b4341
--- /dev/null
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IAudioGainCallback.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2022 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.automotive.audiocontrol;
+
+import android.hardware.automotive.audiocontrol.AudioGainConfigInfo;
+import android.hardware.automotive.audiocontrol.Reasons;
+
+/**
+ * Interface definition for a callback to be invoked when the gain(s) of the device port(s) is(are)
+ * updated at HAL layer.
+ *
+ * <p>This defines counter part API of
+ * {@link android.hardware.automotive.audiocontrol.IAudioControl#onDevicesToDuckChange},
+ * {@link android.hardware.automotive.audiocontrol.IAudioControl#onDevicesToMuteChange} and
+ * {@link android.hardware.automotive.audiocontrol.IAudioControl#setAudioDeviceGainsChanged} APIs.
+ *
+ * The previous API defines Mute/Duck order decided by the client (e.g. CarAudioService)
+ * and delegated to AudioControl for application.
+ *
+ * This callback interface defines Mute/Duck notification decided by AudioControl HAL (due to
+ * e.g. - external conditions from Android IVI subsystem
+ * - regulation / need faster decision rather than using
+ * {@link android.hardware.automotive.audiocontrol.IAudioControl#onAudioFocusChange} to
+ * report the use case and then waiting for CarAudioService decision to Mute/Duck.
+ */
+@VintfStability
+oneway interface IAudioGainCallback {
+ /**
+ * Used to indicated the one or more audio device port gains have changed unexpectidely, i.e.
+ * initiated by HAL, not by CarAudioService.
+ * This is the counter part of the
+ * {@link android.hardware.automotive.audiocontrol.onDevicesToDuckChange},
+ * {@link android.hardware.automotive.audiocontrol.onDevicesToMuteChange} and
+ * {@link android.hardware.automotive.audiocontrol.setAudioDeviceGainsChanged} APIs.
+ *
+ * Flexibility is given to OEM to mute/duck in HAL or in CarAudioService.
+ * For critical use cases (i.e. when regulation is required), better to handle mute/duck in
+ * HAL layer and informs upper layer.
+ * Non critical use case may report gain and focus and CarAudioService to decide of duck/mute.
+ *
+ * @param reasons List of reasons that triggered the given gains changed.
+ * This must be one or more of the
+ * {@link android.hardware.automotive.audiocontrol.Reasons} constants.
+ * It will define if the port has been muted/ducked or must now affected
+ * by gain limitation that shall be notified/enforced at CarAudioService
+ * layer.
+ *
+ * @param gains List of gains affected by the change.
+ */
+ void onAudioDeviceGainsChanged(in Reasons[] reasons, in AudioGainConfigInfo[] gains);
+}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl
index b79295a..ac9ac01 100644
--- a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/IFocusListener.aidl
@@ -16,12 +16,14 @@
package android.hardware.automotive.audiocontrol;
+import android.hardware.audio.common.PlaybackTrackMetadata;
import android.hardware.automotive.audiocontrol.AudioFocusChange;
/**
* Callback interface for audio focus listener.
*
* For typical configuration, the listener the car audio service.
+ *
*/
@VintfStability
interface IFocusListener {
@@ -33,6 +35,9 @@
* interaction is oneway to avoid blocking HAL so that it is not required to wait for a response
* before stopping audio playback.
*
+ * Deprecated in version 2 to allow generic interface callback listener.
+ * Use {@link IFocusListener#abandonHalAudioFocusWithMetaData} instead.
+ *
* @param usage The audio usage for which the HAL is abandoning focus {@code AttributeUsage}.
* See {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
* @param zoneId The identifier for the audio zone that the HAL abandoning focus
@@ -47,6 +52,9 @@
* interaction is oneway to avoid blocking HAL so that it is not required to wait for a response
* before playing audio.
*
+ * Deprecated in version 2 to allow generic interface callback listener.
+ * Use {@link IFocusListener#requestAudioFocusWithMetaData} instead.
+ *
* @param usage The audio usage associated with the focus request {@code AttributeUsage}. See
* {@code audioUsage} in audio_policy_configuration.xsd for the list of allowed values.
* @param zoneId The identifier for the audio zone where the HAL is requesting focus
@@ -54,4 +62,29 @@
* following: GAIN, GAIN_TRANSIENT, GAIN_TRANSIENT_MAY_DUCK, GAIN_TRANSIENT_EXCLUSIVE.
*/
oneway void requestAudioFocus(in String usage, in int zoneId, in AudioFocusChange focusGain);
-}
\ No newline at end of file
+
+ /**
+ * Used to indicate that the audio output stream associated with
+ * {@link android.hardware.audio.common.PlaybackTrackMetadata} has released
+ * the focus.
+ *
+ * @param playbackMetaData The output stream metadata associated with the focus request
+ * @param zoneId The identifier for the audio zone that the HAL abandoning focus
+ */
+ oneway void abandonAudioFocusWithMetaData(
+ in PlaybackTrackMetadata playbackMetaData, in int zoneId);
+
+ /**
+ * Used to indicate that the audio output stream associated with
+ * {@link android.hardware.audio.common.PlaybackTrackMetadata} has taken the focus.
+ *
+ * @param playbackMetaData The output stream metadata associated with the focus request
+ * @param zoneId The identifier for the audio zone that the HAL abandoning focus
+ * @param focusGain The focus type requested.
+ * This must be one of the
+ * {@link android.hardware.automotive.audiocontrol.AudioFocusChange}
+ * constants.
+ */
+ oneway void requestAudioFocusWithMetaData(in PlaybackTrackMetadata playbackMetaData,
+ in int zoneId, in AudioFocusChange focusGain);
+}
diff --git a/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl
new file mode 100644
index 0000000..860bf01
--- /dev/null
+++ b/automotive/audiocontrol/aidl/android/hardware/automotive/audiocontrol/Reasons.aidl
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2022 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.automotive.audiocontrol;
+
+/**
+ * Enum to identify the reason(s) of
+ * {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo} changed event
+ */
+@Backing(type="int")
+@VintfStability
+enum Reasons {
+ /**
+ * Magic Key Code (may be SWRC button combination) to force muting all audio sources.
+ * This may be used for example in case of cyber attach to ensure driver can safely drive back
+ * to garage to restore sw.
+ */
+ FORCED_MASTER_MUTE = 0x1,
+ /**
+ * Reports a mute request outside the IVI (Android) system.
+ * It may target to mute the list of
+ * {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo}.
+ * A focus request may also be reported in addition if the use case that initiates the mute
+ * has matching {@link android.hardware.automotive.audiocontrol.PlaybackTrackMetadata}
+ * For regulation issue, the action of mute could be managed by HAL itself.
+ */
+ REMOTE_MUTE = 0x2,
+ /**
+ * Reports a mute initiated by the TCU. It may be applied to all audio source (no
+ * associated {@link android.hardware.automotive.audiocontrol.AudioGainConfigInfo} reported, or
+ * it may target to mute only the given list of ports.
+ * A focus request may also be reported in addition.
+ * For regulation issue, the action of mute could be managed by HAL itself.
+ */
+ TCU_MUTE = 0x4,
+ /**
+ * Reports a duck due to ADAS use case. A focus request may also be reported in addition.
+ * For regulation issue, the action of duck could be managed by HAL itself.
+ * It gives a chance to CarAudioService to decide whether contextual volume change may be
+ * applied from the ducked index base or not.
+ */
+ ADAS_DUCKING = 0x8,
+ /**
+ * Reports a duck due to navigation use case. It gives a chance to CarAudioService to decide
+ * whether contextual volume change may be applied from the ducked index base or not.
+ */
+ NAV_DUCKING = 0x10,
+ /**
+ * Some device projection stack may send signal to IVI to duck / unduck main audio stream.
+ * In this case, Contextual Volume Policy may be adapted to control the alternate / secondary
+ * audio stream.
+ */
+ PROJECTION_DUCKING = 0x20,
+ /**
+ * When the amplifier is overheating, it may be recovered by limiting the volume.
+ */
+ THERMAL_LIMITATION = 0x40,
+ /**
+ * Before the system enters suspend, it may ensure while exiting suspend or during cold boot
+ * that the volume is limited to prevent from sound explosion.
+ */
+ SUSPEND_EXIT_VOL_LIMITATION = 0x80,
+ /**
+ * When using an external amplifier, it may be required to keep volume in sync and have
+ * asynchronous notification of effective volume change.
+ */
+ EXTERNAL_AMP_VOL_FEEDBACK = 0x100,
+ /**
+ * For other OEM use.
+ */
+ OTHER = 0x80000000,
+}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
index 3a6461e..9d1cb8f 100644
--- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
@@ -36,6 +36,6 @@
parcelable OperationContext {
int id = 0;
android.hardware.biometrics.common.OperationReason reason = android.hardware.biometrics.common.OperationReason.UNKNOWN;
- boolean isAoD = false;
+ boolean isAod = false;
boolean isCrypto = false;
}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
index 390e698..72fe660 100644
--- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
@@ -41,8 +41,8 @@
*/
OperationReason reason = OperationReason.UNKNOWN;
- /* Flag indicating that the display is in AoD mode. */
- boolean isAoD = false;
+ /* Flag indicating that the display is in AOD mode. */
+ boolean isAod = false;
/** Flag indicating that crypto was requested. */
boolean isCrypto = false;
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl
index e383330..43db6cf 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl
@@ -34,10 +34,13 @@
package android.hardware.biometrics.fingerprint;
@VintfStability
parcelable PointerContext {
- int pointerId = 0;
- int x = 0;
- int y = 0;
+ int pointerId = -1;
+ float x = 0.000000f;
+ float y = 0.000000f;
float minor = 0.000000f;
float major = 0.000000f;
- boolean isAoD = false;
+ float orientation = 0.000000f;
+ boolean isAod = false;
+ long time = 0;
+ long gestureStart = 0;
}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl
index 4975175..e025d34 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/PointerContext.aidl
@@ -21,14 +21,35 @@
*/
@VintfStability
parcelable PointerContext {
- /* See android.view.MotionEvent#getPointerId. */
- int pointerId = 0;
+ /**
+ * Pointer ID obtained from MotionEvent#getPointerId or -1 if the ID cannot be obtained, for
+ * example if this event originated from a low-level wake-up gesture.
+ *
+ * See android.view.MotionEvent#getPointerId.
+ */
+ int pointerId = -1;
- /* The distance in pixels from the left edge of the display. */
- int x = 0;
+ /**
+ * The distance in pixels from the left edge of the display.
+ *
+ * This is obtained from MotionEvent#getRawX and translated relative to Surface#ROTATION_0.
+ * Meaning, this value is always reported as if the device is in its natural (e.g. portrait)
+ * orientation.
+ *
+ * See android.view.MotionEvent#getRawX.
+ */
+ float x = 0f;
- /* The distance in pixels from the top edge of the display. */
- int y = 0;
+ /**
+ * The distance in pixels from the top edge of the display.
+ *
+ * This is obtained from MotionEvent#getRawY and translated relative to Surface#ROTATION_0.
+ * Meaning, this value is always reported as if the device is in its natural (e.g. portrait)
+ * orientation.
+ *
+ * See android.view.MotionEvent#getRawY.
+ */
+ float y = 0f;
/* See android.view.MotionEvent#getTouchMinor. */
float minor = 0f;
@@ -36,6 +57,32 @@
/* See android.view.MotionEvent#getTouchMajor. */
float major = 0f;
- /* Flag indicating that the display is in AoD mode. */
- boolean isAoD = false;
+ /* See android.view.MotionEvent#getOrientation. */
+ float orientation = 0f;
+
+ /* Flag indicating that the display is in AOD mode. */
+ boolean isAod = false;
+
+ /**
+ * The time of the user interaction that produced this event, in milliseconds.
+ *
+ * This is obtained from MotionEvent#getEventTime, which uses SystemClock.uptimeMillis() as
+ * the clock.
+ *
+ * See android.view.MotionEvent#getEventTime
+ */
+ long time = 0;
+
+ /**
+ * The time of the first user interaction in this gesture, in milliseconds.
+ *
+ * If this event is MotionEvent#ACTION_DOWN, it means it's the first event in this gesture,
+ * and `gestureStart` will be equal to `time`.
+ *
+ * This is obtained from MotionEvent#getDownTime, which uses SystemClock.uptimeMillis() as
+ * the clock.
+ *
+ * See android.view.MotionEvent#getDownTime
+ */
+ long gestureStart = 0;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl
index 50b54c3..3abfb31 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl
@@ -37,4 +37,5 @@
android.hardware.bluetooth.audio.PcmConfiguration pcmConfig;
android.hardware.bluetooth.audio.CodecConfiguration a2dpConfig;
android.hardware.bluetooth.audio.LeAudioConfiguration leAudioConfig;
+ android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration leAudioBroadcastConfig;
}
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
index 7c0d825..c20c057 100644
--- 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
@@ -38,4 +38,5 @@
SUCCESS = 1,
UNSUPPORTED_CODEC_CONFIGURATION = 2,
FAILURE = 3,
+ RECONFIGURATION = 4,
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl
similarity index 90%
rename from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
rename to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl
index 5fa3926..7d53b0c 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl
@@ -33,8 +33,9 @@
package android.hardware.bluetooth.audio;
@VintfStability
-parcelable BroadcastConfiguration {
- android.hardware.bluetooth.audio.BroadcastConfiguration.BroadcastStreamMap[] streamMap;
+parcelable LeAudioBroadcastConfiguration {
+ android.hardware.bluetooth.audio.CodecType codecType;
+ android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration.BroadcastStreamMap[] streamMap;
@VintfStability
parcelable BroadcastStreamMap {
char streamHandle;
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 2bc1791..edb6795 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
@@ -34,12 +34,13 @@
package android.hardware.bluetooth.audio;
@VintfStability
parcelable LeAudioConfiguration {
- android.hardware.bluetooth.audio.LeAudioMode mode;
- android.hardware.bluetooth.audio.LeAudioConfiguration.LeAudioModeConfig modeConfig;
android.hardware.bluetooth.audio.CodecType codecType;
+ android.hardware.bluetooth.audio.LeAudioConfiguration.StreamMap[] streamMap;
+ int peerDelayUs;
+ android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig;
@VintfStability
- union LeAudioModeConfig {
- android.hardware.bluetooth.audio.UnicastConfiguration unicastConfig;
- android.hardware.bluetooth.audio.BroadcastConfiguration broadcastConfig;
+ parcelable StreamMap {
+ char streamHandle;
+ int audioChannelAllocation;
}
}
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 72d7fb2..baec9c2 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
@@ -42,4 +42,6 @@
LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5,
LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 6,
LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH = 7,
+ LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH = 8,
+ LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 9,
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl
deleted file mode 100644
index b385763..0000000
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastConfiguration.aidl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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;
-@VintfStability
-parcelable UnicastConfiguration {
- android.hardware.bluetooth.audio.UnicastConfiguration.UnicastStreamMap[] streamMap;
- int peerDelay;
- android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig;
- @VintfStability
- parcelable UnicastStreamMap {
- char streamHandle;
- int audioChannelAllocation;
- }
-}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
index 81b41dc..a06337e 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
@@ -17,6 +17,7 @@
package android.hardware.bluetooth.audio;
import android.hardware.bluetooth.audio.CodecConfiguration;
+import android.hardware.bluetooth.audio.LeAudioBroadcastConfiguration;
import android.hardware.bluetooth.audio.LeAudioConfiguration;
import android.hardware.bluetooth.audio.PcmConfiguration;
@@ -28,4 +29,5 @@
PcmConfiguration pcmConfig;
CodecConfiguration a2dpConfig;
LeAudioConfiguration leAudioConfig;
+ LeAudioBroadcastConfiguration leAudioBroadcastConfig;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
index ec78445..9ddafe9 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
@@ -23,5 +23,6 @@
SUCCESS = 1,
UNSUPPORTED_CODEC_CONFIGURATION = 2,
// General failure
- FAILURE = 3
+ FAILURE = 3,
+ RECONFIGURATION = 4,
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index cb63f88..f1301fb 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
@@ -19,7 +19,6 @@
import android.hardware.bluetooth.audio.AudioLocation;
import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.Lc3Capabilities;
-import android.hardware.bluetooth.audio.LeAudioMode;
/**
* Used to specify the le audio broadcast codec capabilities for hardware offload.
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl
similarity index 87%
rename from bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
rename to bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl
index cfc9d3a..e9a1a0c 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioBroadcastConfiguration.aidl
@@ -16,14 +16,15 @@
package android.hardware.bluetooth.audio;
+import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.LeAudioCodecConfiguration;
@VintfStability
-parcelable BroadcastConfiguration {
+parcelable LeAudioBroadcastConfiguration {
@VintfStability
parcelable BroadcastStreamMap {
/*
- * The connection handle used for a unicast or a broadcast group.
+ * The connection handle used for a broadcast group.
* Range: 0x0000 to 0xEFFF
*/
char streamHandle;
@@ -35,5 +36,6 @@
int audioChannelAllocation;
LeAudioCodecConfiguration leAudioCodecConfig;
}
+ CodecType codecType;
BroadcastStreamMap[] streamMap;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
index 515794b..0d1e3de 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
@@ -16,22 +16,28 @@
package android.hardware.bluetooth.audio;
-import android.hardware.bluetooth.audio.BroadcastConfiguration;
import android.hardware.bluetooth.audio.CodecType;
-import android.hardware.bluetooth.audio.LeAudioMode;
-import android.hardware.bluetooth.audio.UnicastConfiguration;
+import android.hardware.bluetooth.audio.LeAudioCodecConfiguration;
@VintfStability
parcelable LeAudioConfiguration {
@VintfStability
- union LeAudioModeConfig {
- UnicastConfiguration unicastConfig;
- BroadcastConfiguration broadcastConfig;
+ parcelable StreamMap {
+ /*
+ * The connection handle used for a unicast group.
+ * Range: 0x0000 to 0xEFFF
+ */
+ char streamHandle;
+ /*
+ * Audio channel allocation is a bit field, each enabled bit means that given audio
+ * direction, i.e. "left", or "right" is used. Ordering of audio channels comes from the
+ * least significant bit to the most significant bit. The valus follows the Bluetooth SIG
+ * Audio Location assigned number.
+ */
+ int audioChannelAllocation;
}
- /*
- * The mode of the LE audio
- */
- LeAudioMode mode;
- LeAudioModeConfig modeConfig;
CodecType codecType;
+ StreamMap[] streamMap;
+ int peerDelayUs;
+ LeAudioCodecConfiguration leAudioCodecConfig;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
index 30faae3..95beee7 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
@@ -33,19 +33,33 @@
*/
HEARING_AID_SOFTWARE_ENCODING_DATAPATH,
/**
- * Used when encoded by Bluetooth Stack and streaming to LE Audio device
+ * Used when audio is encoded by the Bluetooth Stack and is streamed to LE
+ * Audio unicast device.
*/
LE_AUDIO_SOFTWARE_ENCODING_DATAPATH,
/**
- * Used when decoded by Bluetooth Stack and streaming to audio framework
+ * Used when audio is decoded by the Bluetooth Stack and is streamed to LE
+ * Audio unicast device.
*/
LE_AUDIO_SOFTWARE_DECODING_DATAPATH,
/**
- * Encoding is done by HW an there is control only
+ * Used when audio is encoded by hardware offload and is streamed to LE
+ * Audio unicast device. This is a control path only.
*/
LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH,
/**
- * Decoding is done by HW an there is control only
+ * Used when audio is decoded by hardware offload and is streamed to LE
+ * Audio unicast device. This is a control path only.
*/
LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH,
+ /**
+ * Used when audio is encoded by the Bluetooth stack and is streamed to LE
+ * Audio broadcast channels.
+ */
+ LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH,
+ /**
+ * Used when audio is encoded by hardware offload and is streamed to LE
+ * Audio broadcast channels. This is a control path only.
+ */
+ LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH,
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
index cd8a4c1..f8a924a 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -19,7 +19,6 @@
import android.hardware.bluetooth.audio.AudioLocation;
import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.Lc3Capabilities;
-import android.hardware.bluetooth.audio.LeAudioMode;
/**
* Used to specify the le audio unicast codec capabilities for hardware offload.
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl
deleted file mode 100644
index 7be2c5b..0000000
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastConfiguration.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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;
-
-import android.hardware.bluetooth.audio.LeAudioCodecConfiguration;
-
-@VintfStability
-parcelable UnicastConfiguration {
- @VintfStability
- parcelable UnicastStreamMap {
- /*
- * The connection handle used for a unicast or a broadcast group.
- * Range: 0x0000 to 0xEFFF
- */
- char streamHandle;
- /*
- * Audio channel allocation is a bit field, each enabled bit means that given audio
- * direction, i.e. "left", or "right" is used. Ordering of audio channels comes from the
- * least significant bit to the most significant bit. The valus follows the Bluetooth SIG
- * Audio Location assigned number.
- */
- int audioChannelAllocation;
- }
- UnicastStreamMap[] streamMap;
- int peerDelay;
- LeAudioCodecConfiguration leAudioCodecConfig;
-}
diff --git a/bluetooth/audio/aidl/default/Android.bp b/bluetooth/audio/aidl/default/Android.bp
index fc882d4..13a5440 100644
--- a/bluetooth/audio/aidl/default/Android.bp
+++ b/bluetooth/audio/aidl/default/Android.bp
@@ -19,6 +19,7 @@
"HearingAidAudioProvider.cpp",
"LeAudioOffloadAudioProvider.cpp",
"LeAudioSoftwareAudioProvider.cpp",
+ "service.cpp",
],
export_include_dirs: ["."],
header_libs: ["libhardware_headers"],
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp b/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp
index 1e55a0b..1e1680a 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp
@@ -64,6 +64,14 @@
case SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH:
provider = ndk::SharedRefBase::make<LeAudioOffloadInputAudioProvider>();
break;
+ case SessionType::LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH:
+ provider =
+ ndk::SharedRefBase::make<LeAudioSoftwareBroadcastAudioProvider>();
+ break;
+ case SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH:
+ provider =
+ ndk::SharedRefBase::make<LeAudioOffloadBroadcastAudioProvider>();
+ break;
default:
provider = nullptr;
break;
@@ -93,7 +101,10 @@
} else if (session_type ==
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
session_type ==
- SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH ||
+ session_type ==
+ SessionType::
+ LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
std::vector<LeAudioCodecCapabilitiesSetting> db_codec_capabilities =
BluetoothAudioCodecs::GetLeAudioOffloadCodecCapabilities(session_type);
if (db_codec_capabilities.size()) {
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
index 72ac9bd..7a28513 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
@@ -38,6 +38,12 @@
session_type_ = SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH;
}
+LeAudioOffloadBroadcastAudioProvider::LeAudioOffloadBroadcastAudioProvider()
+ : LeAudioOffloadAudioProvider() {
+ session_type_ =
+ SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH;
+}
+
LeAudioOffloadAudioProvider::LeAudioOffloadAudioProvider()
: BluetoothAudioProvider() {}
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
index a27a2e7..6509a9e 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
@@ -48,6 +48,12 @@
LeAudioOffloadInputAudioProvider();
};
+class LeAudioOffloadBroadcastAudioProvider
+ : public LeAudioOffloadAudioProvider {
+ public:
+ LeAudioOffloadBroadcastAudioProvider();
+};
+
} // namespace audio
} // namespace bluetooth
} // namespace hardware
diff --git a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
index 67b7d60..0fe205e 100644
--- a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
@@ -55,6 +55,11 @@
session_type_ = SessionType::LE_AUDIO_SOFTWARE_DECODING_DATAPATH;
}
+LeAudioSoftwareBroadcastAudioProvider::LeAudioSoftwareBroadcastAudioProvider()
+ : LeAudioSoftwareAudioProvider() {
+ session_type_ = SessionType::LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH;
+}
+
LeAudioSoftwareAudioProvider::LeAudioSoftwareAudioProvider()
: BluetoothAudioProvider(), data_mq_(nullptr) {}
@@ -78,7 +83,9 @@
}
uint32_t buffer_modifier = 0;
- if (session_type_ == SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH)
+ if (session_type_ == SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH ||
+ session_type_ ==
+ SessionType::LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH)
buffer_modifier = kBufferOutCount;
else if (session_type_ == SessionType::LE_AUDIO_SOFTWARE_DECODING_DATAPATH)
buffer_modifier = kBufferInCount;
diff --git a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.h b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.h
index fa58182..ace4bff 100644
--- a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.h
+++ b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.h
@@ -51,6 +51,12 @@
LeAudioSoftwareInputAudioProvider();
};
+class LeAudioSoftwareBroadcastAudioProvider
+ : public LeAudioSoftwareAudioProvider {
+ public:
+ LeAudioSoftwareBroadcastAudioProvider();
+};
+
} // namespace audio
} // namespace bluetooth
} // namespace hardware
diff --git a/bluetooth/audio/aidl/default/service.cpp b/bluetooth/audio/aidl/default/service.cpp
new file mode 100644
index 0000000..f8f9cde
--- /dev/null
+++ b/bluetooth/audio/aidl/default/service.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#define LOG_TAG "BtAudioAIDLService"
+
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <utils/Log.h>
+
+#include "BluetoothAudioProviderFactory.h"
+
+using ::aidl::android::hardware::bluetooth::audio::
+ BluetoothAudioProviderFactory;
+
+extern "C" __attribute__((visibility("default"))) binder_status_t
+createIBluetoothAudioProviderFactory() {
+ auto factory = ::ndk::SharedRefBase::make<BluetoothAudioProviderFactory>();
+ const std::string instance_name =
+ std::string() + BluetoothAudioProviderFactory::descriptor + "/default";
+ binder_status_t aidl_status = AServiceManager_addService(
+ factory->asBinder().get(), instance_name.c_str());
+ ALOGW_IF(aidl_status != STATUS_OK, "Could not register %s, status=%d",
+ instance_name.c_str(), aidl_status);
+ return aidl_status;
+}
\ No newline at end of file
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
index a8d8817..a6fd798 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
@@ -132,9 +132,13 @@
// Stores the supported setting of audio location, connected device, and the
// channel count for each device
std::vector<std::tuple<AudioLocation, uint8_t, uint8_t>>
- supportedDeviceSetting = {std::make_tuple(stereoAudio, 2, 1),
- std::make_tuple(monoAudio, 1, 2),
- std::make_tuple(monoAudio, 1, 1)};
+ supportedDeviceSetting = {
+ // Stereo, two connected device, one for L one for R
+ std::make_tuple(stereoAudio, 2, 1),
+ // Stereo, one connected device for both L and R
+ std::make_tuple(stereoAudio, 1, 2),
+ // Mono
+ std::make_tuple(monoAudio, 1, 1)};
template <class T>
bool BluetoothAudioCodecs::ContainedInVector(
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index 96cd9ef..dd29011 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -94,6 +94,8 @@
case SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH:
case SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH:
return AudioConfiguration(LeAudioConfiguration{});
+ case SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH:
+ return AudioConfiguration(LeAudioBroadcastConfiguration{});
default:
return AudioConfiguration(PcmConfiguration{});
}
@@ -137,6 +139,8 @@
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
session_type_ ==
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH ||
+ session_type_ ==
+ SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
(data_mq_ != nullptr && data_mq_->isValid()));
return stack_iface_ != nullptr && is_mq_valid && audio_config_ != nullptr;
}
@@ -259,7 +263,9 @@
(session_type_ == SessionType::A2DP_SOFTWARE_ENCODING_DATAPATH ||
session_type_ == SessionType::HEARING_AID_SOFTWARE_ENCODING_DATAPATH ||
session_type_ == SessionType::LE_AUDIO_SOFTWARE_DECODING_DATAPATH ||
- session_type_ == SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH);
+ session_type_ == SessionType::LE_AUDIO_SOFTWARE_ENCODING_DATAPATH ||
+ session_type_ ==
+ SessionType::LE_AUDIO_BROADCAST_SOFTWARE_ENCODING_DATAPATH);
bool is_offload_a2dp_session =
(session_type_ == SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH);
bool is_offload_le_audio_session =
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h
index aff01e5..451a31f 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h
@@ -86,6 +86,8 @@
case SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH:
case SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH:
return AudioConfiguration(LeAudioConfiguration{});
+ case SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH:
+ return AudioConfiguration(LeAudioBroadcastConfiguration{});
default:
return AudioConfiguration(PcmConfiguration{});
}
diff --git a/bluetooth/audio/utils/aidl_session/HidlToAidlMiddleware.cpp b/bluetooth/audio/utils/aidl_session/HidlToAidlMiddleware.cpp
index 632a389..1ef9365 100644
--- a/bluetooth/audio/utils/aidl_session/HidlToAidlMiddleware.cpp
+++ b/bluetooth/audio/utils/aidl_session/HidlToAidlMiddleware.cpp
@@ -418,100 +418,89 @@
}
inline Lc3CodecConfig_2_1 to_hidl_leaudio_config_2_1(
- const LeAudioConfiguration& leaudio_config) {
+ const LeAudioConfiguration& unicast_config) {
Lc3CodecConfig_2_1 hidl_lc3_codec_config = {
.audioChannelAllocation = 0,
};
- if (leaudio_config.modeConfig.getTag() ==
- LeAudioConfiguration::LeAudioModeConfig::unicastConfig) {
- auto& unicast_config =
- leaudio_config.modeConfig
- .get<LeAudioConfiguration::LeAudioModeConfig::unicastConfig>();
- if (unicast_config.leAudioCodecConfig.getTag() ==
- LeAudioCodecConfiguration::lc3Config) {
- LOG(FATAL) << __func__ << ": unexpected codec type(vendor?)";
- }
- auto& le_codec_config = unicast_config.leAudioCodecConfig
- .get<LeAudioCodecConfiguration::lc3Config>();
-
- hidl_lc3_codec_config.lc3Config = to_hidl_lc3_config_2_1(le_codec_config);
-
- for (const auto& map : unicast_config.streamMap) {
- hidl_lc3_codec_config.audioChannelAllocation |=
- map.audioChannelAllocation;
- }
- } else {
- // NOTE: Broadcast is not officially supported in HIDL
- auto& bcast_config =
- leaudio_config.modeConfig
- .get<LeAudioConfiguration::LeAudioModeConfig::broadcastConfig>();
- if (bcast_config.streamMap.empty()) {
- return hidl_lc3_codec_config;
- }
- if (bcast_config.streamMap[0].leAudioCodecConfig.getTag() !=
- LeAudioCodecConfiguration::lc3Config) {
- LOG(FATAL) << __func__ << ": unexpected codec type(vendor?)";
- }
- auto& le_codec_config =
- bcast_config.streamMap[0]
- .leAudioCodecConfig.get<LeAudioCodecConfiguration::lc3Config>();
- hidl_lc3_codec_config.lc3Config = to_hidl_lc3_config_2_1(le_codec_config);
-
- for (const auto& map : bcast_config.streamMap) {
- hidl_lc3_codec_config.audioChannelAllocation |=
- map.audioChannelAllocation;
- }
+ if (unicast_config.leAudioCodecConfig.getTag() ==
+ LeAudioCodecConfiguration::lc3Config) {
+ LOG(FATAL) << __func__ << ": unexpected codec type(vendor?)";
}
+ auto& le_codec_config = unicast_config.leAudioCodecConfig
+ .get<LeAudioCodecConfiguration::lc3Config>();
+ hidl_lc3_codec_config.lc3Config = to_hidl_lc3_config_2_1(le_codec_config);
+
+ for (const auto& map : unicast_config.streamMap) {
+ hidl_lc3_codec_config.audioChannelAllocation |= map.audioChannelAllocation;
+ }
+ return hidl_lc3_codec_config;
+}
+
+inline Lc3CodecConfig_2_1 to_hidl_leaudio_broadcast_config_2_1(
+ const LeAudioBroadcastConfiguration& broadcast_config) {
+ Lc3CodecConfig_2_1 hidl_lc3_codec_config = {
+ .audioChannelAllocation = 0,
+ };
+ // NOTE: Broadcast is not officially supported in HIDL
+ if (broadcast_config.streamMap.empty()) {
+ return hidl_lc3_codec_config;
+ }
+ if (broadcast_config.streamMap[0].leAudioCodecConfig.getTag() !=
+ LeAudioCodecConfiguration::lc3Config) {
+ LOG(FATAL) << __func__ << ": unexpected codec type(vendor?)";
+ }
+ auto& le_codec_config =
+ broadcast_config.streamMap[0]
+ .leAudioCodecConfig.get<LeAudioCodecConfiguration::lc3Config>();
+ hidl_lc3_codec_config.lc3Config = to_hidl_lc3_config_2_1(le_codec_config);
+
+ for (const auto& map : broadcast_config.streamMap) {
+ hidl_lc3_codec_config.audioChannelAllocation |= map.audioChannelAllocation;
+ }
return hidl_lc3_codec_config;
}
inline LeAudioConfig_2_2 to_hidl_leaudio_config_2_2(
- const LeAudioConfiguration& leaudio_config) {
+ const LeAudioConfiguration& unicast_config) {
LeAudioConfig_2_2 hidl_leaudio_config;
+ hidl_leaudio_config.mode = LeAudioMode_2_2::UNICAST;
+ ::android::hardware::bluetooth::audio::V2_2::UnicastConfig
+ hidl_unicast_config;
+ hidl_unicast_config.peerDelay =
+ static_cast<uint32_t>(unicast_config.peerDelayUs / 1000);
- if (leaudio_config.modeConfig.getTag() ==
- LeAudioConfiguration::LeAudioModeConfig::unicastConfig) {
- hidl_leaudio_config.mode = LeAudioMode_2_2::UNICAST;
- auto& unicast_config =
- leaudio_config.modeConfig
- .get<LeAudioConfiguration::LeAudioModeConfig::unicastConfig>();
- ::android::hardware::bluetooth::audio::V2_2::UnicastConfig
- hidl_unicast_config;
- hidl_unicast_config.peerDelay =
- static_cast<uint32_t>(unicast_config.peerDelay);
+ auto& lc3_config = unicast_config.leAudioCodecConfig
+ .get<LeAudioCodecConfiguration::lc3Config>();
+ hidl_unicast_config.lc3Config = to_hidl_lc3_config_2_1(lc3_config);
- auto& lc3_config = unicast_config.leAudioCodecConfig
- .get<LeAudioCodecConfiguration::lc3Config>();
- hidl_unicast_config.lc3Config = to_hidl_lc3_config_2_1(lc3_config);
+ hidl_unicast_config.streamMap.resize(unicast_config.streamMap.size());
+ for (int i = 0; i < unicast_config.streamMap.size(); i++) {
+ hidl_unicast_config.streamMap[i].audioChannelAllocation =
+ static_cast<uint32_t>(
+ unicast_config.streamMap[i].audioChannelAllocation);
+ hidl_unicast_config.streamMap[i].streamHandle =
+ static_cast<uint16_t>(unicast_config.streamMap[i].streamHandle);
+ }
+ return hidl_leaudio_config;
+}
- hidl_unicast_config.streamMap.resize(unicast_config.streamMap.size());
- for (int i = 0; i < unicast_config.streamMap.size(); i++) {
- hidl_unicast_config.streamMap[i].audioChannelAllocation =
- static_cast<uint32_t>(
- unicast_config.streamMap[i].audioChannelAllocation);
- hidl_unicast_config.streamMap[i].streamHandle =
- static_cast<uint16_t>(unicast_config.streamMap[i].streamHandle);
- }
- } else if (leaudio_config.modeConfig.getTag() ==
- LeAudioConfiguration::LeAudioModeConfig::broadcastConfig) {
- hidl_leaudio_config.mode = LeAudioMode_2_2::BROADCAST;
- auto bcast_config =
- leaudio_config.modeConfig
- .get<LeAudioConfiguration::LeAudioModeConfig::broadcastConfig>();
- ::android::hardware::bluetooth::audio::V2_2::BroadcastConfig
- hidl_bcast_config;
- hidl_bcast_config.streamMap.resize(bcast_config.streamMap.size());
- for (int i = 0; i < bcast_config.streamMap.size(); i++) {
- hidl_bcast_config.streamMap[i].audioChannelAllocation =
- static_cast<uint32_t>(
- bcast_config.streamMap[i].audioChannelAllocation);
- hidl_bcast_config.streamMap[i].streamHandle =
- static_cast<uint16_t>(bcast_config.streamMap[i].streamHandle);
- hidl_bcast_config.streamMap[i].lc3Config = to_hidl_lc3_config_2_1(
- bcast_config.streamMap[i]
- .leAudioCodecConfig.get<LeAudioCodecConfiguration::lc3Config>());
- }
+inline LeAudioConfig_2_2 to_hidl_leaudio_broadcast_config_2_2(
+ const LeAudioBroadcastConfiguration& broadcast_config) {
+ LeAudioConfig_2_2 hidl_leaudio_config;
+ hidl_leaudio_config.mode = LeAudioMode_2_2::BROADCAST;
+ ::android::hardware::bluetooth::audio::V2_2::BroadcastConfig
+ hidl_bcast_config;
+ hidl_bcast_config.streamMap.resize(broadcast_config.streamMap.size());
+ for (int i = 0; i < broadcast_config.streamMap.size(); i++) {
+ hidl_bcast_config.streamMap[i].audioChannelAllocation =
+ static_cast<uint32_t>(
+ broadcast_config.streamMap[i].audioChannelAllocation);
+ hidl_bcast_config.streamMap[i].streamHandle =
+ static_cast<uint16_t>(broadcast_config.streamMap[i].streamHandle);
+ hidl_bcast_config.streamMap[i].lc3Config = to_hidl_lc3_config_2_1(
+ broadcast_config.streamMap[i]
+ .leAudioCodecConfig.get<LeAudioCodecConfiguration::lc3Config>());
}
return hidl_leaudio_config;
}
@@ -532,6 +521,10 @@
hidl_audio_config.leAudioCodecConfig(to_hidl_leaudio_config_2_1(
audio_config.get<AudioConfiguration::leAudioConfig>()));
break;
+ case AudioConfiguration::leAudioBroadcastConfig:
+ hidl_audio_config.leAudioCodecConfig(to_hidl_leaudio_broadcast_config_2_1(
+ audio_config.get<AudioConfiguration::leAudioBroadcastConfig>()));
+ break;
}
return hidl_audio_config;
}
@@ -552,6 +545,10 @@
hidl_audio_config.leAudioConfig(to_hidl_leaudio_config_2_2(
audio_config.get<AudioConfiguration::leAudioConfig>()));
break;
+ case AudioConfiguration::leAudioBroadcastConfig:
+ hidl_audio_config.leAudioConfig(to_hidl_leaudio_broadcast_config_2_2(
+ audio_config.get<AudioConfiguration::leAudioBroadcastConfig>()));
+ break;
}
return hidl_audio_config;
}
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 6ec4e64..40db81d 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -24,4 +24,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/allocator/3.0/Android.bp b/graphics/allocator/3.0/Android.bp
index 768baba..800632c 100644
--- a/graphics/allocator/3.0/Android.bp
+++ b/graphics/allocator/3.0/Android.bp
@@ -26,4 +26,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/allocator/4.0/Android.bp b/graphics/allocator/4.0/Android.bp
index 0df9b39..5c5fb37 100644
--- a/graphics/allocator/4.0/Android.bp
+++ b/graphics/allocator/4.0/Android.bp
@@ -26,4 +26,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index 74a0d9b..ac158d9 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -21,4 +21,9 @@
],
gen_java: true,
gen_java_constants: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/common/1.1/Android.bp b/graphics/common/1.1/Android.bp
index a120278..e45d6dd 100644
--- a/graphics/common/1.1/Android.bp
+++ b/graphics/common/1.1/Android.bp
@@ -24,4 +24,9 @@
],
gen_java: true,
gen_java_constants: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/common/1.2/Android.bp b/graphics/common/1.2/Android.bp
index fe149e4..c23085d 100644
--- a/graphics/common/1.2/Android.bp
+++ b/graphics/common/1.2/Android.bp
@@ -25,4 +25,9 @@
],
gen_java: true,
gen_java_constants: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.aidl
similarity index 85%
copy from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
copy to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.aidl
index 766f637..ea60283 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/AlphaInterpretation.aidl
@@ -1,11 +1,11 @@
-/*
- * Copyright 2021 The Android Open Source Project
+/**
+ * Copyright (c) 2022, 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
+ * 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,
@@ -31,10 +31,10 @@
// 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="byte") @VintfStability
-enum LeAudioMode {
- UNKNOWN = 0,
- UNICAST = 1,
- BROADCAST = 2,
+package android.hardware.graphics.common;
+/* @hide */
+@Backing(type="int") @VintfStability
+enum AlphaInterpretation {
+ COVERAGE = 0,
+ MASK = 1,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.aidl
similarity index 86%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl
rename to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.aidl
index 94fd91b..27eff76 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BufferAheadResult.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayDecorationSupport.aidl
@@ -31,14 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.graphics.common;
+/* @hide */
@VintfStability
-parcelable BufferAheadResult {
- long display;
- android.hardware.graphics.composer3.BufferAheadResult.Layer[] layers;
- @VintfStability
- parcelable Layer {
- long layer;
- boolean presented;
- }
+parcelable DisplayDecorationSupport {
+ android.hardware.graphics.common.PixelFormat format;
+ android.hardware.graphics.common.AlphaInterpretation alphaInterpretation;
}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.aidl b/graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.aidl
new file mode 100644
index 0000000..e994cf2
--- /dev/null
+++ b/graphics/common/aidl/android/hardware/graphics/common/AlphaInterpretation.aidl
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2022, 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.graphics.common;
+
+/**
+ * How to interperet alpha values when it may be ambiguous.
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+enum AlphaInterpretation {
+ /**
+ * Alpha values are treated as coverage.
+ *
+ * Pixels in the buffer with an alpha of 0 (transparent) will be rendered in
+ * black, and pixels with a max value will show the content underneath. An
+ * alpha in between will show the content blended with black.
+ */
+ COVERAGE = 0,
+ /**
+ * Alpha values are treated as a mask.
+ *
+ * Pixels in the buffer with an alpha of 0 (transparent) will show the
+ * content underneath, and pixels with a max value will be rendered in
+ * black. An alpha in between will show the content blended with black.
+ */
+ MASK = 1,
+}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.aidl b/graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.aidl
new file mode 100644
index 0000000..42c2392
--- /dev/null
+++ b/graphics/common/aidl/android/hardware/graphics/common/DisplayDecorationSupport.aidl
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2022, 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.graphics.common;
+
+import android.hardware.graphics.common.PixelFormat;
+import android.hardware.graphics.common.AlphaInterpretation;
+
+/**
+ * A description of how a device supports Composition.DISPLAY_DECORATION.
+ *
+ * If the device supports Composition.DISPLAY_DECORATION, a call to
+ * IComposerClient.getDisplayDecorationSupport should return an instance of this
+ * parcelable. Otherwise the method should return null.
+ * @hide
+ */
+@VintfStability
+parcelable DisplayDecorationSupport {
+ /**
+ * The format to use for DISPLAY_DECORATION layers. Other formats are not
+ * supported. If other formats are used with DISPLAY_DECORATION, the result
+ * is undefined.
+ */
+ PixelFormat format;
+ /**
+ * How the device intreprets the alpha in the pixel buffer.
+ */
+ AlphaInterpretation alphaInterpretation;
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
index e989b6c..9c49583 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
@@ -39,5 +39,4 @@
SKIP_CLIENT_COLOR_TRANSFORM = 2,
PRESENT_FENCE_IS_NOT_RELIABLE = 3,
SKIP_VALIDATE = 4,
- BUFFER_AHEAD = 5,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
index fb39172..ebbb31e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
@@ -39,7 +39,6 @@
android.hardware.graphics.composer3.DisplayRequest displayRequest;
android.hardware.graphics.composer3.PresentFence presentFence;
android.hardware.graphics.composer3.ReleaseFences releaseFences;
- android.hardware.graphics.composer3.BufferAheadResult bufferAheadResult;
android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult;
android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
index b41ac8a..6eba887 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
@@ -41,6 +41,5 @@
PROTECTED_CONTENTS = 4,
AUTO_LOW_LATENCY_MODE = 5,
SUSPEND = 6,
- DISPLAY_DECORATION = 7,
- DISPLAY_IDLE_TIMER = 8,
+ DISPLAY_IDLE_TIMER = 7,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index 2de699b..b49f239 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -59,6 +59,7 @@
@nullable ParcelFileDescriptor getReadbackBufferFence(long display);
android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode);
android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display);
+ @nullable android.hardware.graphics.common.DisplayDecorationSupport getDisplayDecorationSupport(long display);
void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback);
void setActiveConfig(long display, int config);
android.hardware.graphics.composer3.VsyncPeriodChangeTimeline setActiveConfigWithConstraints(long display, int config, in android.hardware.graphics.composer3.VsyncPeriodChangeConstraints vsyncPeriodChangeConstraints);
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
index 1429c35..c1c0117 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -37,7 +37,6 @@
long layer;
@nullable android.hardware.graphics.common.Point cursorPosition;
@nullable android.hardware.graphics.composer3.Buffer buffer;
- @nullable android.hardware.graphics.composer3.Buffer bufferAhead;
@nullable android.hardware.graphics.common.Rect[] damage;
@nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode;
@nullable android.hardware.graphics.composer3.Color color;
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl
deleted file mode 100644
index 7ca4578..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/BufferAheadResult.aidl
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2022, 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.graphics.composer3;
-
-@VintfStability
-parcelable BufferAheadResult {
- /**
- * The display which this commands refers to.
- * @see IComposer.createDisplay
- */
- long display;
-
- @VintfStability
- parcelable Layer {
- /**
- * The layer which this commands refers to.
- * @see IComposer.createLayer
- */
- long layer;
-
- /**
- * Represents whether BufferAhead was presented as part of the last
- * present or not.
- */
- boolean presented;
- }
-
- /**
- * The layers which has BufferAheadResult populated.
- */
- Layer[] layers;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
index 77ad1e0..ea619ae 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
@@ -57,9 +57,4 @@
* validateDisplay step is needed.
*/
SKIP_VALIDATE = 4,
- /**
- * Specifies that a device is able to use the LayerCommand.bufferAhead
- * when provided.
- */
- BUFFER_AHEAD = 5
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
index fd1e4cc..f2de68e 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
@@ -16,7 +16,6 @@
package android.hardware.graphics.composer3;
-import android.hardware.graphics.composer3.BufferAheadResult;
import android.hardware.graphics.composer3.ChangedCompositionTypes;
import android.hardware.graphics.composer3.ClientTargetPropertyWithNits;
import android.hardware.graphics.composer3.CommandError;
@@ -79,13 +78,6 @@
ReleaseFences releaseFences;
/**
- * Represents the result of the LayerCommand.bufferAhead that was
- * sent in the last presentDisplay call. That is, the presentDisplay
- * call prior to this presentDisplay.
- */
- BufferAheadResult bufferAheadResult;
-
- /**
* Sets the state of PRESENT_OR_VALIDATE_DISPLAY command.
*/
PresentOrValidate presentOrValidateResult;
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
index 803de06..adcc9f6 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
@@ -75,13 +75,12 @@
SIDEBAND = 5,
/**
* A display decoration layer contains a buffer which is used to provide
- * anti-aliasing on the cutout region/rounded corners on the top and
+ * anti-aliasing on the cutout region and rounded corners on the top and
* bottom of a display.
*
- * Pixels in the buffer with an alpha of 0 (transparent) will show the
- * content underneath, and pixels with a max alpha value will be rendered in
- * black. An alpha in between will show the underlying content blended with
- * black.
+ * Only supported if the device returns a valid struct from
+ * getDisplayDecorationSupport. Pixels in the buffer are interpreted
+ * according to the DisplayDecorationSupport.alphInterpretation.
*
* Upon validateDisplay, the device may request a change from this type
* to either DEVICE or CLIENT.
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
index 85136c4..f4b2984 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
@@ -76,12 +76,8 @@
*/
SUSPEND = 6,
/**
- * Indicates that the display supports Composition.DISPLAY_DECORATION.
- */
- DISPLAY_DECORATION = 7,
- /**
* Indicates that the display supports IComposerClient.setIdleTimerEnabled and
* IComposerCallback.onVsyncIdle.
*/
- DISPLAY_IDLE_TIMER = 8,
+ DISPLAY_IDLE_TIMER = 7,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 2fe6656..769f803 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -16,6 +16,7 @@
package android.hardware.graphics.composer3;
+import android.hardware.graphics.common.DisplayDecorationSupport;
import android.hardware.graphics.common.Transform;
import android.hardware.graphics.composer3.ClientTargetProperty;
import android.hardware.graphics.composer3.ColorMode;
@@ -516,6 +517,16 @@
ContentType[] getSupportedContentTypes(long display);
/**
+ * Report whether and how this display supports Composition.DISPLAY_DECORATION.
+ *
+ * @return A description of how the display supports DISPLAY_DECORATION, or null
+ * if it is unsupported.
+ *
+ * @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
+ */
+ @nullable DisplayDecorationSupport getDisplayDecorationSupport(long display);
+
+ /**
* Provides a IComposerCallback object for the device to call.
*
* This function must be called only once.
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
index ab93794..6f6894f 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -70,30 +70,6 @@
@nullable Buffer buffer;
/**
- * Sets a buffer handle to be displayed for this layer and a file descriptor
- * referring to an acquire sync fence object, which must be signaled when it is
- * safe to read from the given buffer.
- *
- * When bufferAhead is provided, the implementation should try to
- * present it on the next scanout as long as its acquire sync fence
- * is signaled by that time. Otherwise the bufferAhead should be dropped.
- * This allows the client to set an
- * unsignaled buffer on the layer without causing the entire display to miss
- * an update if the buffer is not ready by the next scanout time.
- *
- * In case bufferAhead is dropped and LayerCommand.buffer is provided, LayerCommand.buffer
- * should be used as the next layer buffer.
- *
- * The implementation is expected to populate the CommandResultPayload.bufferAheadResult
- * with information about whether bufferAhead was presented or dropped.
- * Since this information is not known at the current presentDisplay call
- * of frame N (as the scanout happens after the call returns),
- * the implementation should populate it when presentDisplay is
- * called for frame N+1.
- */
- @nullable Buffer bufferAhead;
-
- /**
* Provides the region of the source buffer which has been modified since
* the last frame. This region does not need to be validated before
* calling presentDisplay.
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
index 404b548..17ec885 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -984,7 +984,6 @@
const auto errors = mReader.takeErrors();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
- ASSERT_TRUE(mReader.takeBufferAheadResultLayers(getPrimaryDisplayId()).empty());
ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h
index b53edf8..9af867c 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/VtsComposerClient.h
@@ -199,7 +199,7 @@
class VtsDisplay {
public:
- VtsDisplay(int64_t displayId) : mDisplayId(displayId) {}
+ VtsDisplay(int64_t displayId) : mDisplayId(displayId), mDisplayWidth(0), mDisplayHeight(0) {}
int64_t getDisplayId() const { return mDisplayId; }
@@ -237,4 +237,4 @@
int32_t mDisplayHeight;
std::unordered_map<int32_t, DisplayConfig> displayConfigs;
};
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
index 8f8c98f..f9e35e9 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
@@ -77,10 +77,6 @@
parseSetClientTargetProperty(std::move(
result.get<CommandResultPayload::Tag::clientTargetProperty>()));
break;
- case CommandResultPayload::Tag::bufferAheadResult:
- parseSetBufferAheadResultLayers(
- result.get<CommandResultPayload::Tag::bufferAheadResult>());
- break;
}
}
}
@@ -172,16 +168,6 @@
return std::move(data.clientTargetProperty);
}
- std::vector<BufferAheadResult::Layer> takeBufferAheadResultLayers(int64_t display) {
- const auto found = mReturnData.find(display);
-
- if (found == mReturnData.end()) {
- return {};
- }
-
- return std::move(found->second.bufferAheadResultLayers);
- }
-
private:
void resetData() {
mErrors.clear();
@@ -220,18 +206,12 @@
data.clientTargetProperty = std::move(clientTargetProperty);
}
- void parseSetBufferAheadResultLayers(const BufferAheadResult& bufferAheadResult) {
- auto& data = mReturnData[bufferAheadResult.display];
- data.bufferAheadResultLayers = std::move(bufferAheadResult.layers);
- }
-
struct ReturnData {
DisplayRequest displayRequests;
std::vector<ChangedCompositionLayer> changedLayers;
ndk::ScopedFileDescriptor presentFence;
std::vector<ReleaseFences::Layer> releasedLayers;
PresentOrValidate::Result presentOrValidateState;
- std::vector<BufferAheadResult::Layer> bufferAheadResultLayers;
ClientTargetPropertyWithNits clientTargetProperty = {
.clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN},
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
index 02405ba..a04b982 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -131,11 +131,6 @@
getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence);
}
- void setLayerBufferAhead(int64_t display, int64_t layer, uint32_t slot,
- const native_handle_t* buffer, int acquireFence) {
- getLayerCommand(display, layer).bufferAhead = getBuffer(slot, buffer, acquireFence);
- }
-
void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector<Rect>& damage) {
getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end());
}
diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp
index 63fdfa6..6c3ef54 100644
--- a/graphics/mapper/2.0/Android.bp
+++ b/graphics/mapper/2.0/Android.bp
@@ -25,4 +25,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/mapper/2.1/Android.bp b/graphics/mapper/2.1/Android.bp
index 4011650..cc74156 100644
--- a/graphics/mapper/2.1/Android.bp
+++ b/graphics/mapper/2.1/Android.bp
@@ -26,4 +26,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/mapper/3.0/Android.bp b/graphics/mapper/3.0/Android.bp
index 401a3a2..88992a3 100644
--- a/graphics/mapper/3.0/Android.bp
+++ b/graphics/mapper/3.0/Android.bp
@@ -27,4 +27,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/graphics/mapper/4.0/Android.bp b/graphics/mapper/4.0/Android.bp
index 4084dcd..0cffce4 100644
--- a/graphics/mapper/4.0/Android.bp
+++ b/graphics/mapper/4.0/Android.bp
@@ -27,4 +27,9 @@
"android.hidl.base@1.0",
],
gen_java: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.media.swcodec",
+ "test_com.android.media.swcodec",
+ ],
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 5c0aacd..ed6e7c9 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -45,6 +45,7 @@
void filsHlpFlushRequest();
android.hardware.wifi.supplicant.DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(in byte[] macAddress, in String deviceInfo, in android.hardware.wifi.supplicant.DppCurve curve);
android.hardware.wifi.supplicant.ConnectionCapabilities getConnectionCapabilities();
+ android.hardware.wifi.supplicant.MloLinksInfo getConnectionMloLinksInfo();
android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmtCapabilities();
byte[] getMacAddress();
String getName();
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl
similarity index 88%
copy from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl
index 766f637..5e2c47b 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -31,10 +31,9 @@
// 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="byte") @VintfStability
-enum LeAudioMode {
- UNKNOWN = 0,
- UNICAST = 1,
- BROADCAST = 2,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable MloLink {
+ byte linkId;
+ byte[] staLinkMacAddress;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl
similarity index 88%
rename from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
rename to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl
index 766f637..14fcb91 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLinksInfo.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -31,10 +31,8 @@
// 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="byte") @VintfStability
-enum LeAudioMode {
- UNKNOWN = 0,
- UNICAST = 1,
- BROADCAST = 2,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable MloLinksInfo {
+ android.hardware.wifi.supplicant.MloLink[] links;
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index a48a991..95e087f 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -28,6 +28,7 @@
import android.hardware.wifi.supplicant.ISupplicantStaNetwork;
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.KeyMgmtMask;
+import android.hardware.wifi.supplicant.MloLinksInfo;
import android.hardware.wifi.supplicant.QosPolicyStatus;
import android.hardware.wifi.supplicant.RxFilterType;
import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask;
@@ -188,6 +189,15 @@
ConnectionCapabilities getConnectionCapabilities();
/**
+ * Get Connection MLO links Info
+ *
+ * @return Connection MLO Links Info.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ MloLinksInfo getConnectionMloLinksInfo();
+
+ /**
* Get Key management capabilities of the device
*
* @return Bitmap of key management mask.
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl
similarity index 60%
copy from bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl
index 2cf019e..0e23728 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -14,12 +14,20 @@
* limitations under the License.
*/
-package android.hardware.bluetooth.audio;
+package android.hardware.wifi.supplicant;
+/**
+ * Multi-Link Operation (MLO) Link IEEE Std 802.11-be.
+ * The information for MLO link needed by 802.11be standard.
+ */
@VintfStability
-@Backing(type="byte")
-enum LeAudioMode {
- UNKNOWN,
- UNICAST,
- BROADCAST,
+parcelable MloLink {
+ /**
+ * Link ID
+ */
+ byte linkId;
+ /**
+ * STA Link MAC Address
+ */
+ byte[/* 6 */] staLinkMacAddress;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl
similarity index 62%
rename from bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl
rename to wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl
index 2cf019e..2f14717 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioMode.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLinksInfo.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright (C) 2022 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.
@@ -14,12 +14,18 @@
* limitations under the License.
*/
-package android.hardware.bluetooth.audio;
+package android.hardware.wifi.supplicant;
+import android.hardware.wifi.supplicant.MloLink;
+
+/**
+ * Multi-Link Operation (MLO) Links info.
+ * The information for MLO links needed by 802.11be standard.
+ */
@VintfStability
-@Backing(type="byte")
-enum LeAudioMode {
- UNKNOWN,
- UNICAST,
- BROADCAST,
+parcelable MloLinksInfo {
+ /**
+ * List of MLO links
+ */
+ MloLink[] links;
}