mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 05:56:34 +00:00
CEC: Add VTS test to get port info am: 0098a8d3d5 am: 5437ca198c am: 372de06d81
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1579866 Change-Id: Ib293fecd9d0c4b57cc521985d50862ae9ef65081
This commit is contained in:
committed by
Automerger Merge Worker
commit
70bd68f32b
@@ -27,9 +27,12 @@
|
||||
|
||||
using ::android::sp;
|
||||
using ::android::hardware::hidl_death_recipient;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::tv::cec::V1_0::CecLogicalAddress;
|
||||
using ::android::hardware::tv::cec::V1_0::CecMessage;
|
||||
using ::android::hardware::tv::cec::V1_0::HdmiPortInfo;
|
||||
using ::android::hardware::tv::cec::V1_0::HdmiPortType;
|
||||
using ::android::hardware::tv::cec::V1_0::IHdmiCec;
|
||||
using ::android::hardware::tv::cec::V1_0::OptionKey;
|
||||
using ::android::hardware::tv::cec::V1_0::Result;
|
||||
@@ -96,6 +99,23 @@ TEST_P(HdmiCecTest, VendorId) {
|
||||
EXPECT_NE(ret, INCORRECT_VENDOR_ID);
|
||||
}
|
||||
|
||||
TEST_P(HdmiCecTest, GetPortInfo) {
|
||||
hidl_vec<HdmiPortInfo> ports;
|
||||
Return<void> ret =
|
||||
hdmiCec->getPortInfo([&ports](hidl_vec<HdmiPortInfo> list) { ports = list; });
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
bool cecSupportedOnDevice = false;
|
||||
for (size_t i = 0; i < ports.size(); ++i) {
|
||||
EXPECT_TRUE((ports[i].type == HdmiPortType::OUTPUT) ||
|
||||
(ports[i].type == HdmiPortType::INPUT));
|
||||
if (ports[i].portId == 0) {
|
||||
ALOGW("%s: Port id should start from 1", __func__);
|
||||
}
|
||||
cecSupportedOnDevice = cecSupportedOnDevice | ports[i].cecSupported;
|
||||
}
|
||||
EXPECT_NE(cecSupportedOnDevice, false) << "At least one port should support CEC";
|
||||
}
|
||||
|
||||
TEST_P(HdmiCecTest, SetOption) {
|
||||
Return<void> ret;
|
||||
ret = hdmiCec->setOption(OptionKey::WAKEUP, false);
|
||||
|
||||
Reference in New Issue
Block a user