mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge stage-aosp-rvc-ts-dev into rvc-dev am: f73fe6b6bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12203367 Change-Id: I72a7c52c280cc1b99a67ef3c0e6bf569a176bd82
This commit is contained in:
@@ -116,7 +116,10 @@ class BroadcastRadioHalTest : public ::testing::TestWithParam<std::string> {
|
||||
};
|
||||
|
||||
static void printSkipped(std::string msg) {
|
||||
std::cout << "[ SKIPPED ] " << msg << std::endl;
|
||||
const auto testInfo = testing::UnitTest::GetInstance()->current_test_info();
|
||||
std::cout << "[ SKIPPED ] " << testInfo->test_case_name() << "." << testInfo->name()
|
||||
<< std::endl;
|
||||
std::cout << msg << std::endl;
|
||||
}
|
||||
|
||||
MATCHER_P(InfoHasId, id,
|
||||
@@ -428,8 +431,9 @@ TEST_P(BroadcastRadioHalTest, FmTune) {
|
||||
ProgramInfo infoCb = {};
|
||||
EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_,
|
||||
InfoHasId(utils::make_identifier(IdentifierType::AMFM_FREQUENCY, freq)))
|
||||
.Times(AnyNumber())
|
||||
.WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(Void()))));
|
||||
.Times(AnyNumber())
|
||||
.WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(Void()))))
|
||||
.WillRepeatedly(testing::InvokeWithoutArgs([] { return Void(); }));
|
||||
auto result = mSession->tune(sel);
|
||||
|
||||
// expect a failure if it's not supported
|
||||
|
||||
@@ -247,8 +247,10 @@ TEST_P(GnssHalTest, TestGnssSvInfoFields) {
|
||||
ALOGD("Observed %d GnssSvStatus, while awaiting one location (%d received)",
|
||||
sv_info_list_cbq_size, location_called_count);
|
||||
|
||||
hidl_vec<IGnssCallback_2_1::GnssSvInfo> last_sv_info_list;
|
||||
ASSERT_TRUE(gnss_cb_->sv_info_list_cbq_.retrieve(last_sv_info_list, 1));
|
||||
// Get the last sv_info_list
|
||||
std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> sv_info_vec_list;
|
||||
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size, 1);
|
||||
hidl_vec<IGnssCallback_2_1::GnssSvInfo> last_sv_info_list = sv_info_vec_list.back();
|
||||
|
||||
bool nonZeroCn0Found = false;
|
||||
for (auto sv_info : last_sv_info_list) {
|
||||
@@ -673,4 +675,4 @@ TEST_P(GnssHalTest, TestGnssMeasurementCorrections) {
|
||||
iMeasurementCorrections->setCorrections_1_1(Utils::getMockMeasurementCorrections_1_1());
|
||||
ASSERT_TRUE(result.isOk());
|
||||
EXPECT_TRUE(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,13 +102,13 @@ AssertionResult DescramblerTests::openDescrambler(uint32_t demuxId) {
|
||||
|
||||
AssertionResult DescramblerTests::setKeyToken(TunerKeyToken token) {
|
||||
Result status;
|
||||
if (mDescrambler) {
|
||||
if (!mDescrambler) {
|
||||
ALOGW("[vts] Descrambler is not opened yet.");
|
||||
return failure();
|
||||
}
|
||||
|
||||
status = mDescrambler->setKeyToken(token);
|
||||
if (status == Result::SUCCESS) {
|
||||
if (status != Result::SUCCESS) {
|
||||
ALOGW("[vts] setKeyToken failed.");
|
||||
return failure();
|
||||
}
|
||||
@@ -118,13 +118,13 @@ AssertionResult DescramblerTests::setKeyToken(TunerKeyToken token) {
|
||||
|
||||
AssertionResult DescramblerTests::addPid(DemuxPid pid, sp<IFilter> optionalSourceFilter) {
|
||||
Result status;
|
||||
if (mDescrambler) {
|
||||
if (!mDescrambler) {
|
||||
ALOGW("[vts] Descrambler is not opened yet.");
|
||||
return failure();
|
||||
}
|
||||
|
||||
status = mDescrambler->addPid(pid, optionalSourceFilter);
|
||||
if (status == Result::SUCCESS) {
|
||||
if (status != Result::SUCCESS) {
|
||||
ALOGW("[vts] addPid failed.");
|
||||
return failure();
|
||||
}
|
||||
@@ -134,13 +134,13 @@ AssertionResult DescramblerTests::addPid(DemuxPid pid, sp<IFilter> optionalSourc
|
||||
|
||||
AssertionResult DescramblerTests::removePid(DemuxPid pid, sp<IFilter> optionalSourceFilter) {
|
||||
Result status;
|
||||
if (mDescrambler) {
|
||||
if (!mDescrambler) {
|
||||
ALOGW("[vts] Descrambler is not opened yet.");
|
||||
return failure();
|
||||
}
|
||||
|
||||
status = mDescrambler->removePid(pid, optionalSourceFilter);
|
||||
if (status == Result::SUCCESS) {
|
||||
if (status != Result::SUCCESS) {
|
||||
ALOGW("[vts] removePid failed.");
|
||||
return failure();
|
||||
}
|
||||
@@ -150,14 +150,14 @@ AssertionResult DescramblerTests::removePid(DemuxPid pid, sp<IFilter> optionalSo
|
||||
|
||||
AssertionResult DescramblerTests::closeDescrambler() {
|
||||
Result status;
|
||||
if (mDescrambler) {
|
||||
if (!mDescrambler) {
|
||||
ALOGW("[vts] Descrambler is not opened yet.");
|
||||
return failure();
|
||||
}
|
||||
|
||||
status = mDescrambler->close();
|
||||
mDescrambler = nullptr;
|
||||
if (status == Result::SUCCESS) {
|
||||
if (status != Result::SUCCESS) {
|
||||
ALOGW("[vts] close Descrambler failed.");
|
||||
return failure();
|
||||
}
|
||||
|
||||
@@ -292,18 +292,18 @@ void TunerDescramblerHidlTest::scrambledBroadcastTest(set<struct FilterConfig> m
|
||||
ASSERT_TRUE(mFilterTests.configFilter((*config).settings, filterId));
|
||||
filterIds.insert(filterId);
|
||||
}
|
||||
mDescramblerTests.openDescrambler(demuxId);
|
||||
ASSERT_TRUE(mDescramblerTests.openDescrambler(demuxId));
|
||||
TunerKeyToken token;
|
||||
ASSERT_TRUE(mDescramblerTests.getKeyToken(descConfig.casSystemId, descConfig.provisionStr,
|
||||
descConfig.hidlPvtData, token));
|
||||
mDescramblerTests.setKeyToken(token);
|
||||
ASSERT_TRUE(mDescramblerTests.setKeyToken(token));
|
||||
vector<DemuxPid> pids;
|
||||
DemuxPid pid;
|
||||
for (config = mediaFilterConfs.begin(); config != mediaFilterConfs.end(); config++) {
|
||||
ASSERT_TRUE(mDescramblerTests.getDemuxPidFromFilterSettings((*config).type,
|
||||
(*config).settings, pid));
|
||||
pids.push_back(pid);
|
||||
mDescramblerTests.addPid(pid, nullptr);
|
||||
ASSERT_TRUE(mDescramblerTests.addPid(pid, nullptr));
|
||||
}
|
||||
for (id = filterIds.begin(); id != filterIds.end(); id++) {
|
||||
ASSERT_TRUE(mFilterTests.startFilter(*id));
|
||||
@@ -316,9 +316,9 @@ void TunerDescramblerHidlTest::scrambledBroadcastTest(set<struct FilterConfig> m
|
||||
ASSERT_TRUE(mFilterTests.stopFilter(*id));
|
||||
}
|
||||
for (auto pid : pids) {
|
||||
mDescramblerTests.removePid(pid, nullptr);
|
||||
ASSERT_TRUE(mDescramblerTests.removePid(pid, nullptr));
|
||||
}
|
||||
mDescramblerTests.closeDescrambler();
|
||||
ASSERT_TRUE(mDescramblerTests.closeDescrambler());
|
||||
for (id = filterIds.begin(); id != filterIds.end(); id++) {
|
||||
ASSERT_TRUE(mFilterTests.closeFilter(*id));
|
||||
}
|
||||
@@ -410,9 +410,9 @@ TEST_P(TunerDemuxHidlTest, getAvSyncTime) {
|
||||
filterArray[TS_PCR0].bufferSize));
|
||||
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(pcrFilterId));
|
||||
ASSERT_TRUE(mFilterTests.configFilter(filterArray[TS_PCR0].settings, pcrFilterId));
|
||||
mDemuxTests.getAvSyncId(mediaFilter, avSyncHwId);
|
||||
ASSERT_TRUE(mDemuxTests.getAvSyncId(mediaFilter, avSyncHwId));
|
||||
ASSERT_TRUE(pcrFilterId == avSyncHwId);
|
||||
mDemuxTests.getAvSyncTime(pcrFilterId);
|
||||
ASSERT_TRUE(mDemuxTests.getAvSyncTime(pcrFilterId));
|
||||
ASSERT_TRUE(mFilterTests.closeFilter(pcrFilterId));
|
||||
ASSERT_TRUE(mFilterTests.closeFilter(mediaFilterId));
|
||||
ASSERT_TRUE(mDemuxTests.closeDemux());
|
||||
@@ -519,8 +519,8 @@ TEST_P(TunerDescramblerHidlTest, CreateDescrambler) {
|
||||
ASSERT_TRUE(mFrontendTests.setFrontendCallback());
|
||||
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
|
||||
ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
|
||||
mDescramblerTests.openDescrambler(demuxId);
|
||||
mDescramblerTests.closeDescrambler();
|
||||
ASSERT_TRUE(mDescramblerTests.openDescrambler(demuxId));
|
||||
ASSERT_TRUE(mDescramblerTests.closeDescrambler());
|
||||
ASSERT_TRUE(mDemuxTests.closeDemux());
|
||||
ASSERT_TRUE(mFrontendTests.closeFrontend());
|
||||
}
|
||||
|
||||
@@ -89,8 +89,12 @@ bool configureChipToSupportIfaceTypeInternal(const sp<IWifiChip>& wifi_chip,
|
||||
}
|
||||
} // namespace
|
||||
|
||||
sp<IWifi> getWifi(const std::string& instance_name) {
|
||||
return IWifi::getService(instance_name);
|
||||
}
|
||||
|
||||
sp<IWifiChip> getWifiChip(const std::string& instance_name) {
|
||||
sp<IWifi> wifi = IWifi::getService(instance_name);
|
||||
sp<IWifi> wifi = getWifi(instance_name);
|
||||
if (!wifi.get()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
// Note: We only have a single instance of each of these objects currently.
|
||||
// These helper functions should be modified to return vectors if we support
|
||||
// multiple instances.
|
||||
android::sp<android::hardware::wifi::V1_0::IWifi> getWifi(
|
||||
const std::string& instance_name);
|
||||
android::sp<android::hardware::wifi::V1_0::IWifiChip> getWifiChip(
|
||||
const std::string& instance_name);
|
||||
android::sp<android::hardware::wifi::V1_0::IWifiApIface> getWifiApIface(
|
||||
|
||||
@@ -47,16 +47,24 @@ namespace {
|
||||
// Helper function to initialize the driver and firmware to AP mode
|
||||
// using the vendor HAL HIDL interface.
|
||||
void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
|
||||
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
|
||||
ChipModeId mode_id;
|
||||
EXPECT_TRUE(configureChipToSupportIfaceType(
|
||||
wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::AP, &mode_id));
|
||||
if (getWifi(wifi_instance_name) != nullptr) {
|
||||
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
|
||||
ChipModeId mode_id;
|
||||
EXPECT_TRUE(configureChipToSupportIfaceType(
|
||||
wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::AP, &mode_id));
|
||||
} else {
|
||||
LOG(WARNING) << __func__ << ": Vendor HAL not supported";
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to deinitialize the driver and firmware
|
||||
// using the vendor HAL HIDL interface.
|
||||
void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
|
||||
stopWifi(wifi_instance_name);
|
||||
if (getWifi(wifi_instance_name) != nullptr) {
|
||||
stopWifi(wifi_instance_name);
|
||||
} else {
|
||||
LOG(WARNING) << __func__ << ": Vendor HAL not supported";
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -58,11 +58,14 @@ void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
|
||||
if (wifi_instance_name == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
|
||||
ChipModeId mode_id;
|
||||
EXPECT_TRUE(configureChipToSupportIfaceType(
|
||||
wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::STA, &mode_id));
|
||||
if (getWifi(wifi_instance_name) != nullptr) {
|
||||
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
|
||||
ChipModeId mode_id;
|
||||
EXPECT_TRUE(configureChipToSupportIfaceType(
|
||||
wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::STA, &mode_id));
|
||||
} else {
|
||||
LOG(WARNING) << __func__ << ": Vendor HAL not supported";
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to deinitialize the driver and firmware
|
||||
@@ -72,8 +75,11 @@ void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
|
||||
if (wifi_instance_name == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
stopWifi(wifi_instance_name);
|
||||
if (getWifi(wifi_instance_name) != nullptr) {
|
||||
stopWifi(wifi_instance_name);
|
||||
} else {
|
||||
LOG(WARNING) << __func__ << ": Vendor HAL not supported";
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to find any iface of the desired type exposed.
|
||||
|
||||
Reference in New Issue
Block a user