Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55c41966 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11722130 from 71143752 to 24Q3-release

Change-Id: I09302c589a0fd3386b7afd0563cf00da4feec9c5
parents 69008f12 71143752
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -93,17 +93,18 @@ StreamBluetooth::StreamBluetooth(StreamContext* context, const Metadata& metadat
::android::status_t StreamBluetooth::transfer(void* buffer, size_t frameCount,
                                              size_t* actualFrameCount, int32_t* latencyMs) {
    std::lock_guard guard(mLock);
    if (mBtDeviceProxy == nullptr || mBtDeviceProxy->getState() == BluetoothStreamState::DISABLED) {
    *actualFrameCount = 0;
    *latencyMs = StreamDescriptor::LATENCY_UNKNOWN;
    if (mBtDeviceProxy == nullptr || mBtDeviceProxy->getState() == BluetoothStreamState::DISABLED) {
        // The BT session is turned down, silently ignore write.
        return ::android::OK;
    }
    *actualFrameCount = 0;
    *latencyMs = 0;
    if (!mBtDeviceProxy->start()) {
        LOG(ERROR) << __func__ << ": state= " << mBtDeviceProxy->getState() << " failed to start";
        return -EIO;
        LOG(WARNING) << __func__ << ": state= " << mBtDeviceProxy->getState()
                     << " failed to start, will retry";
        return ::android::OK;
    }
    *latencyMs = 0;
    const size_t bytesToTransfer = frameCount * mFrameSizeBytes;
    const size_t bytesTransferred = mIsInput ? mBtDeviceProxy->readData(buffer, bytesToTransfer)
                                             : mBtDeviceProxy->writeData(buffer, bytesToTransfer);
+29 −62
Original line number Diff line number Diff line
@@ -453,12 +453,11 @@ enum EngineArchitectureTestParamName {
    ENGINE_TEST_INSTANCE_NAME,
    ENGINE_TEST_RESOLUTION_PREFERENCE,
    ENGINE_TEST_PREFERRED_DURATION,
    ENGINE_TEST_STAGE_ENABLEMENT,
    ENGINE_TEST_LIMITER_IN_USE
    ENGINE_TEST_STAGE_ENABLEMENT
};
using EngineArchitectureTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
                                                DynamicsProcessing::ResolutionPreference, float,
                                                DynamicsProcessing::StageEnablement, bool>;
                                                DynamicsProcessing::StageEnablement>;

void fillEngineArchConfig(DynamicsProcessing::EngineArchitecture& cfg,
                          const EngineArchitectureTestParams& params) {
@@ -466,7 +465,7 @@ void fillEngineArchConfig(DynamicsProcessing::EngineArchitecture& cfg,
    cfg.preferredProcessingDurationMs = std::get<ENGINE_TEST_PREFERRED_DURATION>(params);
    cfg.preEqStage = cfg.postEqStage = cfg.mbcStage =
            std::get<ENGINE_TEST_STAGE_ENABLEMENT>(params);
    cfg.limiterInUse = std::get<ENGINE_TEST_LIMITER_IN_USE>(params);
    cfg.limiterInUse = true;
}

class DynamicsProcessingTestEngineArchitecture
@@ -501,8 +500,8 @@ INSTANTIATE_TEST_SUITE_P(
                        static_cast<DynamicsProcessing::ResolutionPreference>(-1)),  // variant
                testing::Values(-10.f, 0.f, 10.f),  // processing duration
                testing::ValuesIn(
                        DynamicsProcessingTestHelper::kStageEnablementTestSet),  // preEQ/postEQ/mbc
                testing::Bool()),                                                // limiter enable
                        DynamicsProcessingTestHelper::kStageEnablementTestSet)  // preEQ/postEQ/mbc
                ),
        [](const auto& info) {
            auto descriptor = std::get<ENGINE_TEST_INSTANCE_NAME>(info.param).second;
            DynamicsProcessing::EngineArchitecture cfg;
@@ -568,7 +567,6 @@ enum LimiterConfigTestParamName {
    LIMITER_CHANNEL,
    LIMITER_ENABLE,
    LIMITER_LINK_GROUP,
    LIMITER_ENGINE_IN_USE,
    LIMITER_ADDITIONAL,
};
enum LimiterConfigTestAdditionalParam {
@@ -587,9 +585,8 @@ static constexpr std::array<LimiterConfigTestAdditional, 4> kLimiterConfigTestAd
         {1, -60, 2.5, -2, 3.14},
         {1, 60, 2.5, -2, 3.14}}};

using LimiterConfigTestParams =
        std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool, int32_t, bool,
                   LimiterConfigTestAdditional>;
using LimiterConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
                                           int32_t, bool, int32_t, LimiterConfigTestAdditional>;

void fillLimiterConfig(DynamicsProcessing::LimiterConfig& cfg,
                       const LimiterConfigTestParams& params) {
@@ -609,8 +606,7 @@ class DynamicsProcessingTestLimiterConfig
      public DynamicsProcessingTestHelper {
  public:
    DynamicsProcessingTestLimiterConfig()
        : DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())),
          mLimiterInUseEngine(std::get<LIMITER_ENGINE_IN_USE>(GetParam())) {
        : DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())) {
        fillLimiterConfig(mCfg, GetParam());
    }

