Files
hardware_interfaces/tests/inheritance/1.0/default/Parent.cpp
Steven Moreland 9d320e3fbe Update inheritance test implementation.
HIDL_FETCH_IParent returns a child object
when the "child" instance name is requested.

Bug: 67104214
Test: hidl's run_all_device_tests.sh
Change-Id: Ie4b85d657e5d066fb77832e188062af29bc2e7c6
2017-10-03 12:52:51 -07:00

42 lines
894 B
C++

#define LOG_TAG "hidl_test"
#include "Parent.h"
#include <log/log.h>
#include "Child.h"
namespace android {
namespace hardware {
namespace tests {
namespace inheritance {
namespace V1_0 {
namespace implementation {
// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
Return<void> Parent::doGrandparent() {
ALOGI("SERVER(Bar) Parent::doGrandparent");
return Void();
}
// Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
Return<void> Parent::doParent() {
ALOGI("SERVER(Bar) Parent::doParent");
return Void();
}
IParent* HIDL_FETCH_IParent(const char* name) {
if (name == std::string("child")) {
return new Child();
}
return new Parent();
}
} // namespace implementation
} // namespace V1_0
} // namespace inheritance
} // namespace tests
} // namespace hardware
} // namespace android