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
This commit is contained in:
Steven Moreland 2017-10-02 14:47:35 -07:00
parent 9960148420
commit 9d320e3fbe

View file

@ -1,8 +1,10 @@
#define LOG_TAG "hidl_test"
#include "Parent.h"
#include <log/log.h>
#include "Parent.h"
#include "Child.h"
namespace android {
namespace hardware {
@ -23,8 +25,11 @@ Return<void> Parent::doParent() {
return Void();
}
IParent* HIDL_FETCH_IParent(const char* name) {
if (name == std::string("child")) {
return new Child();
}
IParent* HIDL_FETCH_IParent(const char* /* name */) {
return new Parent();
}