@@ -619,11 +615,9 @@ class DynamicsProcessingTestLimiterConfig
    void TearDown() override { TearDownDynamicsProcessingEffect(); }

    DynamicsProcessing::LimiterConfig mCfg;
    bool mLimiterInUseEngine;
};

TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) {
    mEngineConfigPreset.limiterInUse = mLimiterInUseEngine;
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    EXPECT_NO_FATAL_FAILURE(addLimiterConfig({mCfg}));
    SetAndGetDynamicsProcessingParameters();
@@ -636,18 +630,15 @@ INSTANTIATE_TEST_SUITE_P(
                           testing::Values(-1, 0, 1, 2),                           // channel count
                           testing::Bool(),                                        // enable
                           testing::Values(3),                                     // link group
                           testing::Bool(),               // engine limiter enable
                           testing::ValuesIn(kLimiterConfigTestAdditionalParam)),  // Additional
        [](const auto& info) {
            auto descriptor = std::get<LIMITER_INSTANCE_NAME>(info.param).second;
            DynamicsProcessing::LimiterConfig cfg;
            fillLimiterConfig(cfg, info.param);
            std::string engineLimiterInUse =
                    std::to_string(std::get<LIMITER_ENGINE_IN_USE>(info.param));
            std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
                               descriptor.common.name + "_UUID_" +
                               toString(descriptor.common.id.uuid) + "_limiterConfig_" +
                               cfg.toString() + "_engineSetting_" + engineLimiterInUse;
                               cfg.toString();
            std::replace_if(
                    name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
            return name;
@@ -659,11 +650,10 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingTestLimiterConfi
 */
enum ChannelConfigTestParamName {
    BAND_CHANNEL_TEST_INSTANCE_NAME,
    BAND_CHANNEL_TEST_CHANNEL_CONFIG,
    BAND_CHANNEL_TEST_ENGINE_IN_USE
    BAND_CHANNEL_TEST_CHANNEL_CONFIG
};
using ChannelConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
                                           std::vector<DynamicsProcessing::ChannelConfig>, bool>;
                                           std::vector<DynamicsProcessing::ChannelConfig>>;

class DynamicsProcessingTestChannelConfig
    : public ::testing::TestWithParam<ChannelConfigTestParams>,
@@ -671,33 +661,28 @@ class DynamicsProcessingTestChannelConfig
  public:
    DynamicsProcessingTestChannelConfig()
        : DynamicsProcessingTestHelper(std::get<BAND_CHANNEL_TEST_INSTANCE_NAME>(GetParam())),
          mCfg(std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(GetParam())),
          mInUseEngine(std::get<BAND_CHANNEL_TEST_ENGINE_IN_USE>(GetParam())) {}
          mCfg(std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(GetParam())) {}

    void SetUp() override { SetUpDynamicsProcessingEffect(); }

    void TearDown() override { TearDownDynamicsProcessingEffect(); }

    std::vector<DynamicsProcessing::ChannelConfig> mCfg;
    const bool mInUseEngine;
};

TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPreEqChannelConfig) {
    mEngineConfigPreset.preEqStage.inUse = mInUseEngine;
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mCfg));
    SetAndGetDynamicsProcessingParameters();
}

TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPostEqChannelConfig) {
    mEngineConfigPreset.postEqStage.inUse = mInUseEngine;
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mCfg));
    SetAndGetDynamicsProcessingParameters();
}

TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetMbcChannelConfig) {
    mEngineConfigPreset.mbcStage.inUse = mInUseEngine;
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mCfg));
    SetAndGetDynamicsProcessingParameters();
