Merge "Remove uses of deprecated GTest macro."
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index e6b0cee..bb48ecd 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -36,12 +36,13 @@
"android.hardware.audio_defaults",
],
srcs: [
+ "android/hardware/audio/common/AudioOffloadMetadata.aidl",
"android/hardware/audio/common/PlaybackTrackMetadata.aidl",
"android/hardware/audio/common/RecordTrackMetadata.aidl",
"android/hardware/audio/common/SinkMetadata.aidl",
"android/hardware/audio/common/SourceMetadata.aidl",
],
- frozen: true,
+ frozen: false,
imports: [
"android.media.audio.common.types-V2",
],
@@ -77,7 +78,7 @@
}
// Note: This should always be one version ahead of the last frozen version
-latest_android_hardware_audio_common = "android.hardware.audio.common-V1"
+latest_android_hardware_audio_common = "android.hardware.audio.common-V2"
// Modules that depend on android.hardware.audio.common directly can include
// the following cc_defaults to avoid explicitly managing dependency versions
@@ -112,6 +113,7 @@
"android/hardware/audio/core/AudioPatch.aidl",
"android/hardware/audio/core/AudioRoute.aidl",
"android/hardware/audio/core/IBluetooth.aidl",
+ "android/hardware/audio/core/IBluetoothA2dp.aidl",
"android/hardware/audio/core/IConfig.aidl",
"android/hardware/audio/core/IModule.aidl",
"android/hardware/audio/core/IStreamCallback.aidl",
@@ -129,7 +131,7 @@
imports: [
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
- "android.hardware.audio.common-V1",
+ "android.hardware.audio.common-V2",
"android.hardware.audio.core.sounddose-V1",
"android.hardware.audio.effect-V1",
"android.media.audio.common.types-V2",
@@ -253,7 +255,7 @@
imports: [
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
- "android.hardware.audio.common-V1",
+ "android.hardware.audio.common-V2",
"android.media.audio.common.types-V2",
],
backend: {
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl
similarity index 79%
copy from security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl
copy to audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl
index 294170d..000504b 100644
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl
@@ -1,11 +1,11 @@
/*
- * Copyright 2021, The Android Open Source Project
+ * Copyright (C) 2023 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,9 +31,12 @@
// 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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Signature {
- byte[] data;
+package android.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable AudioOffloadMetadata {
+ int sampleRate;
+ android.media.audio.common.AudioChannelLayout channelMask;
+ int averageBitRatePerSecond;
+ int delayFrames;
+ int paddingFrames;
}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothA2dp.aidl
similarity index 80%
rename from security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl
rename to audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothA2dp.aidl
index 294170d..0f4c46d 100644
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Signature.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IBluetoothA2dp.aidl
@@ -1,11 +1,11 @@
/*
- * Copyright 2021, The Android Open Source Project
+ * Copyright (C) 2023 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,9 +31,11 @@
// 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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Signature {
- byte[] data;
+package android.hardware.audio.core;
+@VintfStability
+interface IBluetoothA2dp {
+ boolean isEnabled();
+ void setEnabled(boolean enabled);
+ boolean supportsOffloadReconfiguration();
+ void reconfigureOffload(in android.hardware.audio.core.VendorParameter[] parameters);
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
index 1eafdab..f18d6a5 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl
@@ -37,6 +37,7 @@
void setModuleDebug(in android.hardware.audio.core.ModuleDebug debug);
@nullable android.hardware.audio.core.ITelephony getTelephony();
@nullable android.hardware.audio.core.IBluetooth getBluetooth();
+ @nullable android.hardware.audio.core.IBluetoothA2dp getBluetoothA2dp();
android.media.audio.common.AudioPort connectExternalDevice(in android.media.audio.common.AudioPort templateIdAndAdditionalData);
void disconnectExternalDevice(int portId);
android.hardware.audio.core.AudioPatch[] getAudioPatches();
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl
index 46acc11..ec3078e 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl
@@ -36,6 +36,7 @@
interface IStreamOut {
android.hardware.audio.core.IStreamCommon getStreamCommon();
void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
+ void updateOffloadMetadata(in android.hardware.audio.common.AudioOffloadMetadata offloadMetadata);
float[] getHwVolume();
void setHwVolume(in float[] channelVolumes);
float getAudioDescriptionMixLevel();
diff --git a/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl b/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl
new file mode 100644
index 0000000..5881658
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2023 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.audio.common;
+
+import android.media.audio.common.AudioChannelLayout;
+
+/**
+ * Dynamic metadata for offloaded compressed audio.
+ * For static metadata, see android.media.audio.common.AudioOffloadInfo.
+ */
+@JavaDerive(equals=true, toString=true)
+@VintfStability
+parcelable AudioOffloadMetadata {
+ int sampleRate;
+ AudioChannelLayout channelMask;
+ /** Average bit rate in bits per second. */
+ int averageBitRatePerSecond;
+ /**
+ * Number of frames to be ignored at the beginning of the stream.
+ * The value must be non-negative. A value of 0 indicates no delay
+ * has to be applied.
+ */
+ int delayFrames;
+ /**
+ * Number of frames to be ignored at the end of the stream.
+ * The value must be non-negative. A value of 0 indicates no padding
+ * has to be applied.
+ */
+ int paddingFrames;
+}
diff --git a/audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl b/audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl
new file mode 100644
index 0000000..dc4b8d0
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/core/IBluetoothA2dp.aidl
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2023 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.audio.core;
+
+import android.hardware.audio.core.VendorParameter;
+
+/**
+ * An instance of IBluetoothA2dp manages settings for the A2DP (Advanced Audio
+ * Distribution Profile) profiles. This interface is optional to implement by
+ * the vendor. It needs to be provided only if the device actually supports BT
+ * A2DP.
+ *
+ * This interface is separate from IBluetooth interface which manages SCO & HFP.
+ * The HAL module can handle both SCO and A2DP profiles or only one of them.
+ */
+@VintfStability
+interface IBluetoothA2dp {
+ /**
+ * Whether BT A2DP is enabled.
+ *
+ * Returns the current state of A2DP support. The client might need to
+ * disable (suspend) A2DP when another profile (for example, SCO) is
+ * activated.
+ *
+ * @return Whether BT A2DP is enabled.
+ */
+ boolean isEnabled();
+
+ /**
+ * Enable or disable A2DP.
+ *
+ * Sets the current state of A2DP support. The client might need to
+ * disable (suspend) A2DP when another profile (for example, SCO) is
+ * activated.
+ *
+ * @param enabled Whether BT A2DP must be enabled or suspended.
+ * @throws EX_ILLEGAL_STATE If there was an error performing the operation.
+ */
+ void setEnabled(boolean enabled);
+
+ /**
+ * Indicates whether the module supports reconfiguration of offloaded codecs.
+ *
+ * Offloaded coded implementations may need to be reconfigured when the
+ * active A2DP device changes. This method indicates whether the HAL module
+ * supports the reconfiguration event. The result returned from this method
+ * must not change over time.
+ *
+ * @return Whether reconfiguration offload of offloaded codecs is supported.
+ */
+ boolean supportsOffloadReconfiguration();
+
+ /**
+ * Instructs the HAL module to reconfigure offloaded codec.
+ *
+ * Offloaded coded implementations may need to be reconfigured when the
+ * active A2DP device changes. This method is a notification for the HAL
+ * module to commence reconfiguration.
+ *
+ * Note that 'EX_UNSUPPORTED_OPERATION' may only be thrown when
+ * 'supportsOffloadReconfiguration' returns 'false'.
+ *
+ * @param parameter Optional vendor-specific parameters, can be left empty.
+ * @throws EX_ILLEGAL_STATE If there was an error performing the operation,
+ * or the operation can not be commenced in the current state.
+ * @throws EX_UNSUPPORTED_OPERATION If the module does not support codec reconfiguration.
+ */
+ void reconfigureOffload(in VendorParameter[] parameters);
+}
diff --git a/audio/aidl/android/hardware/audio/core/IModule.aidl b/audio/aidl/android/hardware/audio/core/IModule.aidl
index edfb9f2..080d826 100644
--- a/audio/aidl/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/android/hardware/audio/core/IModule.aidl
@@ -21,6 +21,7 @@
import android.hardware.audio.core.AudioPatch;
import android.hardware.audio.core.AudioRoute;
import android.hardware.audio.core.IBluetooth;
+import android.hardware.audio.core.IBluetoothA2dp;
import android.hardware.audio.core.IStreamCallback;
import android.hardware.audio.core.IStreamIn;
import android.hardware.audio.core.IStreamOut;
@@ -103,6 +104,20 @@
@nullable IBluetooth getBluetooth();
/**
+ * Retrieve the interface to control Bluetooth A2DP.
+ *
+ * If the HAL module supports A2DP Profile functionality for Bluetooth, it
+ * must return an instance of the IBluetoothA2dp interface. The same
+ * instance must be returned during the lifetime of the HAL module. If the
+ * HAL module does not support BT A2DP, a null must be returned, without
+ * throwing any errors.
+ *
+ * @return An instance of the IBluetoothA2dp interface implementation.
+ * @throws EX_ILLEGAL_STATE If there was an error creating an instance.
+ */
+ @nullable IBluetoothA2dp getBluetoothA2dp();
+
+ /**
* Set a device port of an external device into connected state.
*
* This method is used to inform the HAL module that an external device has
@@ -596,6 +611,7 @@
* @param mute Whether the output from the module is muted.
* @throws EX_UNSUPPORTED_OPERATION If muting of combined output
* is not supported by the module.
+ * @throws EX_ILLEGAL_STATE If any error happens while muting of combined output.
*/
void setMasterMute(boolean mute);
@@ -627,6 +643,8 @@
* accepted range.
* @throws EX_UNSUPPORTED_OPERATION If attenuation of combined output
* is not supported by the module.
+ * @throws EX_ILLEGAL_STATE If any error happens while updating attenuation of
+ combined output.
*/
void setMasterVolume(float volume);
diff --git a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
index 0e58add..f26dc1c 100644
--- a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
+++ b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl
@@ -16,6 +16,7 @@
package android.hardware.audio.core;
+import android.hardware.audio.common.AudioOffloadMetadata;
import android.hardware.audio.common.SourceMetadata;
import android.hardware.audio.core.IStreamCommon;
import android.media.audio.common.AudioDualMonoMode;
@@ -48,6 +49,18 @@
*/
void updateMetadata(in SourceMetadata sourceMetadata);
+ /**
+ * Update offload metadata for a compressed stream.
+ *
+ * Updates the offload metadata initially provided at the stream creation.
+ *
+ * @param offloadMetadata Updated offload metadata.
+ * @throws EX_ILLEGAL_STATE If the stream is closed.
+ * @throws EX_ILLEGAL_ARGUMENT If the metadata contains invalid values.
+ * @throws EX_UNSUPPORTED_OPERATION If the stream is not for compressed offload.
+ */
+ void updateOffloadMetadata(in AudioOffloadMetadata offloadMetadata);
+
const int HW_VOLUME_MIN = 0;
const int HW_VOLUME_MAX = 1;
/**
@@ -85,7 +98,8 @@
* @throws EX_ILLEGAL_ARGUMENT If the number of elements in the provided
* array does not match the channel count, or
* attenuation values are out of range.
- * @throws EX_ILLEGAL_STATE If the stream is closed.
+ * @throws EX_ILLEGAL_STATE If the stream is closed or there is any error happens
+ when applying hardware volume.
* @throws EX_UNSUPPORTED_OPERATION If hardware volume control is not supported.
*/
void setHwVolume(in float[] channelVolumes);
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 21616be..ea00dcb 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -54,12 +54,13 @@
],
}
-cc_library_static {
+cc_library {
name: "libaudioserviceexampleimpl",
defaults: [
"aidlaudioservice_defaults",
"latest_android_media_audio_common_types_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
+ "latest_android_hardware_audio_core_sounddose_ndk_shared",
],
export_include_dirs: ["include"],
srcs: [
@@ -75,6 +76,7 @@
"Telephony.cpp",
"usb/ModuleUsb.cpp",
"usb/StreamUsb.cpp",
+ "usb/UsbAlsaMixerControl.cpp",
"usb/UsbAlsaUtils.cpp",
],
generated_sources: [
diff --git a/audio/aidl/default/Bluetooth.cpp b/audio/aidl/default/Bluetooth.cpp
index 38e0c21..bd9a864 100644
--- a/audio/aidl/default/Bluetooth.cpp
+++ b/audio/aidl/default/Bluetooth.cpp
@@ -19,6 +19,7 @@
#include "core-impl/Bluetooth.h"
+using aidl::android::hardware::audio::core::VendorParameter;
using aidl::android::media::audio::common::Boolean;
using aidl::android::media::audio::common::Float;
using aidl::android::media::audio::common::Int;
@@ -79,4 +80,29 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus BluetoothA2dp::isEnabled(bool* _aidl_return) {
+ *_aidl_return = mEnabled;
+ LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus BluetoothA2dp::setEnabled(bool in_enabled) {
+ mEnabled = in_enabled;
+ LOG(DEBUG) << __func__ << ": " << mEnabled;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus BluetoothA2dp::supportsOffloadReconfiguration(bool* _aidl_return) {
+ *_aidl_return = true;
+ LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus BluetoothA2dp::reconfigureOffload(
+ const std::vector<::aidl::android::hardware::audio::core::VendorParameter>& in_parameters
+ __unused) {
+ LOG(DEBUG) << __func__ << ": " << ::android::internal::ToString(in_parameters);
+ return ndk::ScopedAStatus::ok();
+}
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 5440b8d..c4f3844 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -370,29 +370,32 @@
}
ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) {
- if (mTelephony == nullptr) {
+ if (!mTelephony) {
mTelephony = ndk::SharedRefBase::make<Telephony>();
- mTelephonyBinder = mTelephony->asBinder();
- AIBinder_setMinSchedulerPolicy(mTelephonyBinder.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
}
- *_aidl_return = mTelephony;
+ *_aidl_return = mTelephony.getPtr();
LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) {
- if (mBluetooth == nullptr) {
+ if (!mBluetooth) {
mBluetooth = ndk::SharedRefBase::make<Bluetooth>();
- mBluetoothBinder = mBluetooth->asBinder();
- AIBinder_setMinSchedulerPolicy(mBluetoothBinder.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
}
- *_aidl_return = mBluetooth;
+ *_aidl_return = mBluetooth.getPtr();
LOG(DEBUG) << __func__ << ": returning instance of IBluetooth: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus Module::getBluetoothA2dp(std::shared_ptr<IBluetoothA2dp>* _aidl_return) {
+ if (!mBluetoothA2dp) {
+ mBluetoothA2dp = ndk::SharedRefBase::make<BluetoothA2dp>();
+ }
+ *_aidl_return = mBluetoothA2dp.getPtr();
+ LOG(DEBUG) << __func__ << ": returning instance of IBluetoothA2dp: " << _aidl_return->get();
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdAndAdditionalData,
AudioPort* _aidl_return) {
const int32_t templateId = in_templateIdAndAdditionalData.id;
@@ -457,6 +460,7 @@
connectedPort.profiles = connectedProfilesIt->second;
}
ports.push_back(connectedPort);
+ onExternalDeviceConnectionChanged(connectedPort, true /*connected*/);
*_aidl_return = std::move(connectedPort);
std::vector<AudioRoute> newRoutes;
@@ -510,6 +514,7 @@
<< configIt->id;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
+ onExternalDeviceConnectionChanged(*portIt, false /*connected*/);
ports.erase(portIt);
mConnectedDevicePorts.erase(in_portId);
LOG(DEBUG) << __func__ << ": connected device port " << in_portId << " released";
@@ -980,8 +985,17 @@
ndk::ScopedAStatus Module::setMasterMute(bool in_mute) {
LOG(DEBUG) << __func__ << ": " << in_mute;
- mMasterMute = in_mute;
- return ndk::ScopedAStatus::ok();
+ auto result = mDebug.simulateDeviceConnections ? ndk::ScopedAStatus::ok()
+ : onMasterMuteChanged(in_mute);
+ if (result.isOk()) {
+ mMasterMute = in_mute;
+ } else {
+ LOG(ERROR) << __func__ << ": failed calling onMasterMuteChanged(" << in_mute
+ << "), error=" << result;
+ // Reset master mute if it failed.
+ onMasterMuteChanged(mMasterMute);
+ }
+ return std::move(result);
}
ndk::ScopedAStatus Module::getMasterVolume(float* _aidl_return) {
@@ -993,8 +1007,17 @@
ndk::ScopedAStatus Module::setMasterVolume(float in_volume) {
LOG(DEBUG) << __func__ << ": " << in_volume;
if (in_volume >= 0.0f && in_volume <= 1.0f) {
- mMasterVolume = in_volume;
- return ndk::ScopedAStatus::ok();
+ auto result = mDebug.simulateDeviceConnections ? ndk::ScopedAStatus::ok()
+ : onMasterVolumeChanged(in_volume);
+ if (result.isOk()) {
+ mMasterVolume = in_volume;
+ } else {
+ // Reset master volume if it failed.
+ LOG(ERROR) << __func__ << ": failed calling onMasterVolumeChanged(" << in_volume
+ << "), error=" << result;
+ onMasterVolumeChanged(mMasterVolume);
+ }
+ return std::move(result);
}
LOG(ERROR) << __func__ << ": invalid master volume value: " << in_volume;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
@@ -1039,13 +1062,10 @@
}
ndk::ScopedAStatus Module::getSoundDose(std::shared_ptr<ISoundDose>* _aidl_return) {
- if (mSoundDose == nullptr) {
+ if (!mSoundDose) {
mSoundDose = ndk::SharedRefBase::make<sounddose::SoundDose>();
- mSoundDoseBinder = mSoundDose->asBinder();
- AIBinder_setMinSchedulerPolicy(mSoundDoseBinder.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
}
- *_aidl_return = mSoundDose;
+ *_aidl_return = mSoundDose.getPtr();
LOG(DEBUG) << __func__ << ": returning instance of ISoundDose: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
@@ -1251,14 +1271,30 @@
}
ndk::ScopedAStatus Module::populateConnectedDevicePort(AudioPort* audioPort __unused) {
- LOG(DEBUG) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::checkAudioPatchEndpointsMatch(
const std::vector<AudioPortConfig*>& sources __unused,
const std::vector<AudioPortConfig*>& sinks __unused) {
- LOG(DEBUG) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ return ndk::ScopedAStatus::ok();
+}
+
+void Module::onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort __unused,
+ bool connected __unused) {
+ LOG(DEBUG) << __func__ << ": do nothing and return";
+}
+
+ndk::ScopedAStatus Module::onMasterMuteChanged(bool mute __unused) {
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Module::onMasterVolumeChanged(float volume __unused) {
+ LOG(VERBOSE) << __func__ << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index 49ad2f2..193c793 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -24,6 +24,7 @@
#include "core-impl/Module.h"
#include "core-impl/Stream.h"
+using aidl::android::hardware::audio::common::AudioOffloadMetadata;
using aidl::android::hardware::audio::common::SinkMetadata;
using aidl::android::hardware::audio::common::SourceMetadata;
using aidl::android::media::audio::common::AudioDevice;
@@ -785,6 +786,40 @@
LOG(DEBUG) << __func__;
}
+ndk::ScopedAStatus StreamOut::updateOffloadMetadata(
+ const AudioOffloadMetadata& in_offloadMetadata) {
+ LOG(DEBUG) << __func__;
+ if (isClosed()) {
+ LOG(ERROR) << __func__ << ": stream was closed";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ if (!mOffloadInfo.has_value()) {
+ LOG(ERROR) << __func__ << ": not a compressed offload stream";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ if (in_offloadMetadata.sampleRate < 0) {
+ LOG(ERROR) << __func__ << ": invalid sample rate value: " << in_offloadMetadata.sampleRate;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (in_offloadMetadata.averageBitRatePerSecond < 0) {
+ LOG(ERROR) << __func__
+ << ": invalid average BPS value: " << in_offloadMetadata.averageBitRatePerSecond;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (in_offloadMetadata.delayFrames < 0) {
+ LOG(ERROR) << __func__
+ << ": invalid delay frames value: " << in_offloadMetadata.delayFrames;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (in_offloadMetadata.paddingFrames < 0) {
+ LOG(ERROR) << __func__
+ << ": invalid padding frames value: " << in_offloadMetadata.paddingFrames;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ mOffloadMetadata = in_offloadMetadata;
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus StreamOut::getHwVolume(std::vector<float>* _aidl_return) {
LOG(DEBUG) << __func__;
(void)_aidl_return;
diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml
index 0d1731f..c06742d 100644
--- a/audio/aidl/default/audio_effects_config.xml
+++ b/audio/aidl/default/audio_effects_config.xml
@@ -69,8 +69,6 @@
-->
<effects>
- <effect name="acoustic_echo_canceler" library="pre_processing" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/>
- <effect name="automatic_gain_control_v1" library="pre_processing" uuid="aa8130e0-66fc-11e0-bad0-0002a5d5c51b"/>
<effect name="automatic_gain_control_v2" library="pre_processing" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/>
<effectProxy name="bassboost" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
<libsw library="bassboostsw" uuid="fa8181f2-588b-11ed-9b6a-0242ac120002"/>
@@ -81,7 +79,6 @@
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/>
- <effect name="noise_suppression" library="pre_processing" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/>
<effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/>
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
<effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
diff --git a/audio/aidl/default/include/core-impl/Bluetooth.h b/audio/aidl/default/include/core-impl/Bluetooth.h
index f2e762d..e2f48ba 100644
--- a/audio/aidl/default/include/core-impl/Bluetooth.h
+++ b/audio/aidl/default/include/core-impl/Bluetooth.h
@@ -17,6 +17,7 @@
#pragma once
#include <aidl/android/hardware/audio/core/BnBluetooth.h>
+#include <aidl/android/hardware/audio/core/BnBluetoothA2dp.h>
namespace aidl::android::hardware::audio::core {
@@ -32,4 +33,19 @@
HfpConfig mHfpConfig;
};
+class BluetoothA2dp : public BnBluetoothA2dp {
+ public:
+ BluetoothA2dp() = default;
+
+ private:
+ ndk::ScopedAStatus isEnabled(bool* _aidl_return) override;
+ ndk::ScopedAStatus setEnabled(bool in_enabled) override;
+ ndk::ScopedAStatus supportsOffloadReconfiguration(bool* _aidl_return) override;
+ ndk::ScopedAStatus reconfigureOffload(
+ const std::vector<::aidl::android::hardware::audio::core::VendorParameter>&
+ in_parameters) override;
+
+ bool mEnabled = false;
+};
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index 8365b34..c35025f 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -46,11 +46,32 @@
bool forceTransientBurst = false;
bool forceSynchronousDrain = false;
};
+ // Helper used for interfaces that require a persistent instance. We hold them via a strong
+ // pointer. The binder token is retained for a call to 'setMinSchedulerPolicy'.
+ template <class C>
+ struct ChildInterface : private std::pair<std::shared_ptr<C>, ndk::SpAIBinder> {
+ ChildInterface() {}
+ ChildInterface& operator=(const std::shared_ptr<C>& c) {
+ return operator=(std::shared_ptr<C>(c));
+ }
+ ChildInterface& operator=(std::shared_ptr<C>&& c) {
+ this->first = std::move(c);
+ this->second = this->first->asBinder();
+ AIBinder_setMinSchedulerPolicy(this->second.get(), SCHED_NORMAL,
+ ANDROID_PRIORITY_AUDIO);
+ return *this;
+ }
+ explicit operator bool() const { return !!this->first; }
+ C& operator*() const { return *(this->first); }
+ C* operator->() const { return this->first; }
+ std::shared_ptr<C> getPtr() const { return this->first; }
+ };
ndk::ScopedAStatus setModuleDebug(
const ::aidl::android::hardware::audio::core::ModuleDebug& in_debug) override;
ndk::ScopedAStatus getTelephony(std::shared_ptr<ITelephony>* _aidl_return) override;
ndk::ScopedAStatus getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) override;
+ ndk::ScopedAStatus getBluetoothA2dp(std::shared_ptr<IBluetoothA2dp>* _aidl_return) override;
ndk::ScopedAStatus connectExternalDevice(
const ::aidl::android::media::audio::common::AudioPort& in_templateIdAndAdditionalData,
::aidl::android::media::audio::common::AudioPort* _aidl_return) override;
@@ -151,23 +172,17 @@
std::unique_ptr<internal::Configuration> mConfig;
ModuleDebug mDebug;
VendorDebug mVendorDebug;
- // For the interfaces requiring to return the same instance, we need to hold them
- // via a strong pointer. The binder token is retained for a call to 'setMinSchedulerPolicy'.
- std::shared_ptr<ITelephony> mTelephony;
- ndk::SpAIBinder mTelephonyBinder;
- std::shared_ptr<IBluetooth> mBluetooth;
- ndk::SpAIBinder mBluetoothBinder;
+ ChildInterface<ITelephony> mTelephony;
+ ChildInterface<IBluetooth> mBluetooth;
+ ChildInterface<IBluetoothA2dp> mBluetoothA2dp;
// ids of ports created at runtime via 'connectExternalDevice'.
std::set<int32_t> mConnectedDevicePorts;
Streams mStreams;
// Maps port ids and port config ids to patch ids.
// Multimap because both ports and configs can be used by multiple patches.
std::multimap<int32_t, int32_t> mPatches;
- bool mMasterMute = false;
- float mMasterVolume = 1.0f;
bool mMicMute = false;
- std::shared_ptr<sounddose::ISoundDose> mSoundDose;
- ndk::SpAIBinder mSoundDoseBinder;
+ ChildInterface<sounddose::ISoundDose> mSoundDose;
std::optional<bool> mIsMmapSupported;
protected:
@@ -180,6 +195,13 @@
virtual ndk::ScopedAStatus checkAudioPatchEndpointsMatch(
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sources,
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sinks);
+ virtual void onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort, bool connected);
+ virtual ndk::ScopedAStatus onMasterMuteChanged(bool mute);
+ virtual ndk::ScopedAStatus onMasterVolumeChanged(float volume);
+
+ bool mMasterMute = false;
+ float mMasterVolume = 1.0f;
};
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/ModuleUsb.h b/audio/aidl/default/include/core-impl/ModuleUsb.h
index 7b177e8..1aa2244 100644
--- a/audio/aidl/default/include/core-impl/ModuleUsb.h
+++ b/audio/aidl/default/include/core-impl/ModuleUsb.h
@@ -28,10 +28,6 @@
// IModule interfaces
ndk::ScopedAStatus getTelephony(std::shared_ptr<ITelephony>* _aidl_return) override;
ndk::ScopedAStatus getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) override;
- ndk::ScopedAStatus getMasterMute(bool* _aidl_return) override;
- ndk::ScopedAStatus setMasterMute(bool in_mute) override;
- ndk::ScopedAStatus getMasterVolume(float* _aidl_return) override;
- ndk::ScopedAStatus setMasterVolume(float in_volume) override;
ndk::ScopedAStatus getMicMute(bool* _aidl_return) override;
ndk::ScopedAStatus setMicMute(bool in_mute) override;
@@ -42,6 +38,11 @@
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sources,
const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sinks)
override;
+ void onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort,
+ bool connected) override;
+ ndk::ScopedAStatus onMasterMuteChanged(bool mute) override;
+ ndk::ScopedAStatus onMasterVolumeChanged(float volume) override;
};
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h
index 0d4365a3..e9b1fbb 100644
--- a/audio/aidl/default/include/core-impl/Stream.h
+++ b/audio/aidl/default/include/core-impl/Stream.h
@@ -463,6 +463,9 @@
return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>::
updateMetadata(in_sourceMetadata);
}
+ ndk::ScopedAStatus updateOffloadMetadata(
+ const ::aidl::android::hardware::audio::common::AudioOffloadMetadata&
+ in_offloadMetadata) override;
ndk::ScopedAStatus getHwVolume(std::vector<float>* _aidl_return) override;
ndk::ScopedAStatus setHwVolume(const std::vector<float>& in_channelVolumes) override;
ndk::ScopedAStatus getAudioDescriptionMixLevel(float* _aidl_return) override;
@@ -500,6 +503,7 @@
offloadInfo);
std::optional<::aidl::android::media::audio::common::AudioOffloadInfo> mOffloadInfo;
+ std::optional<::aidl::android::hardware::audio::common::AudioOffloadMetadata> mOffloadMetadata;
public:
using CreateInstance = std::function<ndk::ScopedAStatus(
diff --git a/audio/aidl/default/include/core-impl/StreamUsb.h b/audio/aidl/default/include/core-impl/StreamUsb.h
index c04dc66..f1815dd 100644
--- a/audio/aidl/default/include/core-impl/StreamUsb.h
+++ b/audio/aidl/default/include/core-impl/StreamUsb.h
@@ -17,6 +17,7 @@
#pragma once
#include <mutex>
+#include <vector>
#include <aidl/android/media/audio/common/AudioChannelLayout.h>
@@ -93,6 +94,12 @@
StreamContext&& context,
const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
offloadInfo);
+
+ ndk::ScopedAStatus getHwVolume(std::vector<float>* _aidl_return) override;
+ ndk::ScopedAStatus setHwVolume(const std::vector<float>& in_channelVolumes) override;
+
+ int mChannelCount;
+ std::vector<float> mHwVolumes;
};
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/usb/ModuleUsb.cpp b/audio/aidl/default/usb/ModuleUsb.cpp
index e803420..511ba74 100644
--- a/audio/aidl/default/usb/ModuleUsb.cpp
+++ b/audio/aidl/default/usb/ModuleUsb.cpp
@@ -22,6 +22,7 @@
#include <android-base/logging.h>
#include <tinyalsa/asoundlib.h>
+#include "UsbAlsaMixerControl.h"
#include "UsbAlsaUtils.h"
#include "core-impl/ModuleUsb.h"
@@ -86,26 +87,6 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus ModuleUsb::getMasterMute(bool* _aidl_return __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
-ndk::ScopedAStatus ModuleUsb::setMasterMute(bool in_mute __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
-ndk::ScopedAStatus ModuleUsb::getMasterVolume(float* _aidl_return __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
-ndk::ScopedAStatus ModuleUsb::setMasterVolume(float in_volume __unused) {
- LOG(DEBUG) << __func__ << ": is not supported";
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-
ndk::ScopedAStatus ModuleUsb::getMicMute(bool* _aidl_return __unused) {
LOG(DEBUG) << __func__ << ": is not supported";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
@@ -180,4 +161,26 @@
return ndk::ScopedAStatus::ok();
}
+void ModuleUsb::onExternalDeviceConnectionChanged(
+ const ::aidl::android::media::audio::common::AudioPort& audioPort, bool connected) {
+ if (audioPort.ext.getTag() != AudioPortExt::Tag::device) {
+ return;
+ }
+ const auto& address = audioPort.ext.get<AudioPortExt::Tag::device>().device.address;
+ if (address.getTag() != AudioDeviceAddress::alsa) {
+ return;
+ }
+ const int card = address.get<AudioDeviceAddress::alsa>()[0];
+ usb::UsbAlsaMixerControl::getInstance().setDeviceConnectionState(card, mMasterMute,
+ mMasterVolume, connected);
+}
+
+ndk::ScopedAStatus ModuleUsb::onMasterMuteChanged(bool mute) {
+ return usb::UsbAlsaMixerControl::getInstance().setMasterMute(mute);
+}
+
+ndk::ScopedAStatus ModuleUsb::onMasterVolumeChanged(float volume) {
+ return usb::UsbAlsaMixerControl::getInstance().setMasterVolume(volume);
+}
+
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/usb/StreamUsb.cpp b/audio/aidl/default/usb/StreamUsb.cpp
index bd53a0e..d6f757c 100644
--- a/audio/aidl/default/usb/StreamUsb.cpp
+++ b/audio/aidl/default/usb/StreamUsb.cpp
@@ -17,6 +17,9 @@
#define LOG_TAG "AHAL_StreamUsb"
#include <android-base/logging.h>
+#include <Utils.h>
+
+#include "UsbAlsaMixerControl.h"
#include "UsbAlsaUtils.h"
#include "core-impl/Module.h"
#include "core-impl/StreamUsb.h"
@@ -30,8 +33,12 @@
using aidl::android::media::audio::common::AudioDevice;
using aidl::android::media::audio::common::AudioDeviceAddress;
using aidl::android::media::audio::common::AudioOffloadInfo;
+using aidl::android::media::audio::common::AudioPortExt;
using aidl::android::media::audio::common::MicrophoneDynamicInfo;
using aidl::android::media::audio::common::MicrophoneInfo;
+using android::OK;
+using android::status_t;
+using android::hardware::audio::common::getChannelCount;
namespace aidl::android::hardware::audio::core {
@@ -239,6 +246,31 @@
// The default worker implementation is used.
return new StreamOutWorker(ctx, driver);
},
- offloadInfo) {}
+ offloadInfo) {
+ mChannelCount = getChannelCount(mContext.getChannelLayout());
+}
+
+ndk::ScopedAStatus StreamOutUsb::getHwVolume(std::vector<float>* _aidl_return) {
+ *_aidl_return = mHwVolumes;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus StreamOutUsb::setHwVolume(const std::vector<float>& in_channelVolumes) {
+ for (const auto& device : mConnectedDevices) {
+ if (device.address.getTag() != AudioDeviceAddress::alsa) {
+ LOG(DEBUG) << __func__ << ": skip as the device address is not alsa";
+ continue;
+ }
+ const int card = device.address.get<AudioDeviceAddress::alsa>()[0];
+ if (auto result =
+ usb::UsbAlsaMixerControl::getInstance().setVolumes(card, in_channelVolumes);
+ !result.isOk()) {
+ LOG(ERROR) << __func__ << ": failed to set volume for device, card=" << card;
+ return result;
+ }
+ }
+ mHwVolumes = in_channelVolumes;
+ return ndk::ScopedAStatus::ok();
+}
} // namespace aidl::android::hardware::audio::core
diff --git a/audio/aidl/default/usb/UsbAlsaMixerControl.cpp b/audio/aidl/default/usb/UsbAlsaMixerControl.cpp
new file mode 100644
index 0000000..b5337d1
--- /dev/null
+++ b/audio/aidl/default/usb/UsbAlsaMixerControl.cpp
@@ -0,0 +1,239 @@
+/*
+ * Copyright (C) 2023 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 "AHAL_UsbAlsaMixerControl"
+#include <android-base/logging.h>
+
+#include <cmath>
+#include <string>
+#include <vector>
+
+#include <android/binder_status.h>
+
+#include "UsbAlsaMixerControl.h"
+
+namespace aidl::android::hardware::audio::core::usb {
+
+//-----------------------------------------------------------------------------
+
+MixerControl::MixerControl(struct mixer_ctl* ctl)
+ : mCtl(ctl),
+ mNumValues(mixer_ctl_get_num_values(ctl)),
+ mMinValue(mixer_ctl_get_range_min(ctl)),
+ mMaxValue(mixer_ctl_get_range_max(ctl)) {}
+
+unsigned int MixerControl::getNumValues() const {
+ return mNumValues;
+}
+
+int MixerControl::getMaxValue() const {
+ return mMaxValue;
+}
+
+int MixerControl::getMinValue() const {
+ return mMinValue;
+}
+
+int MixerControl::setArray(const void* array, size_t count) {
+ const std::lock_guard guard(mLock);
+ return mixer_ctl_set_array(mCtl, array, count);
+}
+
+//-----------------------------------------------------------------------------
+
+// static
+const std::map<AlsaMixer::Control, std::vector<AlsaMixer::ControlNamesAndExpectedCtlType>>
+ AlsaMixer::kPossibleControls = {
+ {AlsaMixer::MASTER_SWITCH, {{"Master Playback Switch", MIXER_CTL_TYPE_BOOL}}},
+ {AlsaMixer::MASTER_VOLUME, {{"Master Playback Volume", MIXER_CTL_TYPE_INT}}},
+ {AlsaMixer::HW_VOLUME,
+ {{"Headphone Playback Volume", MIXER_CTL_TYPE_INT},
+ {"Headset Playback Volume", MIXER_CTL_TYPE_INT},
+ {"PCM Playback Volume", MIXER_CTL_TYPE_INT}}}};
+
+// static
+std::map<AlsaMixer::Control, std::shared_ptr<MixerControl>> AlsaMixer::initializeMixerControls(
+ struct mixer* mixer) {
+ std::map<AlsaMixer::Control, std::shared_ptr<MixerControl>> mixerControls;
+ std::string mixerCtlNames;
+ for (const auto& [control, possibleCtls] : kPossibleControls) {
+ for (const auto& [ctlName, expectedCtlType] : possibleCtls) {
+ struct mixer_ctl* ctl = mixer_get_ctl_by_name(mixer, ctlName.c_str());
+ if (ctl != nullptr && mixer_ctl_get_type(ctl) == expectedCtlType) {
+ mixerControls.emplace(control, std::make_unique<MixerControl>(ctl));
+ if (!mixerCtlNames.empty()) {
+ mixerCtlNames += ",";
+ }
+ mixerCtlNames += ctlName;
+ break;
+ }
+ }
+ }
+ LOG(DEBUG) << __func__ << ": available mixer control names=[" << mixerCtlNames << "]";
+ return mixerControls;
+}
+
+AlsaMixer::AlsaMixer(struct mixer* mixer)
+ : mMixer(mixer), mMixerControls(initializeMixerControls(mMixer)) {}
+
+AlsaMixer::~AlsaMixer() {
+ mixer_close(mMixer);
+}
+
+namespace {
+
+int volumeFloatToInteger(float fValue, int maxValue, int minValue) {
+ return minValue + std::ceil((maxValue - minValue) * fValue);
+}
+
+float volumeIntegerToFloat(int iValue, int maxValue, int minValue) {
+ if (iValue > maxValue) {
+ return 1.0f;
+ }
+ if (iValue < minValue) {
+ return 0.0f;
+ }
+ return static_cast<float>(iValue - minValue) / (maxValue - minValue);
+}
+
+} // namespace
+
+ndk::ScopedAStatus AlsaMixer::setMasterMute(bool muted) {
+ auto it = mMixerControls.find(AlsaMixer::MASTER_SWITCH);
+ if (it == mMixerControls.end()) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ const int numValues = it->second->getNumValues();
+ std::vector<int> values(numValues, muted ? 0 : 1);
+ if (int err = it->second->setArray(values.data(), numValues); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to set master mute, err=" << err;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AlsaMixer::setMasterVolume(float volume) {
+ auto it = mMixerControls.find(AlsaMixer::MASTER_VOLUME);
+ if (it == mMixerControls.end()) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ const int numValues = it->second->getNumValues();
+ std::vector<int> values(numValues, volumeFloatToInteger(volume, it->second->getMaxValue(),
+ it->second->getMinValue()));
+ if (int err = it->second->setArray(values.data(), numValues); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to set master volume, err=" << err;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus AlsaMixer::setVolumes(std::vector<float> volumes) {
+ auto it = mMixerControls.find(AlsaMixer::HW_VOLUME);
+ if (it == mMixerControls.end()) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ const int numValues = it->second->getNumValues();
+ const int maxValue = it->second->getMaxValue();
+ const int minValue = it->second->getMinValue();
+ std::vector<int> values;
+ size_t i = 0;
+ for (; i < numValues && i < values.size(); ++i) {
+ values.emplace_back(volumeFloatToInteger(volumes[i], maxValue, minValue));
+ }
+ if (int err = it->second->setArray(values.data(), values.size()); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to set volume, err=" << err;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+//-----------------------------------------------------------------------------
+
+// static
+UsbAlsaMixerControl& UsbAlsaMixerControl::getInstance() {
+ static UsbAlsaMixerControl gInstance;
+ return gInstance;
+}
+
+void UsbAlsaMixerControl::setDeviceConnectionState(int card, bool masterMuted, float masterVolume,
+ bool connected) {
+ LOG(DEBUG) << __func__ << ": card=" << card << ", connected=" << connected;
+ if (connected) {
+ struct mixer* mixer = mixer_open(card);
+ if (mixer == nullptr) {
+ PLOG(ERROR) << __func__ << ": failed to open mixer for card=" << card;
+ return;
+ }
+ auto alsaMixer = std::make_shared<AlsaMixer>(mixer);
+ alsaMixer->setMasterMute(masterMuted);
+ alsaMixer->setMasterVolume(masterVolume);
+ const std::lock_guard guard(mLock);
+ mMixerControls.emplace(card, alsaMixer);
+ } else {
+ const std::lock_guard guard(mLock);
+ mMixerControls.erase(card);
+ }
+}
+
+ndk::ScopedAStatus UsbAlsaMixerControl::setMasterMute(bool mute) {
+ auto alsaMixers = getAlsaMixers();
+ for (auto it = alsaMixers.begin(); it != alsaMixers.end(); ++it) {
+ if (auto result = it->second->setMasterMute(mute); !result.isOk()) {
+ // Return illegal state if there are multiple devices connected and one of them fails
+ // to set master mute. Otherwise, return the error from calling `setMasterMute`.
+ LOG(ERROR) << __func__ << ": failed to set master mute for card=" << it->first;
+ return alsaMixers.size() > 1 ? ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE)
+ : std::move(result);
+ }
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus UsbAlsaMixerControl::setMasterVolume(float volume) {
+ auto alsaMixers = getAlsaMixers();
+ for (auto it = alsaMixers.begin(); it != alsaMixers.end(); ++it) {
+ if (auto result = it->second->setMasterVolume(volume); !result.isOk()) {
+ // Return illegal state if there are multiple devices connected and one of them fails
+ // to set master volume. Otherwise, return the error from calling `setMasterVolume`.
+ LOG(ERROR) << __func__ << ": failed to set master volume for card=" << it->first;
+ return alsaMixers.size() > 1 ? ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE)
+ : std::move(result);
+ }
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus UsbAlsaMixerControl::setVolumes(int card, std::vector<float> volumes) {
+ auto alsaMixer = getAlsaMixer(card);
+ if (alsaMixer == nullptr) {
+ LOG(ERROR) << __func__ << ": no mixer control found for card=" << card;
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ return alsaMixer->setVolumes(volumes);
+}
+
+std::shared_ptr<AlsaMixer> UsbAlsaMixerControl::getAlsaMixer(int card) {
+ const std::lock_guard guard(mLock);
+ const auto it = mMixerControls.find(card);
+ return it == mMixerControls.end() ? nullptr : it->second;
+}
+
+std::map<int, std::shared_ptr<AlsaMixer>> UsbAlsaMixerControl::getAlsaMixers() {
+ const std::lock_guard guard(mLock);
+ return mMixerControls;
+}
+
+} // namespace aidl::android::hardware::audio::core::usb
diff --git a/audio/aidl/default/usb/UsbAlsaMixerControl.h b/audio/aidl/default/usb/UsbAlsaMixerControl.h
new file mode 100644
index 0000000..cbcddd8
--- /dev/null
+++ b/audio/aidl/default/usb/UsbAlsaMixerControl.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#include <map>
+#include <memory>
+#include <mutex>
+#include <optional>
+#include <string>
+#include <vector>
+
+#include <android-base/thread_annotations.h>
+#include <android/binder_auto_utils.h>
+
+extern "C" {
+#include <tinyalsa/mixer.h>
+}
+
+namespace aidl::android::hardware::audio::core::usb {
+
+class MixerControl {
+ public:
+ explicit MixerControl(struct mixer_ctl* ctl);
+
+ unsigned int getNumValues() const;
+ int getMaxValue() const;
+ int getMinValue() const;
+ int setArray(const void* array, size_t count);
+
+ private:
+ std::mutex mLock;
+ // The mixer_ctl object is owned by ALSA and will be released when the mixer is closed.
+ struct mixer_ctl* mCtl GUARDED_BY(mLock);
+ const unsigned int mNumValues;
+ const int mMinValue;
+ const int mMaxValue;
+};
+
+class AlsaMixer {
+ public:
+ explicit AlsaMixer(struct mixer* mixer);
+
+ ~AlsaMixer();
+
+ bool isValid() const { return mMixer != nullptr; }
+
+ ndk::ScopedAStatus setMasterMute(bool muted);
+ ndk::ScopedAStatus setMasterVolume(float volume);
+ ndk::ScopedAStatus setVolumes(std::vector<float> volumes);
+
+ private:
+ enum Control {
+ MASTER_SWITCH,
+ MASTER_VOLUME,
+ HW_VOLUME,
+ };
+ using ControlNamesAndExpectedCtlType = std::pair<std::string, enum mixer_ctl_type>;
+ static const std::map<Control, std::vector<ControlNamesAndExpectedCtlType>> kPossibleControls;
+ static std::map<Control, std::shared_ptr<MixerControl>> initializeMixerControls(
+ struct mixer* mixer);
+
+ // The mixer object is owned by ALSA and will be released when the mixer is closed.
+ struct mixer* mMixer;
+ // `mMixerControls` will only be initialized in constructor. After that, it wil only be
+ // read but not be modified.
+ const std::map<Control, std::shared_ptr<MixerControl>> mMixerControls;
+};
+
+class UsbAlsaMixerControl {
+ public:
+ static UsbAlsaMixerControl& getInstance();
+
+ void setDeviceConnectionState(int card, bool masterMuted, float masterVolume, bool connected);
+
+ // Master volume settings will be applied to all sound cards, it is only set by the
+ // USB module.
+ ndk::ScopedAStatus setMasterMute(bool muted);
+ ndk::ScopedAStatus setMasterVolume(float volume);
+ // The volume settings can be different on sound cards. It is controlled by streams.
+ ndk::ScopedAStatus setVolumes(int card, std::vector<float> volumes);
+
+ private:
+ std::shared_ptr<AlsaMixer> getAlsaMixer(int card);
+ std::map<int, std::shared_ptr<AlsaMixer>> getAlsaMixers();
+
+ std::mutex mLock;
+ // A map whose key is the card number and value is a shared pointer to corresponding
+ // AlsaMixer object.
+ std::map<int, std::shared_ptr<AlsaMixer>> mMixerControls GUARDED_BY(mLock);
+};
+
+} // namespace aidl::android::hardware::audio::core::usb
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index 5ed8e1f..5e03d67 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -28,6 +28,7 @@
#include <aidl/android/media/audio/common/AudioChannelLayout.h>
#include <android/binder_auto_utils.h>
#include <fmq/AidlMessageQueue.h>
+#include <gtest/gtest.h>
#include <system/audio_effects/aidl_effects_utils.h>
#include "AudioHalBinderServiceUtil.h"
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index 7b002ad..b07edb7 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -56,7 +56,7 @@
offloadInfo.base.sampleRate = portConfig.sampleRate.value().value;
offloadInfo.base.channelMask = portConfig.channelMask.value();
offloadInfo.base.format = portConfig.format.value();
- offloadInfo.bitRatePerSecond = 256; // Arbitrary value.
+ offloadInfo.bitRatePerSecond = 256000; // Arbitrary value.
offloadInfo.durationUs = std::chrono::microseconds(1min).count(); // Arbitrary value.
offloadInfo.usage = AudioUsage::MEDIA;
offloadInfo.encapsulationMode = AudioEncapsulationMode::NONE;
diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index 4c1d42c..72ca56f 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -21,7 +21,7 @@
#include <iostream>
#include <android/binder_auto_utils.h>
-#include <gtest/gtest_pred_impl.h>
+#include <gtest/gtest.h>
namespace android::hardware::audio::common::testing {
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index b6015ff..1e0c900 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -53,6 +53,7 @@
#include "TestUtils.h"
using namespace android;
+using aidl::android::hardware::audio::common::AudioOffloadMetadata;
using aidl::android::hardware::audio::common::PlaybackTrackMetadata;
using aidl::android::hardware::audio::common::RecordTrackMetadata;
using aidl::android::hardware::audio::common::SinkMetadata;
@@ -60,6 +61,7 @@
using aidl::android::hardware::audio::core::AudioPatch;
using aidl::android::hardware::audio::core::AudioRoute;
using aidl::android::hardware::audio::core::IBluetooth;
+using aidl::android::hardware::audio::core::IBluetoothA2dp;
using aidl::android::hardware::audio::core::IModule;
using aidl::android::hardware::audio::core::IStreamCommon;
using aidl::android::hardware::audio::core::IStreamIn;
@@ -401,8 +403,9 @@
// Can be used as a base for any test here, does not depend on the fixture GTest parameters.
class AudioCoreModuleBase {
public:
- // The default buffer size is used mostly for negative tests.
+ // Default buffer sizes are used mostly for negative tests.
static constexpr int kDefaultBufferSizeFrames = 256;
+ static constexpr int kDefaultLargeBufferSizeFrames = 48000;
void SetUpImpl(const std::string& moduleName) {
ASSERT_NO_FATAL_FAILURE(ConnectToService(moduleName));
@@ -2053,6 +2056,59 @@
&hfpConfig));
}
+class AudioCoreBluetoothA2dp : public AudioCoreModuleBase,
+ public testing::TestWithParam<std::string> {
+ public:
+ void SetUp() override {
+ ASSERT_NO_FATAL_FAILURE(SetUpImpl(GetParam()));
+ ASSERT_IS_OK(module->getBluetoothA2dp(&bluetooth));
+ }
+
+ void TearDown() override { ASSERT_NO_FATAL_FAILURE(TearDownImpl()); }
+
+ std::shared_ptr<IBluetoothA2dp> bluetooth;
+};
+
+TEST_P(AudioCoreBluetoothA2dp, SameInstance) {
+ if (bluetooth == nullptr) {
+ GTEST_SKIP() << "BluetoothA2dp is not supported";
+ }
+ std::shared_ptr<IBluetoothA2dp> bluetooth2;
+ EXPECT_IS_OK(module->getBluetoothA2dp(&bluetooth2));
+ ASSERT_NE(nullptr, bluetooth2.get());
+ EXPECT_EQ(bluetooth->asBinder(), bluetooth2->asBinder())
+ << "getBluetoothA2dp must return the same interface instance across invocations";
+}
+
+TEST_P(AudioCoreBluetoothA2dp, Enabled) {
+ if (bluetooth == nullptr) {
+ GTEST_SKIP() << "BluetoothA2dp is not supported";
+ }
+ // Since enabling A2DP may require having an actual device connection,
+ // limit testing to setting back the current value.
+ bool enabled;
+ ASSERT_IS_OK(bluetooth->isEnabled(&enabled));
+ EXPECT_IS_OK(bluetooth->setEnabled(enabled))
+ << "setEnabled without actual state change must not fail";
+}
+
+TEST_P(AudioCoreBluetoothA2dp, OffloadReconfiguration) {
+ if (bluetooth == nullptr) {
+ GTEST_SKIP() << "BluetoothA2dp is not supported";
+ }
+ bool isSupported;
+ ASSERT_IS_OK(bluetooth->supportsOffloadReconfiguration(&isSupported));
+ bool isSupported2;
+ ASSERT_IS_OK(bluetooth->supportsOffloadReconfiguration(&isSupported2));
+ EXPECT_EQ(isSupported, isSupported2);
+ if (isSupported) {
+ static const auto kStatuses = {EX_NONE, EX_ILLEGAL_STATE};
+ EXPECT_STATUS(kStatuses, bluetooth->reconfigureOffload({}));
+ } else {
+ EXPECT_STATUS(EX_UNSUPPORTED_OPERATION, bluetooth->reconfigureOffload({}));
+ }
+}
+
class AudioCoreTelephony : public AudioCoreModuleBase, public testing::TestWithParam<std::string> {
public:
void SetUp() override {
@@ -2696,7 +2752,7 @@
aidl::android::hardware::audio::core::IModule::OpenOutputStreamArguments args;
args.portConfigId = portConfig.getId();
args.sourceMetadata = GenerateSourceMetadata(portConfig.get());
- args.bufferSizeFrames = kDefaultBufferSizeFrames;
+ args.bufferSizeFrames = kDefaultLargeBufferSizeFrames;
aidl::android::hardware::audio::core::IModule::OpenOutputStreamReturn ret;
EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->openOutputStream(args, &ret))
<< "when no offload info is provided for a compressed offload mix port";
@@ -2876,7 +2932,7 @@
const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port);
ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port";
WithStream<IStreamOut> stream(portConfig.value());
- ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames));
+ ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames));
bool isSupported = false;
EXPECT_NO_FATAL_FAILURE(TestAccessors<AudioPlaybackRate>(
stream.get(), &IStreamOut::getPlaybackRateParameters,
@@ -2901,7 +2957,7 @@
const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port);
ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port";
WithStream<IStreamOut> stream(portConfig.value());
- ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames));
+ ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames));
ndk::ScopedAStatus status;
EXPECT_STATUS(kStatuses, status = stream.get()->selectPresentation(0, 0));
if (status.getExceptionCode() != EX_UNSUPPORTED_OPERATION) atLeastOneSupports = true;
@@ -2911,6 +2967,33 @@
}
}
+TEST_P(AudioStreamOut, UpdateOffloadMetadata) {
+ const auto offloadMixPorts =
+ moduleConfig->getOffloadMixPorts(true /*attachedOnly*/, false /*singlePort*/);
+ if (offloadMixPorts.empty()) {
+ GTEST_SKIP()
+ << "No mix port for compressed offload that could be routed to attached devices";
+ }
+ for (const auto& port : offloadMixPorts) {
+ const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port);
+ ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port";
+ WithStream<IStreamOut> stream(portConfig.value());
+ ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames));
+ AudioOffloadMetadata validMetadata{
+ .sampleRate = portConfig.value().sampleRate.value().value,
+ .channelMask = portConfig.value().channelMask.value(),
+ .averageBitRatePerSecond = 256000,
+ .delayFrames = 0,
+ .paddingFrames = 0};
+ EXPECT_IS_OK(stream.get()->updateOffloadMetadata(validMetadata));
+ AudioOffloadMetadata invalidMetadata{.sampleRate = -1,
+ .averageBitRatePerSecond = -1,
+ .delayFrames = -1,
+ .paddingFrames = -1};
+ EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->updateOffloadMetadata(invalidMetadata));
+ }
+}
+
class StreamLogicDefaultDriver : public StreamLogicDriver {
public:
StreamLogicDefaultDriver(std::shared_ptr<StateSequence> commands, size_t frameSizeBytes)
@@ -3433,6 +3516,10 @@
testing::ValuesIn(android::getAidlHalInstanceNames(IModule::descriptor)),
android::PrintInstanceNameToString);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioCoreBluetooth);
+INSTANTIATE_TEST_SUITE_P(AudioCoreBluetoothA2dpTest, AudioCoreBluetoothA2dp,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IModule::descriptor)),
+ android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioCoreBluetoothA2dp);
INSTANTIATE_TEST_SUITE_P(AudioCoreTelephonyTest, AudioCoreTelephony,
testing::ValuesIn(android::getAidlHalInstanceNames(IModule::descriptor)),
android::PrintInstanceNameToString);
diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp
index edac160..da92d38 100644
--- a/automotive/audiocontrol/aidl/vts/Android.bp
+++ b/automotive/audiocontrol/aidl/vts/Android.bp
@@ -25,7 +25,6 @@
name: "VtsAidlHalAudioControlTest",
defaults: [
"latest_android_media_audio_common_types_cpp_static",
- "latest_android_hardware_audio_common_cpp_static",
"VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static",
],
@@ -39,6 +38,7 @@
"libxml2",
],
static_libs: [
+ "android.hardware.audio.common-V1-cpp",
"android.hardware.automotive.audiocontrol-V2-cpp",
"libgmock",
],
diff --git a/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp b/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
index 624538b..37c863b 100644
--- a/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
+++ b/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
@@ -169,8 +169,8 @@
__dir_stream& operator=(const __dir_stream&) = delete;
__dir_stream(__dir_stream&& other) noexcept : __stream_(other.__stream_),
- __root_(move(other.__root_)),
- __entry_(move(other.__entry_)) {
+ __root_(std::move(other.__root_)),
+ __entry_(std::move(other.__entry_)) {
other.__stream_ = nullptr;
}
@@ -252,7 +252,7 @@
error_code m_ec;
if (!__imp_->advance(m_ec)) {
- path root = move(__imp_->__root_);
+ path root = std::move(__imp_->__root_);
__imp_.reset();
if (m_ec)
err.report(m_ec, "at root \"%s\"", root);
@@ -286,7 +286,7 @@
__imp_ = make_shared<__shared_imp>();
__imp_->__options_ = opt;
- __imp_->__stack_.push(move(new_s));
+ __imp_->__stack_.push(std::move(new_s));
}
void recursive_directory_iterator::__pop(error_code* ec) {
@@ -340,7 +340,7 @@
}
if (m_ec) {
- path root = move(stack.top().__root_);
+ path root = std::move(stack.top().__root_);
__imp_.reset();
err.report(m_ec, "at root \"%s\"", root);
} else {
@@ -374,7 +374,7 @@
if (!skip_rec) {
__dir_stream new_it(curr_it.__entry_.path(), __imp_->__options_, m_ec);
if (new_it.good()) {
- __imp_->__stack_.push(move(new_it));
+ __imp_->__stack_.push(std::move(new_it));
return true;
}
}
@@ -385,7 +385,7 @@
if (ec)
ec->clear();
} else {
- path at_ent = move(curr_it.__entry_.__p_);
+ path at_ent = std::move(curr_it.__entry_.__p_);
__imp_.reset();
err.report(m_ec, "attempting recursion into \"%s\"", at_ent);
}
diff --git a/automotive/evs/OWNERS b/automotive/evs/OWNERS
index b973e91..15de48f 100644
--- a/automotive/evs/OWNERS
+++ b/automotive/evs/OWNERS
@@ -1,3 +1,2 @@
ankitarora@google.com
-changyeon@google.com
jwhpryor@google.com
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 8ea1ddd..9451087 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -516,12 +516,15 @@
// Return the number of completed packets reported by the controller.
int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) {
int packets_processed = 0;
- wait_for_event(false);
- if (event_queue.size() == 0) {
- ALOGW("%s: WaitForCallback timed out.", __func__);
- return packets_processed;
- }
- while (event_queue.size() > 0) {
+ while (true) {
+ // There should be at least one event.
+ wait_for_event(packets_processed == 0);
+ if (event_queue.empty()) {
+ if (packets_processed == 0) {
+ ALOGW("%s: WaitForCallback timed out.", __func__);
+ }
+ return packets_processed;
+ }
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
diff --git a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
index 9ae3837..28ac603 100644
--- a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
+++ b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
@@ -539,12 +539,15 @@
// Return the number of completed packets reported by the controller.
int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) {
int packets_processed = 0;
- wait_for_event(false);
- if (event_queue.size() == 0) {
- ALOGW("%s: WaitForCallback timed out.", __func__);
- return packets_processed;
- }
- while (event_queue.size() > 0) {
+ while (true) {
+ // There should be at least one event.
+ wait_for_event(packets_processed == 0);
+ if (event_queue.empty()) {
+ if (packets_processed == 0) {
+ ALOGW("%s: WaitForCallback timed out.", __func__);
+ }
+ return packets_processed;
+ }
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
diff --git a/compatibility_matrices/compatibility_matrix.7.xml b/compatibility_matrices/compatibility_matrix.7.xml
index 5694945..67dd717 100644
--- a/compatibility_matrices/compatibility_matrix.7.xml
+++ b/compatibility_matrices/compatibility_matrix.7.xml
@@ -400,14 +400,6 @@
</interface>
</hal>
<hal format="aidl" optional="true">
- <name>android.hardware.security.dice</name>
- <version>1</version>
- <interface>
- <name>IDiceDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="aidl" optional="true">
<name>android.hardware.security.keymint</name>
<version>1-2</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml
index c7b05e8..f5a1b20 100644
--- a/compatibility_matrices/compatibility_matrix.8.xml
+++ b/compatibility_matrices/compatibility_matrix.8.xml
@@ -403,14 +403,6 @@
</interface>
</hal>
<hal format="aidl" optional="true">
- <name>android.hardware.security.dice</name>
- <version>1</version>
- <interface>
- <name>IDiceDevice</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="aidl" optional="true">
<name>android.hardware.security.keymint</name>
<version>1-3</version>
<interface>
diff --git a/confirmationui/1.0/default/OWNERS b/confirmationui/1.0/default/OWNERS
index 335660d..17aed51 100644
--- a/confirmationui/1.0/default/OWNERS
+++ b/confirmationui/1.0/default/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124672
jdanis@google.com
swillden@google.com
diff --git a/confirmationui/1.0/vts/OWNERS b/confirmationui/1.0/vts/OWNERS
index e7aa8b4..aa07242 100644
--- a/confirmationui/1.0/vts/OWNERS
+++ b/confirmationui/1.0/vts/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 1124672
jdanis@google.com
swillden@google.com
yim@google.com
diff --git a/confirmationui/OWNERS b/confirmationui/OWNERS
index 2bcdb0e..d3896df 100644
--- a/confirmationui/OWNERS
+++ b/confirmationui/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124672
swillden@google.com
subrahmanyaman@google.com
diff --git a/confirmationui/support/OWNERS b/confirmationui/support/OWNERS
index 335660d..17aed51 100644
--- a/confirmationui/support/OWNERS
+++ b/confirmationui/support/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124672
jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/default/OWNERS b/gatekeeper/1.0/default/OWNERS
index 335660d..c97fba6 100644
--- a/gatekeeper/1.0/default/OWNERS
+++ b/gatekeeper/1.0/default/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124862
jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/software/OWNERS b/gatekeeper/1.0/software/OWNERS
index 335660d..c97fba6 100644
--- a/gatekeeper/1.0/software/OWNERS
+++ b/gatekeeper/1.0/software/OWNERS
@@ -1,2 +1,3 @@
+# Bug component: 1124862
jdanis@google.com
swillden@google.com
diff --git a/graphics/mapper/2.0/default/passthrough.cpp b/graphics/mapper/2.0/default/passthrough.cpp
index e18b88f..93d6d99 100644
--- a/graphics/mapper/2.0/default/passthrough.cpp
+++ b/graphics/mapper/2.0/default/passthrough.cpp
@@ -19,6 +19,14 @@
using android::hardware::graphics::mapper::V2_0::IMapper;
using android::hardware::graphics::mapper::V2_0::passthrough::GrallocLoader;
+// Preload the gralloc module such that GraphicBufferMapper::preloadHal is
+// meaningful
+class GrallocPreloader {
+public:
+ GrallocPreloader() { GrallocLoader::loadModule(); }
+};
+static GrallocPreloader sGrallocPreloader;
+
extern "C" IMapper* HIDL_FETCH_IMapper(const char* /*name*/) {
return GrallocLoader::load();
}
diff --git a/graphics/mapper/2.1/default/passthrough.cpp b/graphics/mapper/2.1/default/passthrough.cpp
index c7f0cf5..c99c984 100644
--- a/graphics/mapper/2.1/default/passthrough.cpp
+++ b/graphics/mapper/2.1/default/passthrough.cpp
@@ -19,6 +19,14 @@
using android::hardware::graphics::mapper::V2_1::IMapper;
using android::hardware::graphics::mapper::V2_1::passthrough::GrallocLoader;
+// Preload the gralloc module such that GraphicBufferMapper::preloadHal is
+// meaningful
+class GrallocPreloader {
+public:
+ GrallocPreloader() { GrallocLoader::loadModule(); }
+};
+static GrallocPreloader sGrallocPreloader;
+
extern "C" IMapper* HIDL_FETCH_IMapper(const char* /*name*/) {
return GrallocLoader::load();
}
diff --git a/keymaster/4.0/vts/performance/Benchmark.cpp b/keymaster/4.0/vts/performance/Benchmark.cpp
index 96ef5bf..e5fdff2 100644
--- a/keymaster/4.0/vts/performance/Benchmark.cpp
+++ b/keymaster/4.0/vts/performance/Benchmark.cpp
@@ -315,7 +315,7 @@
SecurityLevel getSecurityLevel() { return securityLevel_; }
- const string& GenerateMessage(int size) {
+ const string GenerateMessage(int size) {
for (const string& message : message_cache_) {
if (message.size() == size) {
return message;
@@ -323,7 +323,7 @@
}
string message = string(size, 'x');
message_cache_.push_back(message);
- return std::move(message);
+ return message;
}
optional<BlockMode> getBlockMode(string transform) {
@@ -714,4 +714,4 @@
return 1;
}
::benchmark::RunSpecifiedBenchmarks();
-}
\ No newline at end of file
+}
diff --git a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp
old mode 100755
new mode 100644
index 00e9837..d80e651
--- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp
+++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp
@@ -374,21 +374,16 @@
}
}
-static int getFirstApiLevel() {
- int boardApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0);
- if (boardApiLevel != 0) {
- return boardApiLevel;
- }
-
- return android::base::GetIntProperty("ro.product.first_api_level", __ANDROID_API_T__);
-}
-
static bool isTV() {
return testing::deviceSupportsFeature("android.software.leanback");
}
// list components and roles.
TEST_P(StoreHidlTest, OmxCodecAllowedTest) {
+ static int sBoardFirstApiLevel = android::base::GetIntProperty("ro.board.first_api_level", 0);
+ if (sBoardFirstApiLevel == 0) {
+ GTEST_SKIP() << "board first API level not detected";
+ }
hidl_vec<IOmx::ComponentInfo> componentInfos = getComponentInfoList(omx);
for (IOmx::ComponentInfo info : componentInfos) {
for (std::string role : info.mRoles) {
@@ -396,27 +391,27 @@
role.find("video_encoder") != std::string::npos) {
// Codec2 is not mandatory on Android TV devices that launched with Android S
if (isTV()) {
- ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__)
+ ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_T__)
<< " Component: " << info.mName.c_str() << " Role: " << role.c_str()
<< " not allowed for devices launching with Android T and above";
} else {
std::string codecName = info.mName;
bool isAndroidCodec = (codecName.rfind("OMX.google", 0) != std::string::npos);
- if (isAndroidCodec && (getFirstApiLevel() <= __ANDROID_API_S__)) {
+ if (isAndroidCodec && (sBoardFirstApiLevel <= __ANDROID_API_S__)) {
// refer b/230582620
// S AOSP build did not remove the OMX.google video codecs
// so it is infeasible to require no OMX.google.* video codecs
// on S launching devices
} else {
- ASSERT_LT(getFirstApiLevel(), __ANDROID_API_S__)
- << " Component: " << info.mName.c_str() << " Role: " << role.c_str()
- << " not allowed for devices launching with Android S and above";
+ ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_S__)
+ << " Component: " << info.mName.c_str() << " Role: " << role.c_str()
+ << " not allowed for devices launching with Android S and above";
}
}
}
if (role.find("audio_decoder") != std::string::npos ||
role.find("audio_encoder") != std::string::npos) {
- ASSERT_LT(getFirstApiLevel(), __ANDROID_API_T__)
+ ASSERT_LT(sBoardFirstApiLevel, __ANDROID_API_T__)
<< " Component: " << info.mName.c_str() << " Role: " << role.c_str()
<< " not allowed for devices launching with Android T and above";
}
diff --git a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
index b9ce9d1..8c0dd6d 100644
--- a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
+++ b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
@@ -123,6 +123,9 @@
/**
* Transmits an APDU command (as per ISO/IEC 7816) to the SE.
*
+ * @throws ServiceSpecificException with code CHANNEL_NOT_AVAILABLE
+ * if there was an error in communicating with the secure element.
+ *
* @param data APDU command to be sent
* @return response to the command
*/
diff --git a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
index 2e96f7d..0925a21 100644
--- a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
+++ b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
@@ -136,18 +136,27 @@
apdu[0] |= (channel_number - 4) | 0x40;
}
- EXPECT_OK(secure_element_->transmit(apdu, &response));
+ // transmit() will return an empty response with the error
+ // code CHANNEL_NOT_AVAILABLE when the SE cannot be
+ // communicated with.
+ auto status = secure_element_->transmit(apdu, &response);
+ if (!status.isOk()) {
+ return 0x6881;
+ }
+
+ // transmit() will return a response containing at least
+ // the APDU response status otherwise.
EXPECT_GE(response.size(), 2u);
- uint16_t status =
+ uint16_t apdu_status =
(response[response.size() - 2] << 8) | (response[response.size() - 1] << 0);
// When the command is successful the response
// must contain 256 bytes of data.
- if (status == 0x9000) {
+ if (apdu_status == 0x9000) {
EXPECT_EQ(response.size(), 258);
}
- return status;
+ return apdu_status;
}
std::shared_ptr<ISecureElement> secure_element_;
diff --git a/security/dice/aidl/Android.bp b/security/dice/aidl/Android.bp
deleted file mode 100644
index 5625d70..0000000
--- a/security/dice/aidl/Android.bp
+++ /dev/null
@@ -1,59 +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 {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-aidl_interface {
- name: "android.hardware.security.dice",
- vendor_available: true,
- srcs: [
- "android/hardware/security/dice/*.aidl",
- ],
- stability: "vintf",
- backend: {
- java: {
- enabled: false,
- platform_apis: false,
- },
- ndk: {
- apps_enabled: false,
- apex_available: [
- "//apex_available:platform",
- "com.android.compos",
- ],
- },
- rust: {
- enabled: true,
- apex_available: [
- "//apex_available:platform",
- "com.android.compos",
- ],
- },
- },
- versions_with_info: [
- {
- version: "1",
- imports: [],
- },
- ],
-
- // versions: ["1"],
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash
deleted file mode 100644
index 3f08fd8..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/.hash
+++ /dev/null
@@ -1 +0,0 @@
-02994f275fd7b1b40610c10eaeb0573f4312e358
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl
deleted file mode 100644
index 5af7358..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Bcc.aidl
+++ /dev/null
@@ -1,39 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Bcc {
- byte[] data;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.aidl
deleted file mode 100644
index 8baca94..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/BccHandover.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.
- */
-///////////////////////////////////////////////////////////////////////////////
-// 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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable BccHandover {
- byte[32] cdiAttest;
- byte[32] cdiSeal;
- android.hardware.security.dice.Bcc bcc;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl
deleted file mode 100644
index 78dd2f8..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Config.aidl
+++ /dev/null
@@ -1,39 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Config {
- byte[] desc;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.aidl
deleted file mode 100644
index 383f4d1..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/IDiceDevice.aidl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 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.security.dice;
-/* @hide */
-@SensitiveData @VintfStability
-interface IDiceDevice {
- android.hardware.security.dice.Signature sign(in android.hardware.security.dice.InputValues[] id, in byte[] payload);
- android.hardware.security.dice.Bcc getAttestationChain(in android.hardware.security.dice.InputValues[] inputValues);
- android.hardware.security.dice.BccHandover derive(in android.hardware.security.dice.InputValues[] inputValues);
- void demote(in android.hardware.security.dice.InputValues[] inputValues);
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl
deleted file mode 100644
index e43c429..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/InputValues.aidl
+++ /dev/null
@@ -1,44 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable InputValues {
- byte[64] codeHash;
- android.hardware.security.dice.Config config;
- byte[64] authorityHash;
- @nullable byte[] authorityDescriptor;
- android.hardware.security.dice.Mode mode = android.hardware.security.dice.Mode.NOT_INITIALIZED;
- byte[64] hidden;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl
deleted file mode 100644
index 295c32e..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/Mode.aidl
+++ /dev/null
@@ -1,42 +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.security.dice;
-/* @hide */
-@Backing(type="int") @VintfStability
-enum Mode {
- NOT_INITIALIZED = 0,
- NORMAL = 1,
- DEBUG = 2,
- RECOVERY = 3,
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl
deleted file mode 100644
index c13afa6..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/1/android/hardware/security/dice/ResponseCode.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 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 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.security.dice;
-@Backing(type="int") @VintfStability
-enum ResponseCode {
- PERMISSION_DENIED = 1,
- SYSTEM_ERROR = 2,
- NOT_IMPLEMENTED = 3,
- DEMOTION_FAILED = 4,
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Bcc.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Bcc.aidl
deleted file mode 100644
index 5af7358..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Bcc.aidl
+++ /dev/null
@@ -1,39 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Bcc {
- byte[] data;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/BccHandover.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/BccHandover.aidl
deleted file mode 100644
index 8baca94..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/BccHandover.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.
- */
-///////////////////////////////////////////////////////////////////////////////
-// 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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable BccHandover {
- byte[32] cdiAttest;
- byte[32] cdiSeal;
- android.hardware.security.dice.Bcc bcc;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Config.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Config.aidl
deleted file mode 100644
index 78dd2f8..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Config.aidl
+++ /dev/null
@@ -1,39 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Config {
- byte[] desc;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/IDiceDevice.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/IDiceDevice.aidl
deleted file mode 100644
index 383f4d1..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/IDiceDevice.aidl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 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.security.dice;
-/* @hide */
-@SensitiveData @VintfStability
-interface IDiceDevice {
- android.hardware.security.dice.Signature sign(in android.hardware.security.dice.InputValues[] id, in byte[] payload);
- android.hardware.security.dice.Bcc getAttestationChain(in android.hardware.security.dice.InputValues[] inputValues);
- android.hardware.security.dice.BccHandover derive(in android.hardware.security.dice.InputValues[] inputValues);
- void demote(in android.hardware.security.dice.InputValues[] inputValues);
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/InputValues.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/InputValues.aidl
deleted file mode 100644
index e43c429..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/InputValues.aidl
+++ /dev/null
@@ -1,44 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable InputValues {
- byte[64] codeHash;
- android.hardware.security.dice.Config config;
- byte[64] authorityHash;
- @nullable byte[] authorityDescriptor;
- android.hardware.security.dice.Mode mode = android.hardware.security.dice.Mode.NOT_INITIALIZED;
- byte[64] hidden;
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Mode.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Mode.aidl
deleted file mode 100644
index 295c32e..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Mode.aidl
+++ /dev/null
@@ -1,42 +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.security.dice;
-/* @hide */
-@Backing(type="int") @VintfStability
-enum Mode {
- NOT_INITIALIZED = 0,
- NORMAL = 1,
- DEBUG = 2,
- RECOVERY = 3,
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/ResponseCode.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/ResponseCode.aidl
deleted file mode 100644
index c13afa6..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/ResponseCode.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 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 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.security.dice;
-@Backing(type="int") @VintfStability
-enum ResponseCode {
- PERMISSION_DENIED = 1,
- SYSTEM_ERROR = 2,
- NOT_IMPLEMENTED = 3,
- DEMOTION_FAILED = 4,
-}
diff --git a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Signature.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Signature.aidl
deleted file mode 100644
index 294170d..0000000
--- a/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Signature.aidl
+++ /dev/null
@@ -1,39 +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.security.dice;
-/* @hide */
-@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
-parcelable Signature {
- byte[] data;
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/Bcc.aidl b/security/dice/aidl/android/hardware/security/dice/Bcc.aidl
deleted file mode 100644
index 983915e..0000000
--- a/security/dice/aidl/android/hardware/security/dice/Bcc.aidl
+++ /dev/null
@@ -1,36 +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.security.dice;
-
-/**
- * A DICE certificate chain following the Boot Certificate Chain (BCC) specification.
- * @hide
- */
-@VintfStability
-@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
-parcelable Bcc {
- /**
- * The DICE certificate chain CBOR encoded following the BCC specification. The CDDL
- * specification for BCC can be found here [1].
- *
- * @see <a
- * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl">
- * BCC CDDL specification
- * </a>
- */
- byte[] data;
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/BccHandover.aidl b/security/dice/aidl/android/hardware/security/dice/BccHandover.aidl
deleted file mode 100644
index 6ca862c..0000000
--- a/security/dice/aidl/android/hardware/security/dice/BccHandover.aidl
+++ /dev/null
@@ -1,46 +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.security.dice;
-
-import android.hardware.security.dice.Bcc;
-
-/**
- * Represents one set of DICE artifacts.
- *
- * @hide
- */
-@VintfStability
-@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
-parcelable BccHandover {
- /**
- * CDI_attest. Must be exactly 32 bytes of data.
- */
- byte[32] cdiAttest;
- /**
- * CDI_seal. Must be exactly 32 bytes of data.
- */
- byte[32] cdiSeal;
- /**
- * CBOR encoded BCC.
- *
- * @see <a
- * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl">
- * BCC CDDL specification
- * </a>
- */
- Bcc bcc;
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/Config.aidl b/security/dice/aidl/android/hardware/security/dice/Config.aidl
deleted file mode 100644
index 6decfc5..0000000
--- a/security/dice/aidl/android/hardware/security/dice/Config.aidl
+++ /dev/null
@@ -1,38 +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.security.dice;
-
-/**
- * DICE config descriptor as described in at
- * <a
- * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#input-values">
- * input-values
- * </a>
- * @hide
- */
-@VintfStability
-@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
-parcelable Config {
- /**
- * A free form descriptor. This should follow the BCC Configuration Descriptor.
- * @see <a
- * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl">
- * BccPayload field -4670548
- * </a>
- */
- byte[] desc;
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/IDiceDevice.aidl b/security/dice/aidl/android/hardware/security/dice/IDiceDevice.aidl
deleted file mode 100644
index 709aede..0000000
--- a/security/dice/aidl/android/hardware/security/dice/IDiceDevice.aidl
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 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.security.dice;
-
-import android.hardware.security.dice.Bcc;
-import android.hardware.security.dice.BccHandover;
-import android.hardware.security.dice.InputValues;
-import android.hardware.security.dice.Signature;
-
-/**
- * IDiceDevice specifies an interface that allows access to the Android instance's DICE artifacts.
- *
- * <h2>Features</h2>
- *
- * The dice device provides access to the component's CDI_SEAL and CDI_ATTEST secrets as well
- * as to its attestation certificate chain. The "component" is the Android instance running this
- * HAL service and the secrets and attestation chain must include all boot stage components,
- * the kernel, and the verified boot information (VBA).
- *
- * Implementations provide the following operations:
- * <li> sign - Signing a payload with a key derived from CDI_ATTEST.
- * <li> getAttestationChain - Retrieve the component's attestation certificate chain.
- * <li> derive - Retrieve the component's DICE artifacts.
- *
- * @see <a
- * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md">
- * Open-dice Specification
- * </a>
- * @see <a
- * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl">
- * Boot Certificate Chain (BCC) CDDL specification
- * </a>
- * @hide
- */
-@SensitiveData
-@VintfStability
-interface IDiceDevice {
- /**
- * Uses the a key derived from the component's, or a child's given by <code>inputValues</code>,
- * attestation secret to sign the payload using RFC 8032 Pure Ed25519 and returns the
- * signature. The payload is limited to 1024 bytes.
- *
- * @see <a href="https://datatracker.ietf.org/doc/html/rfc8032">RFC 8032</a>
- */
- Signature sign(in InputValues[] id, in byte[] payload);
-
- /**
- * Returns the attestation chain of the component if <code>inputValues</code> is empty or the
- * chain to the given child of the component identified by the <code>inputValues</code> vector.
- *
- * ## Error as service specific exception:
- * ResponseCode::PERMISSION_DENIED if the caller is not sufficiently privileged.
- */
- Bcc getAttestationChain(in InputValues[] inputValues);
-
- /**
- * This function allows a client to become a resident node. A resident node is a node that
- * manages its own dice secrets as opposed to using them by proxy, i.e., by calling sign
- * and getAttestationChain. Called with empty <code>inputValues</code> vectors, an
- * implementation returns the component's DICE secrets. If the <code>inputValues</code> vector
- * is given the appropriate derivations are performed starting from the component's level.
- *
- * ## Error as service specific exception:
- * ResponseCode::PERMISSION_DENIED if the implementation does not allow resident nodes
- * at the client's level.
- */
- BccHandover derive(in InputValues[] inputValues);
-
- /**
- * This demotes the implementation of this interface.
- * When called, the implementation performs appropriate derivation steps using
- * <code>inputValues</code>, traversing the vector in ascending order. Then it replaces its
- * stored DICE artifacts with the newly derived ones.
- *
- * IMPORTANT: When the function returns, all remnants of the previous DICE artifacts must
- * have been purged from memory.
- *
- * This operation is not reversible until the next reboot. Further demotion is always
- * possible.
- *
- * ## Error as service specific exception:
- * ResponseCode::DEMOTION_FAILED if the implementation failed to demote itself
- * or was unable to purge previous DICE artifacts from memory.
- */
- void demote(in InputValues[] inputValues);
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/InputValues.aidl b/security/dice/aidl/android/hardware/security/dice/InputValues.aidl
deleted file mode 100644
index 711d523..0000000
--- a/security/dice/aidl/android/hardware/security/dice/InputValues.aidl
+++ /dev/null
@@ -1,58 +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.security.dice;
-
-import android.hardware.security.dice.Config;
-import android.hardware.security.dice.Mode;
-
-/**
- * DICE input values for certificate and CDI generation.
- *
- * @see <a
- * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#input-values">
- * Open-dice input-values
- * </a>
- * @hide
- */
-@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
-@VintfStability
-parcelable InputValues {
- /**
- * The target code hash. Must be exactly 64 bytes.
- */
- byte[64] codeHash;
- /**
- * The configuration data.
- */
- Config config;
- /**
- * The authority hash. Must be exactly 64 bytes. Must be all zero if unused.
- */
- byte[64] authorityHash;
- /**
- * Optional free form authorityDescriptor.
- */
- @nullable byte[] authorityDescriptor;
- /**
- * The mode of operation. Normal, Debug, Maintenance, or not initialized.
- */
- Mode mode = Mode.NOT_INITIALIZED;
- /**
- * Optional hidden values. Must be exactly 64 bytes. Must be all zero if unused.
- */
- byte[64] hidden;
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/Mode.aidl b/security/dice/aidl/android/hardware/security/dice/Mode.aidl
deleted file mode 100644
index 3b3bfdc..0000000
--- a/security/dice/aidl/android/hardware/security/dice/Mode.aidl
+++ /dev/null
@@ -1,38 +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.security.dice;
-
-/**
- * DICE mode values as defined at
- *
- * @see <a
- * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#mode-value-details">
- * open-dice mode-value-details
- * </a>
- * @hide
- */
-@Backing(type="int")
-@VintfStability
-enum Mode {
- NOT_INITIALIZED = 0,
- NORMAL = 1,
- DEBUG = 2,
- /**
- * The recovery mode is also referred to as "maintenance" mode.
- */
- RECOVERY = 3,
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/ResponseCode.aidl b/security/dice/aidl/android/hardware/security/dice/ResponseCode.aidl
deleted file mode 100644
index 3e77cf7..0000000
--- a/security/dice/aidl/android/hardware/security/dice/ResponseCode.aidl
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 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.
- */
-
-package android.hardware.security.dice;
-
-@Backing(type="int")
-/**
- * These response codes are used as service specific exception codes by
- * IDiceDevice.
- * @hide
- */
-@VintfStability
-enum ResponseCode {
- /**
- * The caller has insufficient privilege to access the DICE API.
- */
- PERMISSION_DENIED = 1,
- /**
- * An unexpected error occurred, likely with IO or IPC.
- */
- SYSTEM_ERROR = 2,
- /**
- * Returned if the called function is not implemented.
- */
- NOT_IMPLEMENTED = 3,
- /**
- * An attempt to demote the implementation failed.
- */
- DEMOTION_FAILED = 4,
-}
diff --git a/security/dice/aidl/android/hardware/security/dice/Signature.aidl b/security/dice/aidl/android/hardware/security/dice/Signature.aidl
deleted file mode 100644
index ea3594f..0000000
--- a/security/dice/aidl/android/hardware/security/dice/Signature.aidl
+++ /dev/null
@@ -1,32 +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.security.dice;
-
-/**
- * This parcelable represents a Signature. It is used as return value of IDiceNode::sign.
- *
- * @hide
- */
-@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
-@VintfStability
-parcelable Signature {
- /**
- * The RFC 8032 PureEd25519 signature.
- * @see <a href="https://datatracker.ietf.org/doc/html/rfc8032">RFC 8032</a>
- */
- byte[] data;
-}
diff --git a/security/dice/aidl/default/Android.bp b/security/dice/aidl/default/Android.bp
deleted file mode 100644
index 5ff4847..0000000
--- a/security/dice/aidl/default/Android.bp
+++ /dev/null
@@ -1,29 +0,0 @@
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-rust_binary {
- name: "android.hardware.security.dice-service.non-secure-software",
- srcs: ["service.rs"],
- relative_install_path: "hw",
- vendor: true,
- rustlibs: [
- "android.hardware.security.dice-V1-rust",
- "libdiced_sample_inputs",
- "libdiced_vendor",
- "libandroid_logger",
- "libanyhow",
- "libbinder_rs",
- "liblog_rust",
- "libserde",
- ],
- init_rc: ["android.hardware.security.dice-service.non-secure-software.rc"],
- vintf_fragments: [
- "android.hardware.security.dice-service.non-secure-software.xml",
- ],
-}
diff --git a/security/dice/aidl/default/android.hardware.security.dice-service.non-secure-software.rc b/security/dice/aidl/default/android.hardware.security.dice-service.non-secure-software.rc
deleted file mode 100644
index 28e43c3..0000000
--- a/security/dice/aidl/default/android.hardware.security.dice-service.non-secure-software.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-service vendor.dice /vendor/bin/hw/android.hardware.security.dice-service.non-secure-software
- class early_hal
- user nobody
- # The diced HAL cannot be allowed to restart. When it crashes for any reason.
- # it loses security critical state. The only remedy is to restart the device.
- # This may be implementation depended. It is safe to restart the HAL if the
- # state change during a call to "demote" is is preserved.
- # see android/hardware/security/dice/IDiceDevice.aidl for details on "demote".
- oneshot
diff --git a/security/dice/aidl/default/android.hardware.security.dice-service.non-secure-software.xml b/security/dice/aidl/default/android.hardware.security.dice-service.non-secure-software.xml
deleted file mode 100644
index 94ef243..0000000
--- a/security/dice/aidl/default/android.hardware.security.dice-service.non-secure-software.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<manifest version="1.0" type="device">
- <hal format="aidl">
- <name>android.hardware.security.dice</name>
- <fqname>IDiceDevice/default</fqname>
- </hal>
-</manifest>
\ No newline at end of file
diff --git a/security/dice/aidl/default/service.rs b/security/dice/aidl/default/service.rs
deleted file mode 100644
index 4363e91..0000000
--- a/security/dice/aidl/default/service.rs
+++ /dev/null
@@ -1,108 +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.
-
-//! Main entry point for the android.hardware.security.dice service.
-
-use anyhow::{anyhow, Result};
-use diced::{
- dice,
- hal_node::{DiceArtifacts, DiceDevice, ResidentHal, UpdatableDiceArtifacts},
-};
-use diced_sample_inputs::make_sample_bcc_and_cdis;
-use serde::{Deserialize, Serialize};
-use std::panic;
-use std::sync::Arc;
-
-static DICE_HAL_SERVICE_NAME: &str = "android.hardware.security.dice.IDiceDevice/default";
-
-#[derive(Debug, Serialize, Deserialize, Clone)]
-struct InsecureSerializableArtifacts {
- cdi_attest: [u8; dice::CDI_SIZE],
- cdi_seal: [u8; dice::CDI_SIZE],
- bcc: Vec<u8>,
-}
-
-impl DiceArtifacts for InsecureSerializableArtifacts {
- fn cdi_attest(&self) -> &[u8; dice::CDI_SIZE] {
- &self.cdi_attest
- }
- fn cdi_seal(&self) -> &[u8; dice::CDI_SIZE] {
- &self.cdi_seal
- }
- fn bcc(&self) -> Option<&[u8]> {
- Some(&self.bcc)
- }
-}
-
-impl UpdatableDiceArtifacts for InsecureSerializableArtifacts {
- fn with_artifacts<F, T>(&self, f: F) -> Result<T>
- where
- F: FnOnce(&dyn DiceArtifacts) -> Result<T>,
- {
- f(self)
- }
- fn update(self, new_artifacts: &impl DiceArtifacts) -> Result<Self> {
- Ok(Self {
- cdi_attest: *new_artifacts.cdi_attest(),
- cdi_seal: *new_artifacts.cdi_seal(),
- bcc: new_artifacts
- .bcc()
- .ok_or_else(|| anyhow!("bcc is none"))?
- .to_vec(),
- })
- }
-}
-
-fn main() {
- android_logger::init_once(
- android_logger::Config::default()
- .with_tag("android.hardware.security.dice")
- .with_min_level(log::Level::Debug),
- );
- // Redirect panic messages to logcat.
- panic::set_hook(Box::new(|panic_info| {
- log::error!("{}", panic_info);
- }));
-
- // Saying hi.
- log::info!("android.hardware.security.dice is starting.");
-
- let dice_artifacts =
- make_sample_bcc_and_cdis().expect("Failed to construct sample dice chain.");
- let mut cdi_attest = [0u8; dice::CDI_SIZE];
- cdi_attest.copy_from_slice(dice_artifacts.cdi_attest());
- let mut cdi_seal = [0u8; dice::CDI_SIZE];
- cdi_seal.copy_from_slice(dice_artifacts.cdi_seal());
- let hal_impl = Arc::new(
- unsafe {
- // Safety: ResidentHal cannot be used in multi threaded processes.
- // This service does not start a thread pool. The main thread is the only thread
- // joining the thread pool, thereby keeping the process single threaded.
- ResidentHal::new(InsecureSerializableArtifacts {
- cdi_attest,
- cdi_seal,
- bcc: dice_artifacts.bcc().expect("bcc is none").to_vec(),
- })
- }
- .expect("Failed to create ResidentHal implementation."),
- );
-
- let hal = DiceDevice::new_as_binder(hal_impl).expect("Failed to construct hal service.");
-
- binder::add_service(DICE_HAL_SERVICE_NAME, hal.as_binder())
- .expect("Failed to register IDiceDevice Service");
-
- log::info!("Joining thread pool now.");
- binder::ProcessState::join_thread_pool();
-}
diff --git a/security/dice/aidl/vts/functional/Android.bp b/security/dice/aidl/vts/functional/Android.bp
deleted file mode 100644
index 2a85a19..0000000
--- a/security/dice/aidl/vts/functional/Android.bp
+++ /dev/null
@@ -1,54 +0,0 @@
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-rust_test {
- name: "VtsAidlDiceTargetTest",
- srcs: [
- "dice_test.rs",
- ],
- require_root: true,
- auto_gen_config: true,
- test_suites: [
- "general-tests",
- "vts",
- ],
-
- rustlibs: [
- "android.hardware.security.dice-V1-rust",
- "libanyhow",
- "libbinder_rs",
- "libdiced_open_dice",
- "libdiced_sample_inputs",
- "libdiced_utils",
- "libkeystore2_vintf_rust",
- ],
-}
-
-rust_test {
- name: "VtsAidlDiceDemoteTargetTest",
- srcs: [
- "dice_demote_test.rs",
- ],
-
- test_config: "VtsAidlDiceDemoteTargetTest.xml",
- test_suites: [
- "general-tests",
- "vts",
- ],
-
- rustlibs: [
- "android.hardware.security.dice-V1-rust",
- "libanyhow",
- "libbinder_rs",
- "libdiced_open_dice",
- "libdiced_sample_inputs",
- "libdiced_utils",
- "libkeystore2_vintf_rust",
- ],
-}
diff --git a/security/dice/aidl/vts/functional/VtsAidlDiceDemoteTargetTest.xml b/security/dice/aidl/vts/functional/VtsAidlDiceDemoteTargetTest.xml
deleted file mode 100644
index 2991580..0000000
--- a/security/dice/aidl/vts/functional/VtsAidlDiceDemoteTargetTest.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-
-<configuration description="Config to run VtsAidlDiceDemoteTargetTest device tests.">
-
- <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
- </target_preparer>
-
- <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
- <option name="cleanup" value="true" />
- <option name="push" value="VtsAidlDiceDemoteTargetTest->/data/local/tmp/VtsAidlDiceDemoteTargetTest" />
- </target_preparer>
-
- <test class="com.android.tradefed.testtype.rust.RustBinaryTest" >
- <option name="test-device-path" value="/data/local/tmp" />
- <option name="module-name" value="VtsAidlDiceDemoteTargetTest" />
- </test>
- <target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer" />
-
-</configuration>
\ No newline at end of file
diff --git a/security/dice/aidl/vts/functional/dice_demote_test.rs b/security/dice/aidl/vts/functional/dice_demote_test.rs
deleted file mode 100644
index 49aea67..0000000
--- a/security/dice/aidl/vts/functional/dice_demote_test.rs
+++ /dev/null
@@ -1,59 +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.
-
-use diced_open_dice::DiceArtifacts;
-use diced_sample_inputs;
-use diced_utils;
-use std::convert::TryInto;
-
-mod utils;
-use utils::with_connection;
-
-// This test calls derive with an empty argument vector, then demotes the HAL using
-// a set of three input values, and then calls derive with empty argument vector again.
-// It then performs the same three derivation steps on the result of the former and compares
-// the result to the result of the latter.
-#[test]
-fn demote_test() {
- with_connection(|device| {
- let input_values = diced_sample_inputs::get_input_values_vector();
- let former = device.derive(&[]).expect("Trying to call derive.");
- device
- .demote(&input_values)
- .expect("Trying to call demote with input values.");
-
- let latter = device
- .derive(&[])
- .expect("Trying to call derive after demote.");
-
- let artifacts = diced_utils::ResidentArtifacts::new(
- former.cdiAttest[..].try_into().unwrap(),
- former.cdiSeal[..].try_into().unwrap(),
- &former.bcc.data,
- )
- .unwrap();
-
- let artifacts = artifacts.execute_steps(input_values.iter()).unwrap();
- let from_former = diced_utils::make_bcc_handover(
- artifacts.cdi_attest(),
- artifacts.cdi_seal(),
- artifacts.bcc().expect("bcc is none"),
- )
- .unwrap();
- // TODO b/204938506 when we have a parser/verifier, check equivalence rather
- // than bit by bit equality.
- assert_eq!(latter, from_former);
- Ok(())
- })
-}
diff --git a/security/dice/aidl/vts/functional/dice_test.rs b/security/dice/aidl/vts/functional/dice_test.rs
deleted file mode 100644
index fbbdd81..0000000
--- a/security/dice/aidl/vts/functional/dice_test.rs
+++ /dev/null
@@ -1,73 +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.
-
-use diced_open_dice::DiceArtifacts;
-use diced_sample_inputs;
-use diced_utils;
-
-mod utils;
-use utils::with_connection;
-
-static TEST_MESSAGE: &[u8] = &[
- // "My test message!"
- 0x4d, 0x79, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x21,
- 0x0a,
-];
-
-// This test calls derive with an empty argument vector and with a set of three input values.
-// It then performs the same three derivation steps on the result of the former and compares
-// the result to the result of the latter.
-#[test]
-fn equivalence_test() {
- with_connection(|device| {
- let input_values = diced_sample_inputs::get_input_values_vector();
- let former = device.derive(&[]).expect("Trying to call derive.");
- let latter = device
- .derive(&input_values)
- .expect("Trying to call derive with input values.");
- let artifacts = diced_utils::ResidentArtifacts::new(
- former.cdiAttest[..].try_into().unwrap(),
- former.cdiSeal[..].try_into().unwrap(),
- &former.bcc.data,
- )
- .unwrap();
-
- let artifacts = artifacts.execute_steps(input_values.iter()).unwrap();
- let from_former = diced_utils::make_bcc_handover(
- artifacts.cdi_attest(),
- artifacts.cdi_seal(),
- artifacts.bcc().expect("bcc is none"),
- )
- .unwrap();
- // TODO b/204938506 when we have a parser/verifier, check equivalence rather
- // than bit by bit equality.
- assert_eq!(latter, from_former);
- Ok(())
- })
-}
-
-#[test]
-fn sign_and_verify() {
- with_connection(|device| {
- let _signature = device
- .sign(&[], TEST_MESSAGE)
- .expect("Trying to call sign.");
-
- let _bcc = device
- .getAttestationChain(&[])
- .expect("Trying to call getAttestationChain.");
- // TODO b/204938506 check the signature with the bcc when the verifier is available.
- Ok(())
- })
-}
diff --git a/security/dice/aidl/vts/functional/utils.rs b/security/dice/aidl/vts/functional/utils.rs
deleted file mode 100644
index 4e6708e..0000000
--- a/security/dice/aidl/vts/functional/utils.rs
+++ /dev/null
@@ -1,53 +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.
-
-use android_hardware_security_dice::aidl::android::hardware::security::dice::IDiceDevice::IDiceDevice;
-use anyhow::Result;
-use binder::Strong;
-use keystore2_vintf::get_aidl_instances;
-use std::sync::Arc;
-
-static DICE_DEVICE_SERVICE_NAME: &str = &"android.hardware.security.dice";
-static DICE_DEVICE_INTERFACE_NAME: &str = &"IDiceDevice";
-
-/// This function iterates through all announced IDiceDevice services and runs the given test
-/// closure against connections to each of them. It also modifies the panic hook to indicate
-/// on which instance the test failed in case the test closure panics.
-pub fn with_connection<R, F>(test: F)
-where
- F: Fn(&Strong<dyn IDiceDevice>) -> Result<R>,
-{
- let instances = get_aidl_instances(DICE_DEVICE_SERVICE_NAME, 1, DICE_DEVICE_INTERFACE_NAME);
- let panic_hook = Arc::new(std::panic::take_hook());
- for i in instances.into_iter() {
- let panic_hook_clone = panic_hook.clone();
- let instance_clone = i.clone();
- std::panic::set_hook(Box::new(move |v| {
- println!("While testing instance: \"{}\"", instance_clone);
- panic_hook_clone(v)
- }));
- let connection: Strong<dyn IDiceDevice> = binder::get_interface(&format!(
- "{}.{}/{}",
- DICE_DEVICE_SERVICE_NAME, DICE_DEVICE_INTERFACE_NAME, i
- ))
- .unwrap();
- test(&connection).unwrap();
- drop(std::panic::take_hook());
- }
- // Cannot call unwrap here because the panic hook is not Debug.
- std::panic::set_hook(match Arc::try_unwrap(panic_hook) {
- Ok(hook) => hook,
- _ => panic!("Failed to unwrap and reset previous panic hook."),
- })
-}
diff --git a/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp b/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp
index 0c61c25..49fd0c9 100644
--- a/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp
+++ b/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp
@@ -68,7 +68,7 @@
int getError() { return static_cast<int>(error_); }
- const string& GenerateMessage(int size) {
+ const string GenerateMessage(int size) {
for (const string& message : message_cache_) {
if (message.size() == size) {
return message;
@@ -76,7 +76,7 @@
}
string message = string(size, 'x');
message_cache_.push_back(message);
- return std::move(message);
+ return message;
}
optional<BlockMode> getBlockMode(string transform) {
diff --git a/tv/README.md b/tv/README.md
new file mode 100644
index 0000000..9a1c381
--- /dev/null
+++ b/tv/README.md
@@ -0,0 +1,8 @@
+# TV-related HIDL and AIDL HALs
+
+This directory bundles TV-related HALs in HIDL (legacy) and AIDL.
+
+- The 'tuner' directory contains the Tuner HIDL and AIDL HALs.
+- The 'input' directory contains the TV Input HIDL and AIDL HALs.
+- The 'cec' directory contains the CEC HIDL HAL.
+- The 'hdmi' directory contains the HDMI-related AIDL HALs, which includes the CEC AIDL HAL.
diff --git a/tv/hdmi/README.md b/tv/hdmi/README.md
new file mode 100644
index 0000000..183a3d0
--- /dev/null
+++ b/tv/hdmi/README.md
@@ -0,0 +1,11 @@
+# HDMI-related AIDL HALs for Android devices
+
+This directory bundles 3 HDMI-related AIDL HALs: HDMI Connection HAL, CEC HAL and eARC HAL.
+
+The HDMI Connection HAL contains general APIs for the HDMI Connection. These methods are required by
+the CEC and the eARC implementation. Therefore, devices that implement CEC need to support the HDMI
+Connection HAL and the CEC HAL. Devices that implement eARC need to support the HDMI Connection HAL
+and the eARC HAL.
+
+Other Android HALs are related to HDMI as well, but not included in this directory for historical
+reasons, e.g. Display HAL and TV Input HAL.
diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
index 08dc1ee..4f7e247 100644
--- a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
@@ -34,7 +34,7 @@
package android.hardware.tv.hdmi.cec;
@Backing(type="byte") @VintfStability
enum CecDeviceType {
- INACTIVE = -1,
+ INACTIVE = (-1) /* -1 */,
TV = 0,
RECORDER = 1,
TUNER = 3,
diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl
index 31ca895..20472f0 100644
--- a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl
@@ -34,78 +34,78 @@
package android.hardware.tv.hdmi.cec;
@Backing(type="int") @VintfStability
enum CecMessageType {
- FEATURE_ABORT = 0,
- IMAGE_VIEW_ON = 4,
- TUNER_STEP_INCREMENT = 5,
- TUNER_STEP_DECREMENT = 6,
- TUNER_DEVICE_STATUS = 7,
- GIVE_TUNER_DEVICE_STATUS = 8,
- RECORD_ON = 9,
- RECORD_STATUS = 10,
- RECORD_OFF = 11,
- TEXT_VIEW_ON = 13,
- RECORD_TV_SCREEN = 15,
- GIVE_DECK_STATUS = 26,
- DECK_STATUS = 27,
- SET_MENU_LANGUAGE = 50,
- CLEAR_ANALOG_TIMER = 51,
- SET_ANALOG_TIMER = 52,
- TIMER_STATUS = 53,
- STANDBY = 54,
- PLAY = 65,
- DECK_CONTROL = 66,
- TIMER_CLEARED_STATUS = 67,
- USER_CONTROL_PRESSED = 68,
- USER_CONTROL_RELEASED = 69,
- GIVE_OSD_NAME = 70,
- SET_OSD_NAME = 71,
- SET_OSD_STRING = 100,
- SET_TIMER_PROGRAM_TITLE = 103,
- SYSTEM_AUDIO_MODE_REQUEST = 112,
- GIVE_AUDIO_STATUS = 113,
- SET_SYSTEM_AUDIO_MODE = 114,
- REPORT_AUDIO_STATUS = 122,
- GIVE_SYSTEM_AUDIO_MODE_STATUS = 125,
- SYSTEM_AUDIO_MODE_STATUS = 126,
- ROUTING_CHANGE = 128,
- ROUTING_INFORMATION = 129,
- ACTIVE_SOURCE = 130,
- GIVE_PHYSICAL_ADDRESS = 131,
- REPORT_PHYSICAL_ADDRESS = 132,
- REQUEST_ACTIVE_SOURCE = 133,
- SET_STREAM_PATH = 134,
- DEVICE_VENDOR_ID = 135,
- VENDOR_COMMAND = 137,
- VENDOR_REMOTE_BUTTON_DOWN = 138,
- VENDOR_REMOTE_BUTTON_UP = 139,
- GIVE_DEVICE_VENDOR_ID = 140,
- MENU_REQUEST = 141,
- MENU_STATUS = 142,
- GIVE_DEVICE_POWER_STATUS = 143,
- REPORT_POWER_STATUS = 144,
- GET_MENU_LANGUAGE = 145,
- SELECT_ANALOG_SERVICE = 146,
- SELECT_DIGITAL_SERVICE = 147,
- SET_DIGITAL_TIMER = 151,
- CLEAR_DIGITAL_TIMER = 153,
- SET_AUDIO_RATE = 154,
- INACTIVE_SOURCE = 157,
- CEC_VERSION = 158,
- GET_CEC_VERSION = 159,
- VENDOR_COMMAND_WITH_ID = 160,
- CLEAR_EXTERNAL_TIMER = 161,
- SET_EXTERNAL_TIMER = 162,
- REPORT_SHORT_AUDIO_DESCRIPTOR = 163,
- REQUEST_SHORT_AUDIO_DESCRIPTOR = 164,
- INITIATE_ARC = 192,
- REPORT_ARC_INITIATED = 193,
- REPORT_ARC_TERMINATED = 194,
- REQUEST_ARC_INITIATION = 195,
- REQUEST_ARC_TERMINATION = 196,
- TERMINATE_ARC = 197,
- ABORT = 255,
- GIVE_FEATURES = 165,
- REPORT_FEATURES = 166,
- REQUEST_CURRENT_LATENCY = 167,
- REPORT_CURRENT_LATENCY = 168,
+ FEATURE_ABORT = 0x00,
+ IMAGE_VIEW_ON = 0x04,
+ TUNER_STEP_INCREMENT = 0x05,
+ TUNER_STEP_DECREMENT = 0x06,
+ TUNER_DEVICE_STATUS = 0x07,
+ GIVE_TUNER_DEVICE_STATUS = 0x08,
+ RECORD_ON = 0x09,
+ RECORD_STATUS = 0x0A,
+ RECORD_OFF = 0x0B,
+ TEXT_VIEW_ON = 0x0D,
+ RECORD_TV_SCREEN = 0x0F,
+ GIVE_DECK_STATUS = 0x1A,
+ DECK_STATUS = 0x1B,
+ SET_MENU_LANGUAGE = 0x32,
+ CLEAR_ANALOG_TIMER = 0x33,
+ SET_ANALOG_TIMER = 0x34,
+ TIMER_STATUS = 0x35,
+ STANDBY = 0x36,
+ PLAY = 0x41,
+ DECK_CONTROL = 0x42,
+ TIMER_CLEARED_STATUS = 0x43,
+ USER_CONTROL_PRESSED = 0x44,
+ USER_CONTROL_RELEASED = 0x45,
+ GIVE_OSD_NAME = 0x46,
+ SET_OSD_NAME = 0x47,
+ SET_OSD_STRING = 0x64,
+ SET_TIMER_PROGRAM_TITLE = 0x67,
+ SYSTEM_AUDIO_MODE_REQUEST = 0x70,
+ GIVE_AUDIO_STATUS = 0x71,
+ SET_SYSTEM_AUDIO_MODE = 0x72,
+ REPORT_AUDIO_STATUS = 0x7A,
+ GIVE_SYSTEM_AUDIO_MODE_STATUS = 0x7D,
+ SYSTEM_AUDIO_MODE_STATUS = 0x7E,
+ ROUTING_CHANGE = 0x80,
+ ROUTING_INFORMATION = 0x81,
+ ACTIVE_SOURCE = 0x82,
+ GIVE_PHYSICAL_ADDRESS = 0x83,
+ REPORT_PHYSICAL_ADDRESS = 0x84,
+ REQUEST_ACTIVE_SOURCE = 0x85,
+ SET_STREAM_PATH = 0x86,
+ DEVICE_VENDOR_ID = 0x87,
+ VENDOR_COMMAND = 0x89,
+ VENDOR_REMOTE_BUTTON_DOWN = 0x8A,
+ VENDOR_REMOTE_BUTTON_UP = 0x8B,
+ GIVE_DEVICE_VENDOR_ID = 0x8C,
+ MENU_REQUEST = 0x8D,
+ MENU_STATUS = 0x8E,
+ GIVE_DEVICE_POWER_STATUS = 0x8F,
+ REPORT_POWER_STATUS = 0x90,
+ GET_MENU_LANGUAGE = 0x91,
+ SELECT_ANALOG_SERVICE = 0x92,
+ SELECT_DIGITAL_SERVICE = 0x93,
+ SET_DIGITAL_TIMER = 0x97,
+ CLEAR_DIGITAL_TIMER = 0x99,
+ SET_AUDIO_RATE = 0x9A,
+ INACTIVE_SOURCE = 0x9D,
+ CEC_VERSION = 0x9E,
+ GET_CEC_VERSION = 0x9F,
+ VENDOR_COMMAND_WITH_ID = 0xA0,
+ CLEAR_EXTERNAL_TIMER = 0xA1,
+ SET_EXTERNAL_TIMER = 0xA2,
+ REPORT_SHORT_AUDIO_DESCRIPTOR = 0xA3,
+ REQUEST_SHORT_AUDIO_DESCRIPTOR = 0xA4,
+ INITIATE_ARC = 0xC0,
+ REPORT_ARC_INITIATED = 0xC1,
+ REPORT_ARC_TERMINATED = 0xC2,
+ REQUEST_ARC_INITIATION = 0xC3,
+ REQUEST_ARC_TERMINATION = 0xC4,
+ TERMINATE_ARC = 0xC5,
+ ABORT = 0xFF,
+ GIVE_FEATURES = 0xA5,
+ REPORT_FEATURES = 0xA6,
+ REQUEST_CURRENT_LATENCY = 0xA7,
+ REPORT_CURRENT_LATENCY = 0xA8,
}
diff --git a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
index 0881489..c6060d1 100644
--- a/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
@@ -41,7 +41,7 @@
int getPhysicalAddress();
int getVendorId();
android.hardware.tv.hdmi.cec.SendMessageResult sendMessage(in android.hardware.tv.hdmi.cec.CecMessage message);
- void setCallback(in android.hardware.tv.hdmi.cec.IHdmiCecCallback callback);
+ void setCallback(in @nullable android.hardware.tv.hdmi.cec.IHdmiCecCallback callback);
void setLanguage(in String language);
void enableWakeupByOtp(in boolean value);
void enableCec(in boolean value);
diff --git a/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
index 577c377..578d924 100644
--- a/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
@@ -77,7 +77,7 @@
* plugged off and on again. It is advised to call getPhysicalAddress to get
* the updated address when hot plug event takes place.
*
- * @param out addr Physical address of this device.
+ * @return Physical address of this device.
*/
int getPhysicalAddress();
@@ -116,7 +116,7 @@
* previously registered callback must be replaced with this one.
* setCallback(null) should deregister the callback.
*/
- void setCallback(in IHdmiCecCallback callback);
+ void setCallback(in @nullable IHdmiCecCallback callback);
/**
* Passes the updated language information of Android system. Contains
diff --git a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
index 98d1452..cf7c4bd 100644
--- a/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
@@ -37,6 +37,6 @@
android.hardware.tv.hdmi.connection.HdmiPortInfo[] getPortInfo();
boolean isConnected(in int portId);
void setCallback(in android.hardware.tv.hdmi.connection.IHdmiConnectionCallback callback);
- void setHpdSignal(android.hardware.tv.hdmi.connection.HpdSignal signal);
- android.hardware.tv.hdmi.connection.HpdSignal getHpdSignal();
+ void setHpdSignal(android.hardware.tv.hdmi.connection.HpdSignal signal, in int portId);
+ android.hardware.tv.hdmi.connection.HpdSignal getHpdSignal(in int portId);
}
diff --git a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
index 1d2ef4a..6bec7e5 100644
--- a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
@@ -24,10 +24,16 @@
@VintfStability
parcelable HdmiPortInfo {
HdmiPortType type;
- int portId; // Output ports should start from 1 which corresponds to HDMI "port 1".
+ int portId; // For devices with input ports (e.g. TV Panels), input ports should start from 1
+ // which corresponds to HDMI "port 1".
+
+ // In the following, 'supported' refers to having the necessary hardware and firmware on the
+ // device to support CEC/ARC/eARC on this port.
boolean cecSupported;
- boolean arcSupported;
+ boolean arcSupported; // If true, cecSupported has to be true as well. ARC cannot be supported
+ // without CEC support.
boolean eArcSupported;
+
// The physical address of the device connected to this port, valid range is 0x0000 to 0xFFFF
// (ref Sec 8.7.2 of HDMI 1.4b).
int physicalAddress;
diff --git a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
index c8759f2..ee6cc89 100644
--- a/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
@@ -55,16 +55,33 @@
* signaling EDID updates). By default, the HAL will use {@code HDMI_HPD_PHYSICAL} (the physical
* hotplug signal). When set to {@code HDMI_HPD_STATUS_BIT} the HAL should use the HDP status
* bit.
+ *
+ * This is only relevant to TV Panel devices that support eARC TX. While eARC TX is connected,
+ * the framework calls this method to set the HPD signal to {@code HDMI_HPD_STATUS_BIT}.
+ *
+ * For all other device types, this method can be stubbed.
+ *
+ * @param signal The HPD signal type to use.
+ * @param portId id of the port on which the HPD signal should be set.
+ *
* @throws ServiceSpecificException with error code set to
* {@code Result::FAILURE_NOT_SUPPORTED} if the signal type is not supported.
* {@code Result::FAILURE_INVALID_ARGS} if the signal type is invalid.
* {@code Result::FAILURE_UNKNOWN} if the signal type could not be set because of an
* unknown failure.
*/
- void setHpdSignal(HpdSignal signal);
+ void setHpdSignal(HpdSignal signal, in int portId);
/**
* Get the current signal the HAL is using for HPD
+ *
+ * This is only relevant to TV Panel devices that support eARC TX. While eARC TX is connected,
+ * this method returns {@code HDMI_HPD_STATUS_BIT}.
+ *
+ * For all other device types, this method can be stubbed by always returning
+ * {@code HDMI_HPD_PHYSICAL}.
+ *
+ * @param portId id of the port of which the current HPD signal is queried.
*/
- HpdSignal getHpdSignal();
+ HpdSignal getHpdSignal(in int portId);
}
diff --git a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
index db9f4c1..be6247b 100644
--- a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
+++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
@@ -69,18 +69,23 @@
return ScopedAStatus::ok();
}
-ScopedAStatus HdmiConnectionMock::setHpdSignal(HpdSignal signal) {
- if (mHdmiThreadRun) {
- mHpdSignal = signal;
- return ScopedAStatus::ok();
- } else {
+ScopedAStatus HdmiConnectionMock::setHpdSignal(HpdSignal signal, int32_t portId) {
+ if (portId > mTotalPorts || portId < 1) {
+ return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ if (!mHdmiThreadRun) {
return ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::FAILURE_INVALID_STATE));
}
+ mHpdSignal.at(portId - 1) = signal;
+ return ScopedAStatus::ok();
}
-ScopedAStatus HdmiConnectionMock::getHpdSignal(HpdSignal* _aidl_return) {
- *_aidl_return = mHpdSignal;
+ScopedAStatus HdmiConnectionMock::getHpdSignal(int32_t portId, HpdSignal* _aidl_return) {
+ if (portId > mTotalPorts || portId < 1) {
+ return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ *_aidl_return = mHpdSignal.at(portId - 1);
return ScopedAStatus::ok();
}
@@ -123,7 +128,7 @@
bool connected = ((msgBuf[3]) & 0xf) > 0;
int32_t portId = static_cast<uint32_t>(msgBuf[0] & 0xf);
- if (portId > static_cast<int32_t>(mPortInfos.size())) {
+ if (portId > static_cast<int32_t>(mPortInfos.size()) || portId < 1) {
ALOGD("[halimp_aidl] ignore hot plug message, id %x does not exist", portId);
return;
}
@@ -179,6 +184,7 @@
mCallback = nullptr;
mPortInfos.resize(mTotalPorts);
mPortConnectionStatus.resize(mTotalPorts);
+ mHpdSignal.resize(mTotalPorts);
mPortInfos[0] = {.type = HdmiPortType::OUTPUT,
.portId = static_cast<uint32_t>(1),
.cecSupported = true,
@@ -186,6 +192,7 @@
.eArcSupported = false,
.physicalAddress = mPhysicalAddress};
mPortConnectionStatus[0] = false;
+ mHpdSignal[0] = HpdSignal::HDMI_HPD_PHYSICAL;
mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(AIBinder_DeathRecipient_new(serviceDied));
}
diff --git a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
index b879e51..c013fdd 100644
--- a/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
+++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
@@ -46,8 +46,8 @@
::ndk::ScopedAStatus isConnected(int32_t portId, bool* _aidl_return) override;
::ndk::ScopedAStatus setCallback(
const std::shared_ptr<IHdmiConnectionCallback>& callback) override;
- ::ndk::ScopedAStatus setHpdSignal(HpdSignal signal) override;
- ::ndk::ScopedAStatus getHpdSignal(HpdSignal* _aidl_return) override;
+ ::ndk::ScopedAStatus setHpdSignal(HpdSignal signal, int32_t portId) override;
+ ::ndk::ScopedAStatus getHpdSignal(int32_t portId, HpdSignal* _aidl_return) override;
void printEventBuf(const char* msg_buf, int len);
@@ -70,7 +70,7 @@
int mTotalPorts = 1;
// HPD Signal being used
- HpdSignal mHpdSignal = HpdSignal::HDMI_HPD_PHYSICAL;
+ std::vector<HpdSignal> mHpdSignal;
// Testing variables
// Input file descriptor
diff --git a/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp b/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
index 69f7ef5..a9b288b 100644
--- a/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
+++ b/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
@@ -93,8 +93,8 @@
for (size_t i = 0; i < ports.size(); ++i) {
EXPECT_TRUE((ports[i].type == HdmiPortType::OUTPUT) ||
(ports[i].type == HdmiPortType::INPUT));
- if (ports[i].portId == 0) {
- ALOGW("%s: Port id should start from 1", __func__);
+ if (ports[i].type == HdmiPortType::OUTPUT && ports[i].portId <= 0) {
+ ALOGW("%s: Port id for output ports should start from 1", __func__);
}
cecSupportedOnDevice = cecSupportedOnDevice | ports[i].cecSupported;
}
@@ -111,16 +111,21 @@
}
TEST_P(HdmiConnectionTest, HdpSignal) {
+ std::vector<HdmiPortInfo> ports;
+ ASSERT_TRUE(hdmiConnection->getPortInfo(&ports).isOk());
HpdSignal originalSignal;
HpdSignal signal = HpdSignal::HDMI_HPD_STATUS_BIT;
- HpdSignal readSignal;
- ASSERT_TRUE(hdmiConnection->getHpdSignal(&originalSignal).isOk());
- ASSERT_TRUE(hdmiConnection->setHpdSignal(signal).isOk());
- ASSERT_TRUE(hdmiConnection->getHpdSignal(&readSignal).isOk());
- EXPECT_EQ(readSignal, signal);
- signal = HpdSignal::HDMI_HPD_PHYSICAL;
- ASSERT_TRUE(hdmiConnection->setHpdSignal(signal).isOk());
- ASSERT_TRUE(hdmiConnection->getHpdSignal(&readSignal).isOk());
- EXPECT_EQ(readSignal, signal);
- ASSERT_TRUE(hdmiConnection->setHpdSignal(originalSignal).isOk());
+ for (size_t i = 0; i < ports.size(); ++i) {
+ int32_t portId = ports[i].portId;
+ HpdSignal readSignal;
+ ASSERT_TRUE(hdmiConnection->getHpdSignal(portId, &originalSignal).isOk());
+ ASSERT_TRUE(hdmiConnection->setHpdSignal(signal, portId).isOk());
+ ASSERT_TRUE(hdmiConnection->getHpdSignal(portId, &readSignal).isOk());
+ EXPECT_EQ(readSignal, signal);
+ signal = HpdSignal::HDMI_HPD_PHYSICAL;
+ ASSERT_TRUE(hdmiConnection->setHpdSignal(signal, portId).isOk());
+ ASSERT_TRUE(hdmiConnection->getHpdSignal(portId, &readSignal).isOk());
+ EXPECT_EQ(readSignal, signal);
+ ASSERT_TRUE(hdmiConnection->setHpdSignal(originalSignal, portId).isOk());
+ }
}
diff --git a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
index 29d4ea9..6dcbd8d 100644
--- a/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
+++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
@@ -34,8 +34,8 @@
package android.hardware.tv.hdmi.earc;
@Backing(type="byte") @VintfStability
enum IEArcStatus {
- STATUS_IDLE = 0,
- STATUS_EARC_PENDING = 1,
- STATUS_ARC_PENDING = 2,
- STATUS_EARC_CONNECTED = 3,
+ IDLE = 0,
+ EARC_PENDING = 1,
+ ARC_PENDING = 2,
+ EARC_CONNECTED = 3,
}
diff --git a/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl
index a2dde6a..d9fb29c 100644
--- a/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl
@@ -20,7 +20,7 @@
import android.hardware.tv.hdmi.earc.IEArcStatus;
/**
- * eARC HAL interface definition
+ * eARC HAL interface definition. This is only relevant to TV Panels that implement eARC TX.
*/
@VintfStability
interface IEArc {
@@ -64,10 +64,11 @@
IEArcStatus getState(in int portId);
/**
- * Getter for the most recent capabilities reported by the device connected to port.
+ * Getter for the most recent audio capabilities reported by the device connected to port.
*
* @param portId The port ID on which the device is connected.
- * @return The raw, unparsed audio capabilities
+ * @return a byte array containing the raw, unparsed audio capabilities (Ref "Section 9.5.3.6 -
+ * eARC RX Capabilities Data Structure" in HDMI 2.1 specification).
*/
byte[] getLastReportedAudioCapabilities(in int portId);
}
diff --git a/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
index a11924b..ea77c54 100644
--- a/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
@@ -34,9 +34,9 @@
/**
* The callback function that must be called by the eARC driver and HAL implementation to
* notify the Android framework of the audio capabilities reported by the connected device. On
- * every state change to {@code STATUS_EARC_CONNECTED}, the driver shall read the capabilities
- * reported by the eARC RX. The onStateChange callback shall always be invoked first and the
- * onCapabilitiesReported callback shall be invoked second.
+ * every state change to {@code IEArcStatus::EARC_CONNECTED}, the driver shall read the
+ * capabilities reported by the eARC RX. The onStateChange callback shall always be invoked
+ * first and the onCapabilitiesReported callback shall be invoked second.
* @param rawCapabilities The raw unparsed audio capabilities (Ref "Section 9.5.3.6 - eARC RX
* Capabilities Data Structure" in HDMI 2.1 specification).
* @param portId The port ID for which the audio capabilities are being reported
diff --git a/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
index de1aaf1..5407434 100644
--- a/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
@@ -22,8 +22,8 @@
@VintfStability
@Backing(type="byte")
enum IEArcStatus {
- STATUS_IDLE = 0,
- STATUS_EARC_PENDING = 1,
- STATUS_ARC_PENDING = 2,
- STATUS_EARC_CONNECTED = 3,
+ IDLE = 0,
+ EARC_PENDING = 1,
+ ARC_PENDING = 2,
+ EARC_CONNECTED = 3,
}
diff --git a/tv/hdmi/earc/aidl/default/EArcMock.cpp b/tv/hdmi/earc/aidl/default/EArcMock.cpp
index 99a845e..93395fc 100644
--- a/tv/hdmi/earc/aidl/default/EArcMock.cpp
+++ b/tv/hdmi/earc/aidl/default/EArcMock.cpp
@@ -109,7 +109,7 @@
mCallback = nullptr;
mCapabilities.resize(mTotalPorts);
mPortStatus.resize(mTotalPorts);
- mPortStatus[0] = IEArcStatus::STATUS_IDLE;
+ mPortStatus[0] = IEArcStatus::IDLE;
mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(AIBinder_DeathRecipient_new(serviceDied));
}
diff --git a/tv/tuner/1.0/default/Dvr.cpp b/tv/tuner/1.0/default/Dvr.cpp
index 40879f2..9d6d86d 100644
--- a/tv/tuner/1.0/default/Dvr.cpp
+++ b/tv/tuner/1.0/default/Dvr.cpp
@@ -164,7 +164,7 @@
return false;
}
- mDvrMQ = move(tmpDvrMQ);
+ mDvrMQ = std::move(tmpDvrMQ);
if (EventFlag::createEventFlag(mDvrMQ->getEventFlagWord(), &mDvrEventFlag) != OK) {
return false;
diff --git a/tv/tuner/1.1/default/Dvr.cpp b/tv/tuner/1.1/default/Dvr.cpp
index fdb66c1..8262b4d 100644
--- a/tv/tuner/1.1/default/Dvr.cpp
+++ b/tv/tuner/1.1/default/Dvr.cpp
@@ -183,7 +183,7 @@
return false;
}
- mDvrMQ = move(tmpDvrMQ);
+ mDvrMQ = std::move(tmpDvrMQ);
if (EventFlag::createEventFlag(mDvrMQ->getEventFlagWord(), &mDvrEventFlag) != OK) {
return false;
diff --git a/usb/gadget/1.1/default/lib/MonitorFfs.cpp b/usb/gadget/1.1/default/lib/MonitorFfs.cpp
index 0cdf038..6d09a8a 100644
--- a/usb/gadget/1.1/default/lib/MonitorFfs.cpp
+++ b/usb/gadget/1.1/default/lib/MonitorFfs.cpp
@@ -59,9 +59,9 @@
if (addEpollFd(epollFd, eventFd) == -1) abort();
- mEpollFd = move(epollFd);
- mInotifyFd = move(inotifyFd);
- mEventFd = move(eventFd);
+ mEpollFd = std::move(epollFd);
+ mInotifyFd = std::move(inotifyFd);
+ mEventFd = std::move(eventFd);
gadgetPullup = false;
}
diff --git a/usb/gadget/1.2/default/lib/MonitorFfs.cpp b/usb/gadget/1.2/default/lib/MonitorFfs.cpp
index 0cdf038..6d09a8a 100644
--- a/usb/gadget/1.2/default/lib/MonitorFfs.cpp
+++ b/usb/gadget/1.2/default/lib/MonitorFfs.cpp
@@ -59,9 +59,9 @@
if (addEpollFd(epollFd, eventFd) == -1) abort();
- mEpollFd = move(epollFd);
- mInotifyFd = move(inotifyFd);
- mEventFd = move(eventFd);
+ mEpollFd = std::move(epollFd);
+ mInotifyFd = std::move(inotifyFd);
+ mEventFd = std::move(eventFd);
gadgetPullup = false;
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/.hash b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/.hash
index 856fa7c..42772bb 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/.hash
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/.hash
@@ -1 +1 @@
-39791e3a4bb9892a340e94e44860048624d2f66e
+590d9f45625a2c353011cf85f18d1d08593b8a0a
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index e2c06e5..0cc01c5 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/2/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -49,7 +49,7 @@
SUPPORTED_RANGE_DATA_NTF_CONFIG = 229,
SUPPORTED_RSSI_REPORTING = 230,
SUPPORTED_DIAGNOSTICS = 231,
- SUPPORTED_MIN_SLOT_DURATION_MS = 232,
+ SUPPORTED_MIN_SLOT_DURATION_RSTU = 232,
SUPPORTED_MAX_RANGING_SESSION_NUMBER = 233,
SUPPORTED_CHANNELS_AOA = 234,
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index e2c06e5..0cc01c5 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -49,7 +49,7 @@
SUPPORTED_RANGE_DATA_NTF_CONFIG = 229,
SUPPORTED_RSSI_REPORTING = 230,
SUPPORTED_DIAGNOSTICS = 231,
- SUPPORTED_MIN_SLOT_DURATION_MS = 232,
+ SUPPORTED_MIN_SLOT_DURATION_RSTU = 232,
SUPPORTED_MAX_RANGING_SESSION_NUMBER = 233,
SUPPORTED_CHANNELS_AOA = 234,
}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index bf59318..891b6f0 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -186,9 +186,9 @@
SUPPORTED_DIAGNOSTICS = 0xE7,
/**
- * 4 byte value to indicate supported min slot duration in ms.
+ * 4 byte value to indicate supported min slot duration in rstu.
*/
- SUPPORTED_MIN_SLOT_DURATION_MS = 0xE8,
+ SUPPORTED_MIN_SLOT_DURATION_RSTU = 0xE8,
/**
* Int value to indicate supported max number of fira ranging sessions