upload android base code part4
This commit is contained in:
parent
b9e30e05b1
commit
78ea2404cd
23455 changed files with 5250148 additions and 0 deletions
80
android/hardware/interfaces/tests/inheritance/1.0/Android.bp
Normal file
80
android/hardware/interfaces/tests/inheritance/1.0/Android.bp
Normal file
|
@ -0,0 +1,80 @@
|
|||
// This file is autogenerated by hidl-gen. Do not edit manually.
|
||||
|
||||
filegroup {
|
||||
name: "android.hardware.tests.inheritance@1.0_hal",
|
||||
srcs: [
|
||||
"IChild.hal",
|
||||
"IFetcher.hal",
|
||||
"IGrandparent.hal",
|
||||
"IParent.hal",
|
||||
],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "android.hardware.tests.inheritance@1.0_genc++",
|
||||
tools: ["hidl-gen"],
|
||||
cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.inheritance@1.0",
|
||||
srcs: [
|
||||
":android.hardware.tests.inheritance@1.0_hal",
|
||||
],
|
||||
out: [
|
||||
"android/hardware/tests/inheritance/1.0/ChildAll.cpp",
|
||||
"android/hardware/tests/inheritance/1.0/FetcherAll.cpp",
|
||||
"android/hardware/tests/inheritance/1.0/GrandparentAll.cpp",
|
||||
"android/hardware/tests/inheritance/1.0/ParentAll.cpp",
|
||||
],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "android.hardware.tests.inheritance@1.0_genc++_headers",
|
||||
tools: ["hidl-gen"],
|
||||
cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.inheritance@1.0",
|
||||
srcs: [
|
||||
":android.hardware.tests.inheritance@1.0_hal",
|
||||
],
|
||||
out: [
|
||||
"android/hardware/tests/inheritance/1.0/IChild.h",
|
||||
"android/hardware/tests/inheritance/1.0/IHwChild.h",
|
||||
"android/hardware/tests/inheritance/1.0/BnHwChild.h",
|
||||
"android/hardware/tests/inheritance/1.0/BpHwChild.h",
|
||||
"android/hardware/tests/inheritance/1.0/BsChild.h",
|
||||
"android/hardware/tests/inheritance/1.0/IFetcher.h",
|
||||
"android/hardware/tests/inheritance/1.0/IHwFetcher.h",
|
||||
"android/hardware/tests/inheritance/1.0/BnHwFetcher.h",
|
||||
"android/hardware/tests/inheritance/1.0/BpHwFetcher.h",
|
||||
"android/hardware/tests/inheritance/1.0/BsFetcher.h",
|
||||
"android/hardware/tests/inheritance/1.0/IGrandparent.h",
|
||||
"android/hardware/tests/inheritance/1.0/IHwGrandparent.h",
|
||||
"android/hardware/tests/inheritance/1.0/BnHwGrandparent.h",
|
||||
"android/hardware/tests/inheritance/1.0/BpHwGrandparent.h",
|
||||
"android/hardware/tests/inheritance/1.0/BsGrandparent.h",
|
||||
"android/hardware/tests/inheritance/1.0/IParent.h",
|
||||
"android/hardware/tests/inheritance/1.0/IHwParent.h",
|
||||
"android/hardware/tests/inheritance/1.0/BnHwParent.h",
|
||||
"android/hardware/tests/inheritance/1.0/BpHwParent.h",
|
||||
"android/hardware/tests/inheritance/1.0/BsParent.h",
|
||||
],
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "android.hardware.tests.inheritance@1.0",
|
||||
defaults: ["hidl-module-defaults"],
|
||||
generated_sources: ["android.hardware.tests.inheritance@1.0_genc++"],
|
||||
generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
|
||||
export_generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
|
||||
vendor_available: true,
|
||||
shared_libs: [
|
||||
"libhidlbase",
|
||||
"libhidltransport",
|
||||
"libhwbinder",
|
||||
"liblog",
|
||||
"libutils",
|
||||
"libcutils",
|
||||
],
|
||||
export_shared_lib_headers: [
|
||||
"libhidlbase",
|
||||
"libhidltransport",
|
||||
"libhwbinder",
|
||||
"libutils",
|
||||
],
|
||||
}
|
210
android/hardware/interfaces/tests/inheritance/1.0/Android.mk
Normal file
210
android/hardware/interfaces/tests/inheritance/1.0/Android.mk
Normal file
|
@ -0,0 +1,210 @@
|
|||
# This file is autogenerated by hidl-gen. Do not edit manually.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.tests.inheritance-V1.0-java
|
||||
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
|
||||
|
||||
intermediates := $(call local-generated-sources-dir, COMMON)
|
||||
|
||||
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := \
|
||||
android.hidl.base-V1.0-java \
|
||||
|
||||
|
||||
#
|
||||
# Build IChild.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IChild.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IChild.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IChild
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IChild.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
#
|
||||
# Build IFetcher.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IFetcher.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IFetcher.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IChild.hal
|
||||
$(GEN): $(LOCAL_PATH)/IChild.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IFetcher
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IFetcher.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
#
|
||||
# Build IGrandparent.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IGrandparent.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IGrandparent
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
#
|
||||
# Build IParent.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IParent.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IParent
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IParent.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
include $(BUILD_JAVA_LIBRARY)
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.tests.inheritance-V1.0-java-static
|
||||
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
|
||||
|
||||
intermediates := $(call local-generated-sources-dir, COMMON)
|
||||
|
||||
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
|
||||
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||
android.hidl.base-V1.0-java-static \
|
||||
|
||||
|
||||
#
|
||||
# Build IChild.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IChild.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IChild.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IChild
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IChild.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
#
|
||||
# Build IFetcher.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IFetcher.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IFetcher.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IChild.hal
|
||||
$(GEN): $(LOCAL_PATH)/IChild.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IFetcher
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IFetcher.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
#
|
||||
# Build IGrandparent.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IGrandparent.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IGrandparent
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
#
|
||||
# Build IParent.hal
|
||||
#
|
||||
GEN := $(intermediates)/android/hardware/tests/inheritance/V1_0/IParent.java
|
||||
$(GEN): $(HIDL)
|
||||
$(GEN): PRIVATE_HIDL := $(HIDL)
|
||||
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IParent.hal
|
||||
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): $(LOCAL_PATH)/IGrandparent.hal
|
||||
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = \
|
||||
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
|
||||
-Ljava \
|
||||
-randroid.hardware:hardware/interfaces \
|
||||
-randroid.hidl:system/libhidl/transport \
|
||||
android.hardware.tests.inheritance@1.0::IParent
|
||||
|
||||
$(GEN): $(LOCAL_PATH)/IParent.hal
|
||||
$(transform-generated-source)
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
||||
|
||||
|
||||
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
22
android/hardware/interfaces/tests/inheritance/1.0/IChild.hal
Normal file
22
android/hardware/interfaces/tests/inheritance/1.0/IChild.hal
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.tests.inheritance@1.0;
|
||||
import IParent;
|
||||
|
||||
interface IChild extends IParent {
|
||||
doChild();
|
||||
};
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.tests.inheritance@1.0;
|
||||
|
||||
import IGrandparent;
|
||||
import IParent;
|
||||
import IChild;
|
||||
|
||||
interface IFetcher {
|
||||
|
||||
getGrandparent(bool sendRemote) generates (IGrandparent parent);
|
||||
getParent(bool sendRemote) generates (IParent parent);
|
||||
getChild(bool sendRemote) generates (IChild child);
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.tests.inheritance@1.0;
|
||||
|
||||
interface IGrandparent {
|
||||
doGrandparent();
|
||||
};
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.tests.inheritance@1.0;
|
||||
|
||||
import IGrandparent;
|
||||
|
||||
interface IParent extends IGrandparent {
|
||||
doParent();
|
||||
};
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
|
||||
cc_library_shared {
|
||||
name: "android.hardware.tests.inheritance@1.0-impl",
|
||||
defaults: ["hidl_defaults"],
|
||||
relative_install_path: "hw",
|
||||
srcs: [
|
||||
"Fetcher.cpp",
|
||||
"Parent.cpp",
|
||||
"Child.cpp",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libhidlbase",
|
||||
"libhidltransport",
|
||||
"liblog",
|
||||
"libutils",
|
||||
"android.hardware.tests.inheritance@1.0",
|
||||
],
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#define LOG_TAG "hidl_test"
|
||||
|
||||
#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> Child::doGrandparent() {
|
||||
ALOGI("SERVER(Bar) Child::doGrandparent");
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
|
||||
Return<void> Child::doParent() {
|
||||
ALOGI("SERVER(Bar) Child::doParent");
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IChild follow.
|
||||
Return<void> Child::doChild() {
|
||||
ALOGI("SERVER(Bar) Child::doChild");
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
||||
IChild* HIDL_FETCH_IChild(const char* /* name */) {
|
||||
return new Child();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_CHILD_H
|
||||
#define ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_CHILD_H
|
||||
|
||||
#include <android/hardware/tests/inheritance/1.0/IChild.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <hidl/MQDescriptor.h>
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tests {
|
||||
namespace inheritance {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::tests::inheritance::V1_0::IParent;
|
||||
using ::android::hardware::tests::inheritance::V1_0::IChild;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Child : public IChild {
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
|
||||
Return<void> doGrandparent() override;
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
|
||||
Return<void> doParent() override;
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IChild follow.
|
||||
Return<void> doChild() override;
|
||||
|
||||
};
|
||||
|
||||
extern "C" IChild* HIDL_FETCH_IChild(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_CHILD_H
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
#define LOG_TAG "hidl_test"
|
||||
|
||||
#include "Fetcher.h"
|
||||
#include <android-base/logging.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tests {
|
||||
namespace inheritance {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
Fetcher::Fetcher() {
|
||||
mPrecious = IChild::getService("local child", true);
|
||||
CHECK(!mPrecious->isRemote());
|
||||
}
|
||||
|
||||
sp<IChild> selectService(bool sendRemote, sp<IChild> &local) {
|
||||
sp<IChild> toSend;
|
||||
if (sendRemote) {
|
||||
toSend = IChild::getService("child");
|
||||
if (!toSend->isRemote()) {
|
||||
toSend = nullptr;
|
||||
}
|
||||
} else {
|
||||
toSend = local;
|
||||
}
|
||||
LOG(INFO) << "SERVER(Fetcher) selectService returning " << toSend.get();
|
||||
return toSend;
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IFetcher follow.
|
||||
Return<sp<IGrandparent>> Fetcher::getGrandparent(bool sendRemote) {
|
||||
return selectService(sendRemote, mPrecious);
|
||||
}
|
||||
|
||||
Return<sp<IParent>> Fetcher::getParent(bool sendRemote) {
|
||||
return selectService(sendRemote, mPrecious);
|
||||
}
|
||||
|
||||
Return<sp<IChild>> Fetcher::getChild(bool sendRemote) {
|
||||
return selectService(sendRemote, mPrecious);
|
||||
}
|
||||
|
||||
IFetcher* HIDL_FETCH_IFetcher(const char* /* name */) {
|
||||
return new Fetcher();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_FETCHER_H
|
||||
#define ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_FETCHER_H
|
||||
|
||||
#include "Child.h"
|
||||
#include <android/hardware/tests/inheritance/1.0/IFetcher.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <hidl/MQDescriptor.h>
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tests {
|
||||
namespace inheritance {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::tests::inheritance::V1_0::IFetcher;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Fetcher : public IFetcher {
|
||||
|
||||
Fetcher();
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IFetcher follow.
|
||||
Return<sp<IGrandparent>> getGrandparent(bool sendRemote) override;
|
||||
Return<sp<IParent>> getParent(bool sendRemote) override;
|
||||
Return<sp<IChild>> getChild(bool sendRemote) override;
|
||||
|
||||
private:
|
||||
sp<IChild> mPrecious;
|
||||
};
|
||||
|
||||
extern "C" IFetcher* HIDL_FETCH_IFetcher(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_FETCHER_H
|
|
@ -0,0 +1,29 @@
|
|||
#define LOG_TAG "hidl_test"
|
||||
#include <android-base/logging.h>
|
||||
|
||||
#include "Grandparent.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> Grandparent::doGrandparent() {
|
||||
ALOGI("SERVER(Bar) Grandparent::doGrandparent");
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
||||
IGrandparent* HIDL_FETCH_IGrandparent(const char* /* name */) {
|
||||
return new Grandparent();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_GRANDPARENT_H
|
||||
#define ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_GRANDPARENT_H
|
||||
|
||||
#include <android/hardware/tests/inheritance/1.0/IGrandparent.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <hidl/MQDescriptor.h>
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tests {
|
||||
namespace inheritance {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::tests::inheritance::V1_0::IGrandparent;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Grandparent : public IGrandparent {
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
|
||||
Return<void> doGrandparent() override;
|
||||
|
||||
};
|
||||
|
||||
extern "C" IGrandparent* HIDL_FETCH_IGrandparent(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_GRANDPARENT_H
|
|
@ -0,0 +1,36 @@
|
|||
#define LOG_TAG "hidl_test"
|
||||
|
||||
#include <log/log.h>
|
||||
|
||||
#include "Parent.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 */) {
|
||||
return new Parent();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_PARENT_H
|
||||
#define ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_PARENT_H
|
||||
|
||||
#include <android/hardware/tests/inheritance/1.0/IParent.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <hidl/MQDescriptor.h>
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace tests {
|
||||
namespace inheritance {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::tests::inheritance::V1_0::IParent;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Parent : public IParent {
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IGrandparent follow.
|
||||
Return<void> doGrandparent() override;
|
||||
|
||||
// Methods from ::android::hardware::tests::inheritance::V1_0::IParent follow.
|
||||
Return<void> doParent() override;
|
||||
|
||||
};
|
||||
|
||||
extern "C" IParent* HIDL_FETCH_IParent(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace inheritance
|
||||
} // namespace tests
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_TESTS_INHERITANCE_V1_0_PARENT_H
|
Loading…
Add table
Add a link
Reference in a new issue