@@ -709,19 +694,15 @@ INSTANTIATE_TEST_SUITE_P(
                testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
                        IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
                testing::ValuesIn(
                        DynamicsProcessingTestHelper::kChannelConfigTestSet),  // channel config
                testing::Bool()),                                              // Engine inUse
                        DynamicsProcessingTestHelper::kChannelConfigTestSet)),  // channel config
        [](const auto& info) {
            auto descriptor = std::get<BAND_CHANNEL_TEST_INSTANCE_NAME>(info.param).second;
            std::string engineInUse =
                    std::to_string(std::get<BAND_CHANNEL_TEST_ENGINE_IN_USE>(info.param));
            std::string channelConfig = ::android::internal::ToString(
                    std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(info.param));

            std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
                               descriptor.common.name + "_UUID_" +
                               toString(descriptor.common.id.uuid) + "_" + channelConfig +
                               "_engineInUse_" + engineInUse;
                               toString(descriptor.common.id.uuid) + "_" + channelConfig;
            std::replace_if(
                    name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
            return name;
@@ -736,11 +717,10 @@ enum EqBandConfigTestParamName {
    EQ_BAND_CHANNEL,
    EQ_BAND_ENABLE,
    EQ_BAND_CUT_OFF_FREQ,
    EQ_BAND_GAIN,
    EQ_BAND_STAGE_IN_USE
    EQ_BAND_GAIN
};
using EqBandConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
                                          bool, std::vector<std::pair<int, float>>, float, bool>;
                                          bool, std::vector<std::pair<int, float>>, float>;

void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
                      const EqBandConfigTestParams& params) {
@@ -760,8 +740,7 @@ class DynamicsProcessingTestEqBandConfig : public ::testing::TestWithParam<EqBan
                                           public DynamicsProcessingTestHelper {
  public:
    DynamicsProcessingTestEqBandConfig()
        : DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())),
          mStageInUse(std::get<EQ_BAND_STAGE_IN_USE>(GetParam())) {
        : DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())) {
        fillEqBandConfig(mCfgs, GetParam());
    }

@@ -770,11 +749,9 @@ class DynamicsProcessingTestEqBandConfig : public ::testing::TestWithParam<EqBan
    void TearDown() override { TearDownDynamicsProcessingEffect(); }

    std::vector<DynamicsProcessing::EqBandConfig> mCfgs;
    const bool mStageInUse;
};

TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
    mEngineConfigPreset.preEqStage.inUse = mStageInUse;
    mEngineConfigPreset.preEqStage.bandCount = mCfgs.size();
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -788,7 +765,6 @@ TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
}

TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
    mEngineConfigPreset.postEqStage.inUse = mStageInUse;
    mEngineConfigPreset.postEqStage.bandCount = mCfgs.size();
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -852,18 +828,16 @@ INSTANTIATE_TEST_SUITE_P(
                           testing::Values(-1, 0, 10),     // channel ID
                           testing::Bool(),                // band enable
                           testing::ValuesIn(kBands),      // cut off frequencies
                           testing::Values(-3.14f, 3.14f),  // gain
                           testing::Values(true)),          // stage in use
                           testing::Values(-3.14f, 3.14f)  // gain
                           ),
        [](const auto& info) {
            auto descriptor = std::get<EQ_BAND_INSTANCE_NAME>(info.param).second;
            std::vector<DynamicsProcessing::EqBandConfig> cfgs;
            fillEqBandConfig(cfgs, info.param);
            std::string bands = ::android::internal::ToString(cfgs);
            std::string stageInUse = std::to_string(std::get<EQ_BAND_STAGE_IN_USE>(info.param));
            std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
                               descriptor.common.name + "_UUID_" +
                               toString(descriptor.common.id.uuid) + "_bands_" + bands +
                               "_stageInUse_" + stageInUse;
                               toString(descriptor.common.id.uuid) + "_bands_" + bands;
            std::replace_if(
                    name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
            return name;
@@ -879,7 +853,6 @@ enum MbcBandConfigParamName {
    MBC_BAND_CHANNEL,
    MBC_BAND_ENABLE,
    MBC_BAND_CUTOFF_FREQ,
    MBC_BAND_STAGE_IN_USE,
    MBC_BAND_ADDITIONAL
};
enum MbcBandConfigAdditional {
@@ -905,7 +878,7 @@ static constexpr std::array<TestParamsMbcBandConfigAdditional, 4> kMbcBandConfig

using TestParamsMbcBandConfig =
        std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool,
                   std::vector<std::pair<int, float>>, bool, TestParamsMbcBandConfigAdditional>;
                   std::vector<std::pair<int, float>>, TestParamsMbcBandConfigAdditional>;

void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
                       const TestParamsMbcBandConfig& params) {
@@ -936,8 +909,7 @@ class DynamicsProcessingTestMbcBandConfig
      public DynamicsProcessingTestHelper {
  public:
    DynamicsProcessingTestMbcBandConfig()
        : DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())),
          mStageInUse(std::get<MBC_BAND_STAGE_IN_USE>(GetParam())) {
        : DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())) {
        fillMbcBandConfig(mCfgs, GetParam());
    }

@@ -946,11 +918,9 @@ class DynamicsProcessingTestMbcBandConfig
    void TearDown() override { TearDownDynamicsProcessingEffect(); }

    std::vector<DynamicsProcessing::MbcBandConfig> mCfgs;
    const bool mStageInUse;
};

