Merge "AHAL: add default values for dynamic port config of hardcoded config." into main
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 89d186c..3963ce3 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/common/Android.bp b/audio/aidl/common/Android.bp
index 85ece3b..5c0c685 100644
--- a/audio/aidl/common/Android.bp
+++ b/audio/aidl/common/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index fe386a2..8c6c537 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index c29bf79..c97a03e 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -15,7 +15,9 @@
*/
#include <memory>
+#define ATRACE_TAG ATRACE_TAG_AUDIO
#define LOG_TAG "AHAL_EffectImpl"
+#include <utils/Trace.h>
#include "effect-impl/EffectImpl.h"
#include "effect-impl/EffectTypes.h"
#include "include/effect-impl/EffectTypes.h"
@@ -298,6 +300,7 @@
}
void EffectImpl::process() {
+ ATRACE_CALL();
/**
* wait for the EventFlag without lock, it's ok because the mEfGroup pointer will not change
* in the life cycle of workerThread (threadLoop).
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index cf0870e..807348f 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -16,14 +16,14 @@
#include <pthread.h>
+#define ATRACE_TAG ATRACE_TAG_AUDIO
#define LOG_TAG "AHAL_Stream"
+#include <Utils.h>
#include <android-base/logging.h>
#include <android/binder_ibinder_platform.h>
#include <utils/SystemClock.h>
+#include <utils/Trace.h>
-#include <Utils.h>
-
-#include "core-impl/Module.h"
#include "core-impl/Stream.h"
using aidl::android::hardware::audio::common::AudioOffloadMetadata;
@@ -312,6 +312,7 @@
}
bool StreamInWorkerLogic::read(size_t clientSize, StreamDescriptor::Reply* reply) {
+ ATRACE_CALL();
StreamContext::DataMQ* const dataMQ = mContext->getDataMQ();
const size_t byteCount = std::min({clientSize, dataMQ->availableToWrite(), mDataBufferSize});
const bool isConnected = mIsConnected;
@@ -583,6 +584,7 @@
}
bool StreamOutWorkerLogic::write(size_t clientSize, StreamDescriptor::Reply* reply) {
+ ATRACE_CALL();
StreamContext::DataMQ* const dataMQ = mContext->getDataMQ();
const size_t readByteCount = dataMQ->availableToRead();
const size_t frameSize = mContext->getFrameSize();
diff --git a/audio/aidl/default/acousticEchoCanceler/Android.bp b/audio/aidl/default/acousticEchoCanceler/Android.bp
index d0404cd..46930e0 100644
--- a/audio/aidl/default/acousticEchoCanceler/Android.bp
+++ b/audio/aidl/default/acousticEchoCanceler/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/apex/com.android.hardware.audio/Android.bp b/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
index da84412..9c91e27 100644
--- a/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
+++ b/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/automaticGainControlV1/Android.bp b/audio/aidl/default/automaticGainControlV1/Android.bp
index 7b753eb..2fea719 100644
--- a/audio/aidl/default/automaticGainControlV1/Android.bp
+++ b/audio/aidl/default/automaticGainControlV1/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/automaticGainControlV2/Android.bp b/audio/aidl/default/automaticGainControlV2/Android.bp
index ea05152..dda4e51 100644
--- a/audio/aidl/default/automaticGainControlV2/Android.bp
+++ b/audio/aidl/default/automaticGainControlV2/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/bassboost/Android.bp b/audio/aidl/default/bassboost/Android.bp
index 8f53eae..42223b4 100644
--- a/audio/aidl/default/bassboost/Android.bp
+++ b/audio/aidl/default/bassboost/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/bluetooth/StreamBluetooth.cpp b/audio/aidl/default/bluetooth/StreamBluetooth.cpp
index a73af1b..77e48df 100644
--- a/audio/aidl/default/bluetooth/StreamBluetooth.cpp
+++ b/audio/aidl/default/bluetooth/StreamBluetooth.cpp
@@ -16,12 +16,13 @@
#include <algorithm>
+#define ATRACE_TAG ATRACE_TAG_AUDIO
#define LOG_TAG "AHAL_StreamBluetooth"
#include <Utils.h>
#include <android-base/logging.h>
#include <audio_utils/clock.h>
+#include <utils/Trace.h>
-#include "BluetoothAudioSession.h"
#include "core-impl/StreamBluetooth.h"
using aidl::android::hardware::audio::common::frameCountFromDurationUs;
@@ -109,13 +110,10 @@
}
const size_t fc = std::min(frameCount, mPreferredFrameCount);
const size_t bytesToTransfer = fc * mFrameSizeBytes;
- if (mIsInput) {
- const size_t totalRead = mBtDeviceProxy->readData(buffer, bytesToTransfer);
- *actualFrameCount = std::max(*actualFrameCount, totalRead / mFrameSizeBytes);
- } else {
- const size_t totalWrite = mBtDeviceProxy->writeData(buffer, bytesToTransfer);
- *actualFrameCount = std::max(*actualFrameCount, totalWrite / mFrameSizeBytes);
- }
+ const size_t bytesTransferred = mIsInput ? mBtDeviceProxy->readData(buffer, bytesToTransfer)
+ : mBtDeviceProxy->writeData(buffer, bytesToTransfer);
+ *actualFrameCount = bytesTransferred / mFrameSizeBytes;
+ ATRACE_INT("BTdropped", bytesToTransfer - bytesTransferred);
PresentationPosition presentation_position;
if (!mBtDeviceProxy->getPresentationPosition(presentation_position)) {
presentation_position.remoteDeviceAudioDelayNanos =
diff --git a/audio/aidl/default/config/audioPolicy/Android.bp b/audio/aidl/default/config/audioPolicy/Android.bp
index 6d8a148..baa3762 100644
--- a/audio/aidl/default/config/audioPolicy/Android.bp
+++ b/audio/aidl/default/config/audioPolicy/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/config/audioPolicy/engine/Android.bp b/audio/aidl/default/config/audioPolicy/engine/Android.bp
index b2a7310..5d62bd6 100644
--- a/audio/aidl/default/config/audioPolicy/engine/Android.bp
+++ b/audio/aidl/default/config/audioPolicy/engine/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/downmix/Android.bp b/audio/aidl/default/downmix/Android.bp
index 8657283..e5e8405 100644
--- a/audio/aidl/default/downmix/Android.bp
+++ b/audio/aidl/default/downmix/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/dynamicProcessing/Android.bp b/audio/aidl/default/dynamicProcessing/Android.bp
index c0a648d..ccd1aa0 100644
--- a/audio/aidl/default/dynamicProcessing/Android.bp
+++ b/audio/aidl/default/dynamicProcessing/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/envReverb/Android.bp b/audio/aidl/default/envReverb/Android.bp
index 23495f1..70da2bd 100644
--- a/audio/aidl/default/envReverb/Android.bp
+++ b/audio/aidl/default/envReverb/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/equalizer/Android.bp b/audio/aidl/default/equalizer/Android.bp
index 1d29d40..da2663c 100644
--- a/audio/aidl/default/equalizer/Android.bp
+++ b/audio/aidl/default/equalizer/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/extension/Android.bp b/audio/aidl/default/extension/Android.bp
index 2b21e3e..79fd857 100644
--- a/audio/aidl/default/extension/Android.bp
+++ b/audio/aidl/default/extension/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/hapticGenerator/Android.bp b/audio/aidl/default/hapticGenerator/Android.bp
index 8fb9a3d..fdd4fc7 100644
--- a/audio/aidl/default/hapticGenerator/Android.bp
+++ b/audio/aidl/default/hapticGenerator/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/include/core-impl/ModuleBluetooth.h b/audio/aidl/default/include/core-impl/ModuleBluetooth.h
index b95b526..4e68d72 100644
--- a/audio/aidl/default/include/core-impl/ModuleBluetooth.h
+++ b/audio/aidl/default/include/core-impl/ModuleBluetooth.h
@@ -86,7 +86,7 @@
const ::aidl::android::media::audio::common::AudioPort& audioPort, CachedProxy& proxy);
static constexpr int kCreateProxyRetries = 5;
- static constexpr int kCreateProxyRetrySleepMs = 250;
+ static constexpr int kCreateProxyRetrySleepMs = 75;
ChildInterface<BluetoothA2dp> mBluetoothA2dp;
ChildInterface<BluetoothLe> mBluetoothLe;
std::map<int32_t /*instantiated device port ID*/, CachedProxy> mProxies;
diff --git a/audio/aidl/default/loudnessEnhancer/Android.bp b/audio/aidl/default/loudnessEnhancer/Android.bp
index cd44b50..4b30484 100644
--- a/audio/aidl/default/loudnessEnhancer/Android.bp
+++ b/audio/aidl/default/loudnessEnhancer/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/noiseSuppression/Android.bp b/audio/aidl/default/noiseSuppression/Android.bp
index 5729571..66fe427 100644
--- a/audio/aidl/default/noiseSuppression/Android.bp
+++ b/audio/aidl/default/noiseSuppression/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/presetReverb/Android.bp b/audio/aidl/default/presetReverb/Android.bp
index 2a2ae75..15b4632 100644
--- a/audio/aidl/default/presetReverb/Android.bp
+++ b/audio/aidl/default/presetReverb/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/spatializer/Android.bp b/audio/aidl/default/spatializer/Android.bp
index 05ed365..400629e 100644
--- a/audio/aidl/default/spatializer/Android.bp
+++ b/audio/aidl/default/spatializer/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/virtualizer/Android.bp b/audio/aidl/default/virtualizer/Android.bp
index 5d59f7c..91d2abb 100644
--- a/audio/aidl/default/virtualizer/Android.bp
+++ b/audio/aidl/default/virtualizer/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/visualizer/Android.bp b/audio/aidl/default/visualizer/Android.bp
index 68f7177..af8f574 100644
--- a/audio/aidl/default/visualizer/Android.bp
+++ b/audio/aidl/default/visualizer/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/default/volume/Android.bp b/audio/aidl/default/volume/Android.bp
index 8d5401a..a424f7e 100644
--- a/audio/aidl/default/volume/Android.bp
+++ b/audio/aidl/default/volume/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/sounddose/vts/Android.bp b/audio/aidl/sounddose/vts/Android.bp
index 88be968..b852287 100644
--- a/audio/aidl/sounddose/vts/Android.bp
+++ b/audio/aidl/sounddose/vts/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index 85319ec..5218fdd 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
@@ -90,6 +91,12 @@
name: "VtsHalBassBoostTargetTest",
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
srcs: ["VtsHalBassBoostTargetTest.cpp"],
+ cflags: [
+ "-Wno-error=unused-parameter",
+ ],
+ static_libs: [
+ "libpffft",
+ ],
}
cc_test {
diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
index 1e6a49f..5479825 100644
--- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
@@ -608,8 +608,11 @@
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
}
-// Verify Parameters kept after reset.
-TEST_P(AudioEffectTest, SetCommonParameterAndReopen) {
+/**
+ * Verify DataMqUpdateEventFlag after common parameter setting.
+ * verify reopen sequence.
+ */
+TEST_P(AudioEffectDataPathTest, SetCommonParameterAndReopen) {
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
Parameter::Common common = EffectHelper::createParamCommon(
diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
index 135940d..b54b442 100644
--- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
@@ -14,13 +14,17 @@
* limitations under the License.
*/
-#define LOG_TAG "VtsHalBassBoostTest"
-#include <android-base/logging.h>
+#include <limits.h>
+#define LOG_TAG "VtsHalBassBoostTest"
+#include <aidl/Vintf.h>
+#include <android-base/logging.h>
#include "EffectHelper.h"
+#include "pffft.hpp"
using namespace android;
+using aidl::android::hardware::audio::common::getChannelCount;
using aidl::android::hardware::audio::effect::BassBoost;
using aidl::android::hardware::audio::effect::Capability;
using aidl::android::hardware::audio::effect::Descriptor;
@@ -30,13 +34,11 @@
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Range;
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
-/**
- * Here we focus on specific parameter checking, general IEffect interfaces testing performed in
- * VtsAudioEffectTargetTest.
- */
-enum ParamName { PARAM_INSTANCE_NAME, PARAM_STRENGTH };
-using BassBoostParamTestParam = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int>;
+// minimal HAL interface version to run bassboost data path test
+constexpr int32_t kMinDataTestHalVersion = 2;
+static const std::vector<int32_t> kLayouts = {AudioChannelLayout::LAYOUT_STEREO,
+ AudioChannelLayout::LAYOUT_MONO};
/*
* Testing parameter range, assuming the parameter supported by effect is in this range.
* Parameter should be within the valid range defined in the documentation,
@@ -44,29 +46,29 @@
* otherwise expect EX_ILLEGAL_ARGUMENT.
*/
-class BassBoostParamTest : public ::testing::TestWithParam<BassBoostParamTestParam>,
- public EffectHelper {
+class BassBoostEffectHelper : public EffectHelper {
public:
- BassBoostParamTest() : mParamStrength(std::get<PARAM_STRENGTH>(GetParam())) {
- std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
- }
-
- void SetUp() override {
+ void SetUpBassBoost(int32_t layout = AudioChannelLayout::LAYOUT_STEREO) {
ASSERT_NE(nullptr, mFactory);
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ setFrameCounts(layout);
+
+ AudioChannelLayout channelLayout =
+ AudioChannelLayout::make<AudioChannelLayout::layoutMask>(layout);
Parameter::Specific specific = getDefaultParamSpecific();
Parameter::Common common = EffectHelper::createParamCommon(
- 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
- kInputFrameCount /* iFrameCount */, kOutputFrameCount /* oFrameCount */);
- IEffect::OpenEffectReturn ret;
- ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
+ 0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+ kSamplingFrequency /* oSampleRate */, mInputFrameCount /* iFrameCount */,
+ mOutputFrameCount /* oFrameCount */, channelLayout, channelLayout);
+ ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
ASSERT_NE(nullptr, mEffect);
}
- void TearDown() override {
+ void TearDownBassBoost() {
ASSERT_NO_FATAL_FAILURE(close(mEffect));
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ mOpenEffectReturn = IEffect::OpenEffectReturn{};
}
Parameter::Specific getDefaultParamSpecific() {
@@ -76,58 +78,214 @@
return specific;
}
- static const long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
- std::shared_ptr<IFactory> mFactory;
- std::shared_ptr<IEffect> mEffect;
- Descriptor mDescriptor;
- int mParamStrength = 0;
+ void setFrameCounts(int32_t inputBufferLayout) {
+ int channelCount = getChannelCount(
+ AudioChannelLayout::make<AudioChannelLayout::layoutMask>(inputBufferLayout));
+ mInputFrameCount = kInputSize / channelCount;
+ mOutputFrameCount = kInputSize / channelCount;
+ }
- void SetAndGetBassBoostParameters() {
- for (auto& it : mTags) {
- auto& tag = it.first;
- auto& bb = it.second;
+ Parameter createBassBoostParam(int strength) {
+ return Parameter::make<Parameter::specific>(
+ Parameter::Specific::make<Parameter::Specific::bassBoost>(
+ BassBoost::make<BassBoost::strengthPm>(strength)));
+ }
- // validate parameter
- Descriptor desc;
- ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
- const bool valid = isParameterValid<BassBoost, Range::bassBoost>(it.second, desc);
- const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
+ bool isStrengthValid(int strength) {
+ auto bb = BassBoost::make<BassBoost::strengthPm>(strength);
+ return isParameterValid<BassBoost, Range::bassBoost>(bb, mDescriptor);
+ }
- // set parameter
- Parameter expectParam;
- Parameter::Specific specific;
- specific.set<Parameter::Specific::bassBoost>(bb);
- expectParam.set<Parameter::specific>(specific);
- EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
+ void setAndVerifyParameters(int strength, binder_exception_t expected) {
+ auto expectedParam = createBassBoostParam(strength);
+ EXPECT_STATUS(expected, mEffect->setParameter(expectedParam)) << expectedParam.toString();
- // only get if parameter in range and set success
- if (expected == EX_NONE) {
- Parameter getParam;
- Parameter::Id id;
- BassBoost::Id bbId;
- bbId.set<BassBoost::Id::commonTag>(tag);
- id.set<Parameter::Id::bassBoostTag>(bbId);
- // if set success, then get should match
- EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
- EXPECT_EQ(expectParam, getParam);
- }
+ if (expected == EX_NONE) {
+ auto bbId = BassBoost::Id::make<BassBoost::Id::commonTag>(
+ BassBoost::Tag(BassBoost::strengthPm));
+ auto id = Parameter::Id::make<Parameter::Id::bassBoostTag>(bbId);
+ // get parameter
+ Parameter getParam;
+ // if set success, then get should match
+ EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
+ EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
+ << "\ngetParam:" << getParam.toString();
}
}
- void addStrengthParam(int strength) {
- BassBoost bb;
- bb.set<BassBoost::strengthPm>(strength);
- mTags.push_back({BassBoost::strengthPm, bb});
+ static constexpr int kSamplingFrequency = 44100;
+ static constexpr int kDurationMilliSec = 2000;
+ static constexpr int kInputSize = kSamplingFrequency * kDurationMilliSec / 1000;
+ long mInputFrameCount, mOutputFrameCount;
+ std::shared_ptr<IFactory> mFactory;
+ Descriptor mDescriptor;
+ std::shared_ptr<IEffect> mEffect;
+ IEffect::OpenEffectReturn mOpenEffectReturn;
+};
+
+/**
+ * Here we focus on specific parameter checking, general IEffect interfaces testing performed in
+ * VtsAudioEffectTargetTest.
+ */
+enum ParamName { PARAM_INSTANCE_NAME, PARAM_STRENGTH };
+using BassBoostParamTestParam = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int>;
+
+class BassBoostParamTest : public ::testing::TestWithParam<BassBoostParamTestParam>,
+ public BassBoostEffectHelper {
+ public:
+ BassBoostParamTest() : mParamStrength(std::get<PARAM_STRENGTH>(GetParam())) {
+ std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
}
- private:
- std::vector<std::pair<BassBoost::Tag, BassBoost>> mTags;
- void CleanUp() { mTags.clear(); }
+ void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpBassBoost()); }
+ void TearDown() override { TearDownBassBoost(); }
+
+ int mParamStrength = 0;
};
TEST_P(BassBoostParamTest, SetAndGetStrength) {
- EXPECT_NO_FATAL_FAILURE(addStrengthParam(mParamStrength));
- SetAndGetBassBoostParameters();
+ if (isStrengthValid(mParamStrength)) {
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(mParamStrength, EX_NONE));
+ } else {
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(mParamStrength, EX_ILLEGAL_ARGUMENT));
+ }
+}
+
+enum DataParamName { DATA_INSTANCE_NAME, DATA_LAYOUT };
+
+using BassBoostDataTestParam =
+ std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t>;
+
+class BassBoostDataTest : public ::testing::TestWithParam<BassBoostDataTestParam>,
+ public BassBoostEffectHelper {
+ public:
+ BassBoostDataTest() : mChannelLayout(std::get<DATA_LAYOUT>(GetParam())) {
+ std::tie(mFactory, mDescriptor) = std::get<DATA_INSTANCE_NAME>(GetParam());
+ mStrengthValues = getTestValueSet<BassBoost, int, Range::bassBoost, BassBoost::strengthPm>(
+ {std::get<DATA_INSTANCE_NAME>(GetParam())}, expandTestValueBasic<int>);
+ }
+
+ void SetUp() override {
+ ASSERT_NO_FATAL_FAILURE(SetUpBassBoost(mChannelLayout));
+ if (int32_t version;
+ mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
+ GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
+ }
+ }
+
+ void TearDown() override { TearDownBassBoost(); }
+
+ // Find FFT bin indices for testFrequencies and get bin center frequencies
+ void roundToFreqCenteredToFftBin(std::vector<int>& testFrequencies,
+ std::vector<int>& binOffsets) {
+ for (size_t i = 0; i < testFrequencies.size(); i++) {
+ binOffsets[i] = std::round(testFrequencies[i] / kBinWidth);
+ testFrequencies[i] = std::round(binOffsets[i] * kBinWidth);
+ }
+ }
+
+ // Generate multitone input between -1 to +1 using testFrequencies
+ void generateMultiTone(const std::vector<int>& testFrequencies, std::vector<float>& input) {
+ for (auto i = 0; i < kInputSize; i++) {
+ input[i] = 0;
+
+ for (size_t j = 0; j < testFrequencies.size(); j++) {
+ input[i] += sin(2 * M_PI * testFrequencies[j] * i / kSamplingFrequency);
+ }
+ input[i] /= testFrequencies.size();
+ }
+ }
+
+ // Use FFT transform to convert the buffer to frequency domain
+ // Compute its magnitude at binOffsets
+ std::vector<float> calculateMagnitude(const std::vector<float>& buffer,
+ const std::vector<int>& binOffsets) {
+ std::vector<float> fftInput(kNPointFFT);
+ PFFFT_Setup* inputHandle = pffft_new_setup(kNPointFFT, PFFFT_REAL);
+ pffft_transform_ordered(inputHandle, buffer.data(), fftInput.data(), nullptr,
+ PFFFT_FORWARD);
+ pffft_destroy_setup(inputHandle);
+ std::vector<float> bufferMag(binOffsets.size());
+ for (size_t i = 0; i < binOffsets.size(); i++) {
+ size_t k = binOffsets[i];
+ bufferMag[i] = sqrt((fftInput[k * 2] * fftInput[k * 2]) +
+ (fftInput[k * 2 + 1] * fftInput[k * 2 + 1]));
+ }
+
+ return bufferMag;
+ }
+
+ // Calculate gain difference between low frequency and high frequency magnitude
+ float calculateGainDiff(const std::vector<float>& inputMag,
+ const std::vector<float>& outputMag) {
+ std::vector<float> gains(inputMag.size());
+
+ for (size_t i = 0; i < inputMag.size(); i++) {
+ gains[i] = 20 * log10(outputMag[i] / inputMag[i]);
+ }
+
+ return gains[0] - gains[1];
+ }
+
+ static constexpr int kNPointFFT = 32768;
+ static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT;
+ std::set<int> mStrengthValues;
+ int32_t mChannelLayout;
+};
+
+TEST_P(BassBoostDataTest, IncreasingStrength) {
+ // Frequencies to generate multitone input
+ std::vector<int> testFrequencies = {100, 1000};
+
+ // FFT bin indices for testFrequencies
+ std::vector<int> binOffsets(testFrequencies.size());
+
+ std::vector<float> input(kInputSize);
+ std::vector<float> baseOutput(kInputSize);
+
+ std::vector<float> inputMag(testFrequencies.size());
+ float prevGain = -100;
+
+ roundToFreqCenteredToFftBin(testFrequencies, binOffsets);
+
+ generateMultiTone(testFrequencies, input);
+
+ inputMag = calculateMagnitude(input, binOffsets);
+
+ if (isStrengthValid(0)) {
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(0, EX_NONE));
+ } else {
+ GTEST_SKIP() << "Strength not supported, skipping the test\n";
+ }
+
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(input, baseOutput, mEffect, &mOpenEffectReturn));
+
+ std::vector<float> baseMag(testFrequencies.size());
+ baseMag = calculateMagnitude(baseOutput, binOffsets);
+ float baseDiff = calculateGainDiff(inputMag, baseMag);
+
+ for (int strength : mStrengthValues) {
+ // Skipping the further steps for invalid strength values
+ if (!isStrengthValid(strength)) {
+ continue;
+ }
+
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(strength, EX_NONE));
+
+ std::vector<float> output(kInputSize);
+ std::vector<float> outputMag(testFrequencies.size());
+
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(input, output, mEffect, &mOpenEffectReturn));
+
+ outputMag = calculateMagnitude(output, binOffsets);
+ float diff = calculateGainDiff(inputMag, outputMag);
+
+ ASSERT_GT(diff, prevGain);
+ ASSERT_GT(diff, baseDiff);
+ prevGain = diff;
+ }
}
std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kDescPair;
@@ -150,6 +308,22 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BassBoostParamTest);
+INSTANTIATE_TEST_SUITE_P(
+ BassBoostTest, BassBoostDataTest,
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidBassBoost())),
+ testing::ValuesIn(kLayouts)),
+ [](const testing::TestParamInfo<BassBoostDataTest::ParamType>& info) {
+ auto descriptor = std::get<DATA_INSTANCE_NAME>(info.param).second;
+ std::string layout = std::to_string(std::get<DATA_LAYOUT>(info.param));
+ std::string name = getPrefix(descriptor) + "_layout_" + layout;
+ std::replace_if(
+ name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
+ return name;
+ });
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BassBoostDataTest);
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp
index f27eb93..450e04f 100644
--- a/audio/common/2.0/Android.bp
+++ b/audio/common/2.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/4.0/Android.bp b/audio/common/4.0/Android.bp
index ea88b06..8a0fe72 100644
--- a/audio/common/4.0/Android.bp
+++ b/audio/common/4.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/5.0/Android.bp b/audio/common/5.0/Android.bp
index a6bb331..02f66a3 100644
--- a/audio/common/5.0/Android.bp
+++ b/audio/common/5.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/6.0/Android.bp b/audio/common/6.0/Android.bp
index 91721fc..fd4a1f5 100644
--- a/audio/common/6.0/Android.bp
+++ b/audio/common/6.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/7.0/Android.bp b/audio/common/7.0/Android.bp
index 2f7665e..5ef59ad 100644
--- a/audio/common/7.0/Android.bp
+++ b/audio/common/7.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/7.0/example/Android.bp b/audio/common/7.0/example/Android.bp
index a85e4fa..1d54697 100644
--- a/audio/common/7.0/example/Android.bp
+++ b/audio/common/7.0/example/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/7.1/Android.bp b/audio/common/7.1/Android.bp
index a257510..57ce2d7 100644
--- a/audio/common/7.1/Android.bp
+++ b/audio/common/7.1/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/all-versions/default/Android.bp b/audio/common/all-versions/default/Android.bp
index 9543674..2fcc3c4 100644
--- a/audio/common/all-versions/default/Android.bp
+++ b/audio/common/all-versions/default/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/all-versions/default/service/Android.bp b/audio/common/all-versions/default/service/Android.bp
index d513062..e2e0a93 100644
--- a/audio/common/all-versions/default/service/Android.bp
+++ b/audio/common/all-versions/default/service/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/all-versions/test/utility/Android.bp b/audio/common/all-versions/test/utility/Android.bp
index c6a3963..7fd3688 100644
--- a/audio/common/all-versions/test/utility/Android.bp
+++ b/audio/common/all-versions/test/utility/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/common/all-versions/util/Android.bp b/audio/common/all-versions/util/Android.bp
index 91de6ec..f9ada08 100644
--- a/audio/common/all-versions/util/Android.bp
+++ b/audio/common/all-versions/util/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/core/all-versions/default/Android.bp b/audio/core/all-versions/default/Android.bp
index 3536561..c55eef4 100644
--- a/audio/core/all-versions/default/Android.bp
+++ b/audio/core/all-versions/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/core/all-versions/default/util/Android.bp b/audio/core/all-versions/default/util/Android.bp
index b96f2d2..08ddb59 100644
--- a/audio/core/all-versions/default/util/Android.bp
+++ b/audio/core/all-versions/default/util/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp
index 9d93bb0..9e398e4 100644
--- a/audio/core/all-versions/vts/functional/Android.bp
+++ b/audio/core/all-versions/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index f2f5124..c236c16 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/2.0/xml/Android.bp b/audio/effect/2.0/xml/Android.bp
index d015639..cddcfe9 100644
--- a/audio/effect/2.0/xml/Android.bp
+++ b/audio/effect/2.0/xml/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/4.0/Android.bp b/audio/effect/4.0/Android.bp
index 1eb754a..cae91c1 100644
--- a/audio/effect/4.0/Android.bp
+++ b/audio/effect/4.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/4.0/xml/Android.bp b/audio/effect/4.0/xml/Android.bp
index bdffe60..a45eecc 100644
--- a/audio/effect/4.0/xml/Android.bp
+++ b/audio/effect/4.0/xml/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/5.0/Android.bp b/audio/effect/5.0/Android.bp
index 126964c..ef3a28b 100644
--- a/audio/effect/5.0/Android.bp
+++ b/audio/effect/5.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/5.0/xml/Android.bp b/audio/effect/5.0/xml/Android.bp
index ed12e38..7a0b958 100644
--- a/audio/effect/5.0/xml/Android.bp
+++ b/audio/effect/5.0/xml/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/6.0/Android.bp b/audio/effect/6.0/Android.bp
index 8d15d09..8c52ebc 100644
--- a/audio/effect/6.0/Android.bp
+++ b/audio/effect/6.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/6.0/xml/Android.bp b/audio/effect/6.0/xml/Android.bp
index f139341..9e1533c 100644
--- a/audio/effect/6.0/xml/Android.bp
+++ b/audio/effect/6.0/xml/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/7.0/Android.bp b/audio/effect/7.0/Android.bp
index 7399cdb..248655e 100644
--- a/audio/effect/7.0/Android.bp
+++ b/audio/effect/7.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/7.0/xml/Android.bp b/audio/effect/7.0/xml/Android.bp
index 978e434..82ed18b 100644
--- a/audio/effect/7.0/xml/Android.bp
+++ b/audio/effect/7.0/xml/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/all-versions/default/Android.bp b/audio/effect/all-versions/default/Android.bp
index a3c3ed6..cea085c 100644
--- a/audio/effect/all-versions/default/Android.bp
+++ b/audio/effect/all-versions/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/all-versions/default/util/Android.bp b/audio/effect/all-versions/default/util/Android.bp
index 143094d..53dd9ac 100644
--- a/audio/effect/all-versions/default/util/Android.bp
+++ b/audio/effect/all-versions/default/util/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/audio/effect/all-versions/vts/functional/Android.bp b/audio/effect/all-versions/vts/functional/Android.bp
index 3b15ed4..4c07aad 100644
--- a/audio/effect/all-versions/vts/functional/Android.bp
+++ b/audio/effect/all-versions/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_audio_framework",
// 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"
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 910ae7c..e40ac90 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -25,6 +25,7 @@
#include <android-base/stringprintf.h>
#include <android-base/thread_annotations.h>
#include <android/binder_process.h>
+#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -34,20 +35,22 @@
#include <chrono>
#include <mutex>
+#include <thread>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using ::aidl::android::hardware::automotive::vehicle::IVehicle;
-using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
using ::android::getAidlHalInstanceNames;
+using ::android::uptimeMillis;
using ::android::base::ScopedLockAssertion;
using ::android::base::StringPrintf;
using ::android::frameworks::automotive::vhal::ErrorCode;
@@ -56,11 +59,14 @@
using ::android::frameworks::automotive::vhal::IHalPropValue;
using ::android::frameworks::automotive::vhal::ISubscriptionCallback;
using ::android::frameworks::automotive::vhal::IVhalClient;
+using ::android::frameworks::automotive::vhal::VhalClientResult;
using ::android::hardware::getAllHalInstanceNames;
using ::android::hardware::Sanitize;
using ::android::hardware::automotive::vehicle::toInt;
constexpr int32_t kInvalidProp = 0x31600207;
+// The timeout for retrying getting prop value after setting prop value.
+constexpr int64_t kRetryGetPropAfterSetPropTimeoutMillis = 10'000;
struct ServiceDescriptor {
std::string name;
@@ -117,6 +123,10 @@
class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam<ServiceDescriptor> {
protected:
bool checkIsSupported(int32_t propertyId);
+ VehiclePropertyStatus getStatus(const IHalPropValue& halPropValue);
+ bool isUnavailable(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result);
+ bool isResultOkayWithValue(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result,
+ int32_t value);
public:
void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access,
@@ -230,6 +240,41 @@
"Expect failure to get property for invalid prop: %" PRId32, kInvalidProp);
}
+VehiclePropertyStatus VtsHalAutomotiveVehicleTargetTest::getStatus(
+ const IHalPropValue& halPropValue) {
+ if (mVhalClient->isAidlVhal()) {
+ return reinterpret_cast<
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue*>(
+ halPropValue.toVehiclePropValue())
+ ->status;
+ }
+ return static_cast<VehiclePropertyStatus>(
+ reinterpret_cast<const android::hardware::automotive::vehicle::V2_0::VehiclePropValue*>(
+ halPropValue.toVehiclePropValue())
+ ->status);
+}
+
+bool VtsHalAutomotiveVehicleTargetTest::isResultOkayWithValue(
+ const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value) {
+ return result.ok() && result.value() != nullptr &&
+ getStatus(*(result.value())) == VehiclePropertyStatus::AVAILABLE &&
+ result.value()->getInt32Values().size() == 1 &&
+ result.value()->getInt32Values()[0] == value;
+}
+
+bool VtsHalAutomotiveVehicleTargetTest::isUnavailable(
+ const VhalClientResult<std::unique_ptr<IHalPropValue>>& result) {
+ if (!result.ok()) {
+ return result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL;
+ }
+ if (result.value() != nullptr &&
+ getStatus(*(result.value())) == VehiclePropertyStatus::UNAVAILABLE) {
+ return true;
+ }
+
+ return false;
+}
+
// Test set() on read_write properties.
TEST_P(VtsHalAutomotiveVehicleTargetTest, setProp) {
ALOGD("VtsHalAutomotiveVehicleTargetTest::setProp");
@@ -257,6 +302,14 @@
auto propToGet = mVhalClient->createHalPropValue(propId);
auto getValueResult = mVhalClient->getValueSync(*propToGet);
+ if (isUnavailable(getValueResult)) {
+ ALOGW("getProperty for %" PRId32
+ " returns NOT_AVAILABLE, "
+ "skip testing setProp",
+ propId);
+ return;
+ }
+
ASSERT_TRUE(getValueResult.ok())
<< StringPrintf("Failed to get value for property: %" PRId32 ", error: %s",
propId, getValueResult.error().message().c_str());
@@ -269,17 +322,48 @@
"Expect exactly 1 int value for boolean property: %" PRId32 ", got %zu", propId,
intValueSize);
- int setValue = value.getInt32Values()[0] == 1 ? 0 : 1;
+ int32_t setValue = value.getInt32Values()[0] == 1 ? 0 : 1;
auto propToSet = mVhalClient->createHalPropValue(propId);
propToSet->setInt32Values({setValue});
auto setValueResult = mVhalClient->setValueSync(*propToSet);
+ if (!setValueResult.ok() &&
+ setValueResult.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL) {
+ ALOGW("setProperty for %" PRId32
+ " returns NOT_AVAILABLE, "
+ "skip verifying getProperty returns the same value",
+ propId);
+ return;
+ }
+
ASSERT_TRUE(setValueResult.ok())
<< StringPrintf("Failed to set value for property: %" PRId32 ", error: %s",
propId, setValueResult.error().message().c_str());
+ // Retry getting the value until we pass the timeout. getValue might not return
+ // the expected value immediately since setValue is async.
+ auto timeoutMillis = uptimeMillis() + kRetryGetPropAfterSetPropTimeoutMillis;
- // check set success
- getValueResult = mVhalClient->getValueSync(*propToGet);
+ while (true) {
+ getValueResult = mVhalClient->getValueSync(*propToGet);
+ if (isResultOkayWithValue(getValueResult, setValue)) {
+ break;
+ }
+ if (uptimeMillis() >= timeoutMillis) {
+ // Reach timeout, the following assert should fail.
+ break;
+ }
+ // Sleep for 100ms between each getValueSync retry.
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ }
+
+ if (isUnavailable(getValueResult)) {
+ ALOGW("getProperty for %" PRId32
+ " returns NOT_AVAILABLE, "
+ "skip verifying the return value",
+ propId);
+ return;
+ }
+
ASSERT_TRUE(getValueResult.ok())
<< StringPrintf("Failed to get value for property: %" PRId32 ", error: %s",
propId, getValueResult.error().message().c_str());
@@ -900,7 +984,8 @@
.isAidlService = true,
});
}
- for (std::string name : getAllHalInstanceNames(IVehicle::descriptor)) {
+ for (std::string name : getAllHalInstanceNames(
+ android::hardware::automotive::vehicle::V2_0::IVehicle::descriptor)) {
descriptors.push_back({
.name = name,
.isAidlService = false,
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index 2e41208..3c3575d 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/default/Android.bp b/graphics/composer/2.1/default/Android.bp
index 96fea4e..91d9b0d 100644
--- a/graphics/composer/2.1/default/Android.bp
+++ b/graphics/composer/2.1/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/command-buffer/Android.bp b/graphics/composer/2.1/utils/command-buffer/Android.bp
index 07dea31..224cea5 100644
--- a/graphics/composer/2.1/utils/command-buffer/Android.bp
+++ b/graphics/composer/2.1/utils/command-buffer/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/hal/Android.bp b/graphics/composer/2.1/utils/hal/Android.bp
index 874be84..9622c58 100644
--- a/graphics/composer/2.1/utils/hal/Android.bp
+++ b/graphics/composer/2.1/utils/hal/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/hwc2on1adapter/Android.bp b/graphics/composer/2.1/utils/hwc2on1adapter/Android.bp
index 3527cca..fd00297 100644
--- a/graphics/composer/2.1/utils/hwc2on1adapter/Android.bp
+++ b/graphics/composer/2.1/utils/hwc2on1adapter/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/hwc2onfbadapter/Android.bp b/graphics/composer/2.1/utils/hwc2onfbadapter/Android.bp
index d613ba9..ecf6201 100644
--- a/graphics/composer/2.1/utils/hwc2onfbadapter/Android.bp
+++ b/graphics/composer/2.1/utils/hwc2onfbadapter/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/passthrough/Android.bp b/graphics/composer/2.1/utils/passthrough/Android.bp
index 67f5163..7bc32c0 100644
--- a/graphics/composer/2.1/utils/passthrough/Android.bp
+++ b/graphics/composer/2.1/utils/passthrough/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/resources/Android.bp b/graphics/composer/2.1/utils/resources/Android.bp
index 9eb23fa..8705dee 100644
--- a/graphics/composer/2.1/utils/resources/Android.bp
+++ b/graphics/composer/2.1/utils/resources/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/utils/vts/Android.bp b/graphics/composer/2.1/utils/vts/Android.bp
index 7b6a0e6..c457df2 100644
--- a/graphics/composer/2.1/utils/vts/Android.bp
+++ b/graphics/composer/2.1/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp
index 0f6d7e8..62dfda3 100644
--- a/graphics/composer/2.1/vts/functional/Android.bp
+++ b/graphics/composer/2.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/Android.bp b/graphics/composer/2.2/Android.bp
index e44a236..1f28ea3 100644
--- a/graphics/composer/2.2/Android.bp
+++ b/graphics/composer/2.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/utils/command-buffer/Android.bp b/graphics/composer/2.2/utils/command-buffer/Android.bp
index d55145e..eae2242 100644
--- a/graphics/composer/2.2/utils/command-buffer/Android.bp
+++ b/graphics/composer/2.2/utils/command-buffer/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/utils/hal/Android.bp b/graphics/composer/2.2/utils/hal/Android.bp
index 4e028e0..9194aa1 100644
--- a/graphics/composer/2.2/utils/hal/Android.bp
+++ b/graphics/composer/2.2/utils/hal/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/utils/passthrough/Android.bp b/graphics/composer/2.2/utils/passthrough/Android.bp
index b700344..10e0b73 100644
--- a/graphics/composer/2.2/utils/passthrough/Android.bp
+++ b/graphics/composer/2.2/utils/passthrough/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/utils/resources/Android.bp b/graphics/composer/2.2/utils/resources/Android.bp
index 9e45ef2..d1bf8c5 100644
--- a/graphics/composer/2.2/utils/resources/Android.bp
+++ b/graphics/composer/2.2/utils/resources/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp
index d11592f..6647bf3 100644
--- a/graphics/composer/2.2/utils/vts/Android.bp
+++ b/graphics/composer/2.2/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp
index 3476376..fc89763 100644
--- a/graphics/composer/2.2/vts/functional/Android.bp
+++ b/graphics/composer/2.2/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/Android.bp b/graphics/composer/2.3/Android.bp
index 3c52b6f..47a0965 100644
--- a/graphics/composer/2.3/Android.bp
+++ b/graphics/composer/2.3/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/default/Android.bp b/graphics/composer/2.3/default/Android.bp
index f801fba..bffe632 100644
--- a/graphics/composer/2.3/default/Android.bp
+++ b/graphics/composer/2.3/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/utils/command-buffer/Android.bp b/graphics/composer/2.3/utils/command-buffer/Android.bp
index ca7d136..1694509 100644
--- a/graphics/composer/2.3/utils/command-buffer/Android.bp
+++ b/graphics/composer/2.3/utils/command-buffer/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/utils/hal/Android.bp b/graphics/composer/2.3/utils/hal/Android.bp
index b475757..eb854c3 100644
--- a/graphics/composer/2.3/utils/hal/Android.bp
+++ b/graphics/composer/2.3/utils/hal/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/utils/passthrough/Android.bp b/graphics/composer/2.3/utils/passthrough/Android.bp
index 68b706c..7bf54e5 100644
--- a/graphics/composer/2.3/utils/passthrough/Android.bp
+++ b/graphics/composer/2.3/utils/passthrough/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/utils/vts/Android.bp b/graphics/composer/2.3/utils/vts/Android.bp
index b372804..dd56633 100644
--- a/graphics/composer/2.3/utils/vts/Android.bp
+++ b/graphics/composer/2.3/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp
index 13f2b11..e0c1d4e 100644
--- a/graphics/composer/2.3/vts/functional/Android.bp
+++ b/graphics/composer/2.3/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/Android.bp b/graphics/composer/2.4/Android.bp
index e6b238b..748faf6 100644
--- a/graphics/composer/2.4/Android.bp
+++ b/graphics/composer/2.4/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/default/Android.bp b/graphics/composer/2.4/default/Android.bp
index 7a91ec1..a9b6d4e 100644
--- a/graphics/composer/2.4/default/Android.bp
+++ b/graphics/composer/2.4/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/utils/command-buffer/Android.bp b/graphics/composer/2.4/utils/command-buffer/Android.bp
index c966fc4..608b004 100644
--- a/graphics/composer/2.4/utils/command-buffer/Android.bp
+++ b/graphics/composer/2.4/utils/command-buffer/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/utils/hal/Android.bp b/graphics/composer/2.4/utils/hal/Android.bp
index abf8e04..c90a79d 100644
--- a/graphics/composer/2.4/utils/hal/Android.bp
+++ b/graphics/composer/2.4/utils/hal/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/utils/passthrough/Android.bp b/graphics/composer/2.4/utils/passthrough/Android.bp
index a851c0a..867f8cb 100644
--- a/graphics/composer/2.4/utils/passthrough/Android.bp
+++ b/graphics/composer/2.4/utils/passthrough/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/utils/vts/Android.bp b/graphics/composer/2.4/utils/vts/Android.bp
index d2b2ffa..3a80c9a 100644
--- a/graphics/composer/2.4/utils/vts/Android.bp
+++ b/graphics/composer/2.4/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp
index b4ab259..637482d 100644
--- a/graphics/composer/2.4/vts/functional/Android.bp
+++ b/graphics/composer/2.4/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index 40448ec..5e4c23e 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp
index 60360fd..5bae7b5 100644
--- a/graphics/composer/aidl/vts/Android.bp
+++ b/graphics/composer/aidl/vts/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// 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"
diff --git a/nfc/aidl/Android.bp b/nfc/aidl/Android.bp
index dae9f29..ae68f17 100644
--- a/nfc/aidl/Android.bp
+++ b/nfc/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_nfc",
// 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"
@@ -34,7 +35,7 @@
sdk_version: "module_current",
enabled: false,
},
- ndk: {
+ ndk: {
enabled: true,
apex_available: [
"//apex_available:platform",
diff --git a/nfc/aidl/default/Android.bp b/nfc/aidl/default/Android.bp
index 6daebe5..0cda51d 100644
--- a/nfc/aidl/default/Android.bp
+++ b/nfc/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_nfc",
// 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"
diff --git a/nfc/aidl/vts/functional/Android.bp b/nfc/aidl/vts/functional/Android.bp
index 99eecd0..0dab2d8 100644
--- a/nfc/aidl/vts/functional/Android.bp
+++ b/nfc/aidl/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_nfc",
// 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"
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
index 483aed6..e4f7b51 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
@@ -171,7 +171,16 @@
/// Helper method to get a secret.
fn get(&mut self, id: &Id) -> Result<Secret, Error> {
- let get_request = GetSecretRequest { id: id.clone(), updated_sealing_policy: None };
+ self.get_update_policy(id, None)
+ }
+
+ /// Helper method to get a secret, updating the sealing policy along the way.
+ fn get_update_policy(
+ &mut self,
+ id: &Id,
+ updated_sealing_policy: Option<Vec<u8>>,
+ ) -> Result<Secret, Error> {
+ let get_request = GetSecretRequest { id: id.clone(), updated_sealing_policy };
let get_request = get_request.serialize_to_packet().to_vec()?;
let get_response = self.secret_management_request(&get_request)?;
@@ -532,8 +541,9 @@
#[rdroidtest(get_instances())]
fn secret_management_policy_gate(instance: String) {
let dice_chain = make_explicit_owned_dice(/*Security version in a node */ 100);
- let mut sk_client = SkClient::with_identity(&instance, dice_chain);
- sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ let mut sk_client_original = SkClient::with_identity(&instance, dice_chain);
+ sk_client_original.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client_original.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
// Start a session with higher security_version & get the stored secret.
let dice_chain_upgraded = make_explicit_owned_dice(/*Security version in a node */ 101);
@@ -547,6 +557,20 @@
sk_client_downgraded.get(&ID_EXAMPLE).unwrap_err(),
Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
));
+
+ // Now get the secret with the later version, and upgrade the sealing policy along the way.
+ let sealing_policy =
+ sealing_policy(sk_client_upgraded.dice_artifacts.explicit_key_dice_chain().unwrap());
+ assert_eq!(
+ sk_client_upgraded.get_update_policy(&ID_EXAMPLE, Some(sealing_policy)).unwrap(),
+ SECRET_EXAMPLE
+ );
+
+ // The original version of the client should no longer be able to retrieve the secret.
+ assert!(matches!(
+ sk_client_original.get(&ID_EXAMPLE).unwrap_err(),
+ Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
+ ));
}
// Helper method that constructs 3 SecretManagement requests. Callers would usually not care about
diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp
index 3914ec1..8877e6e 100644
--- a/sensors/aidl/Android.bp
+++ b/sensors/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_sensors",
// 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"
diff --git a/sensors/aidl/convert/Android.bp b/sensors/aidl/convert/Android.bp
index 53060b9..7217b2f 100644
--- a/sensors/aidl/convert/Android.bp
+++ b/sensors/aidl/convert/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_sensors",
// 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"
diff --git a/sensors/aidl/default/Android.bp b/sensors/aidl/default/Android.bp
index e93c391..6f011ee 100644
--- a/sensors/aidl/default/Android.bp
+++ b/sensors/aidl/default/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_sensors",
// 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"
diff --git a/sensors/aidl/default/multihal/Android.bp b/sensors/aidl/default/multihal/Android.bp
index 40cb2d9..7482ffe 100644
--- a/sensors/aidl/default/multihal/Android.bp
+++ b/sensors/aidl/default/multihal/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
// 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"
diff --git a/sensors/aidl/multihal/Android.bp b/sensors/aidl/multihal/Android.bp
index 522d305..cac5fc2 100644
--- a/sensors/aidl/multihal/Android.bp
+++ b/sensors/aidl/multihal/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
// 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"
diff --git a/sensors/aidl/vts/Android.bp b/sensors/aidl/vts/Android.bp
index c17a558..1f96bb4 100644
--- a/sensors/aidl/vts/Android.bp
+++ b/sensors/aidl/vts/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_sensors",
// 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"
diff --git a/tv/hdmi/cec/aidl/Android.bp b/tv/hdmi/cec/aidl/Android.bp
index 53cb5a9..11d3af2 100644
--- a/tv/hdmi/cec/aidl/Android.bp
+++ b/tv/hdmi/cec/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/cec/aidl/default/Android.bp b/tv/hdmi/cec/aidl/default/Android.bp
index ea4bb94..71efb09 100644
--- a/tv/hdmi/cec/aidl/default/Android.bp
+++ b/tv/hdmi/cec/aidl/default/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/cec/aidl/vts/functional/Android.bp b/tv/hdmi/cec/aidl/vts/functional/Android.bp
index 5c86d3f..32ad7c6 100644
--- a/tv/hdmi/cec/aidl/vts/functional/Android.bp
+++ b/tv/hdmi/cec/aidl/vts/functional/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/connection/aidl/Android.bp b/tv/hdmi/connection/aidl/Android.bp
index ff7e166..552b52c 100644
--- a/tv/hdmi/connection/aidl/Android.bp
+++ b/tv/hdmi/connection/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/connection/aidl/default/Android.bp b/tv/hdmi/connection/aidl/default/Android.bp
index 5e7e330..926ff42 100644
--- a/tv/hdmi/connection/aidl/default/Android.bp
+++ b/tv/hdmi/connection/aidl/default/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/connection/aidl/vts/functional/Android.bp b/tv/hdmi/connection/aidl/vts/functional/Android.bp
index fc8e2f7..3b74e06 100644
--- a/tv/hdmi/connection/aidl/vts/functional/Android.bp
+++ b/tv/hdmi/connection/aidl/vts/functional/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/earc/aidl/Android.bp b/tv/hdmi/earc/aidl/Android.bp
index d08e46d..7e88b27 100644
--- a/tv/hdmi/earc/aidl/Android.bp
+++ b/tv/hdmi/earc/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/earc/aidl/default/Android.bp b/tv/hdmi/earc/aidl/default/Android.bp
index 5d56c2a..55337d7 100644
--- a/tv/hdmi/earc/aidl/default/Android.bp
+++ b/tv/hdmi/earc/aidl/default/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/hdmi/earc/aidl/vts/functional/Android.bp b/tv/hdmi/earc/aidl/vts/functional/Android.bp
index 36fbf56..b33ad8e 100644
--- a/tv/hdmi/earc/aidl/vts/functional/Android.bp
+++ b/tv/hdmi/earc/aidl/vts/functional/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_tv_os",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/tv/input/aidl/Android.bp b/tv/input/aidl/Android.bp
index 35f510a..5543901 100644
--- a/tv/input/aidl/Android.bp
+++ b/tv/input/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_tv_os",
// 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"
diff --git a/tv/input/aidl/default/Android.bp b/tv/input/aidl/default/Android.bp
index 05af6a9..67015fb 100644
--- a/tv/input/aidl/default/Android.bp
+++ b/tv/input/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_tv_os",
// 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"
diff --git a/tv/input/aidl/vts/functional/Android.bp b/tv/input/aidl/vts/functional/Android.bp
index 22487ea..ccbce7d 100644
--- a/tv/input/aidl/vts/functional/Android.bp
+++ b/tv/input/aidl/vts/functional/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_tv_os",
// 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"
diff --git a/vibrator/aidl/Android.bp b/vibrator/aidl/Android.bp
index c5936e3..b5199e2 100644
--- a/vibrator/aidl/Android.bp
+++ b/vibrator/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_haptics_framework",
// 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"
diff --git a/vibrator/aidl/default/Android.bp b/vibrator/aidl/default/Android.bp
index fb71a82..0f342db 100644
--- a/vibrator/aidl/default/Android.bp
+++ b/vibrator/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_haptics_framework",
// 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"
diff --git a/vibrator/aidl/default/apex/Android.bp b/vibrator/aidl/default/apex/Android.bp
index 39626bf..b694e1f 100644
--- a/vibrator/aidl/default/apex/Android.bp
+++ b/vibrator/aidl/default/apex/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_haptics_framework",
default_applicable_licenses: ["hardware_interfaces_license"],
}
diff --git a/vibrator/aidl/default/example_java_client/Android.bp b/vibrator/aidl/default/example_java_client/Android.bp
index 17a649c..5f1e27a 100644
--- a/vibrator/aidl/default/example_java_client/Android.bp
+++ b/vibrator/aidl/default/example_java_client/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_haptics_framework",
// 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"
diff --git a/vibrator/aidl/vts/Android.bp b/vibrator/aidl/vts/Android.bp
index 1261870..b6d2fb2 100644
--- a/vibrator/aidl/vts/Android.bp
+++ b/vibrator/aidl/vts/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_haptics_framework",
// 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"