TEST_P(DynamicsProcessingTestMbcBandConfig, SetAndGetMbcBandConfig) {
    mEngineConfigPreset.mbcStage.inUse = mStageInUse;
    mEngineConfigPreset.mbcStage.bandCount = mCfgs.size();
    EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
    std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@@ -970,18 +940,15 @@ INSTANTIATE_TEST_SUITE_P(
                           testing::Values(-1, 0, 10),  // channel count
                           testing::Bool(),             // enable
                           testing::ValuesIn(kBands),   // cut off frequencies
                           testing::Bool(),             // stage in use
                           testing::ValuesIn(kMbcBandConfigAdditionalParam)),  // Additional
        [](const auto& info) {
            auto descriptor = std::get<MBC_BAND_INSTANCE_NAME>(info.param).second;
            std::vector<DynamicsProcessing::MbcBandConfig> cfgs;
            fillMbcBandConfig(cfgs, info.param);
            std::string mbcBands = ::android::internal::ToString(cfgs);
            std::string stageInUse = std::to_string(std::get<MBC_BAND_STAGE_IN_USE>(info.param));
            std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
                               descriptor.common.name + "_UUID_" +
                               toString(descriptor.common.id.uuid) + "_bands_" + mbcBands +
                               "_stageInUse_" + stageInUse;
                               toString(descriptor.common.id.uuid) + "_bands_" + mbcBands;
            std::replace_if(
                    name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
            return name;
+2 −1
Original line number Diff line number Diff line
@@ -312,7 +312,8 @@ MATCHER_P(IsValidHealthData, version, "") {
    return true;
}

/*
/* @VsrTest = 3.2.015
 *
 * Tests the values returned by getBatteryHealthData() from interface IHealth.
 */
TEST_P(HealthAidl, getBatteryHealthData) {
+16 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@

#define LOG_TAG "thermal_aidl_hal_test"

#include <VtsCoreUtil.h>
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/thermal/BnCoolingDeviceChangedCallback.h>
@@ -70,6 +71,16 @@ static const CoolingDevice kCoolingDevice = {
        .timeWindowMs = 7000,
};

static const std::string FEATURE_WATCH = "android.hardware.type.watch";
static const std::string FEATURE_TELEVISION = "android.hardware.type.television";
static const std::string FEATURE_LEANBACK = "android.software.leanback";
static const std::string FEATURE_AUTOMOTIVE = "android.hardware.type.automotive";
static const std::string FEATURE_PC = "android.hardware.type.pc";
static const std::string FEATURE_EMBEDDED = "android.hardware.type.embedded";
static const std::string kNonHandheldFeatures[] = {FEATURE_AUTOMOTIVE, FEATURE_LEANBACK,
                                                   FEATURE_PC,         FEATURE_TELEVISION,
                                                   FEATURE_WATCH,      FEATURE_EMBEDDED};

// Callback class for receiving thermal event notifications from main class
class ThermalCallback : public BnThermalChangedCallback {
  public:
@@ -344,6 +355,11 @@ TEST_P(ThermalAidlTest, SkinTemperatureThresholdsTest) {
    if (apiLevel < 35) {
        GTEST_SKIP() << "Skipping test as the vendor level is below 35: " << apiLevel;
    }
    for (const auto& feature : kNonHandheldFeatures) {
        if (::testing::deviceSupportsFeature(feature.c_str())) {
            GTEST_SKIP() << "Skipping test as the device has feature: " << feature;
        }
    }
    std::vector<Temperature> temperatures;
    ::ndk::ScopedAStatus status =
            mThermal->getTemperaturesWithType(TemperatureType::SKIN, &temperatures);
+1 −1
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ TEST_P(SupplicantStaIfaceAidlTest, SetSuspendModeEnabled) {
 * SetCountryCode
 */
TEST_P(SupplicantStaIfaceAidlTest, SetCountryCode) {
    const std::vector<uint8_t> countryCode = {'M', 'X'};
    const std::vector<uint8_t> countryCode = {'U', 'S'};
    EXPECT_TRUE(sta_iface_->setCountryCode(countryCode).isOk());
}