summaryrefslogtreecommitdiffstats
path: root/tests/bar
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bar')
-rw-r--r--tests/bar/1.0/default/Android.bp21
-rw-r--r--tests/bar/1.0/default/Bar.cpp137
-rw-r--r--tests/bar/1.0/default/Bar.h68
-rw-r--r--tests/bar/1.0/default/ImportTypes.cpp21
-rw-r--r--tests/bar/1.0/default/ImportTypes.h36
5 files changed, 283 insertions, 0 deletions
diff --git a/tests/bar/1.0/default/Android.bp b/tests/bar/1.0/default/Android.bp
new file mode 100644
index 0000000000..0d47001c81
--- /dev/null
+++ b/tests/bar/1.0/default/Android.bp
@@ -0,0 +1,21 @@
+
+
+cc_library_shared {
+ name: "android.hardware.tests.bar@1.0-impl",
+ relative_install_path: "hw",
+ srcs: [
+ "Bar.cpp",
+ "ImportTypes.cpp",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libhidl",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "android.hardware.tests.foo@1.0",
+ "android.hardware.tests.bar@1.0",
+ ],
+
+}
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
new file mode 100644
index 0000000000..44338028d0
--- /dev/null
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -0,0 +1,137 @@
+
+#define LOG_TAG "hidl_test"
+
+#include "Bar.h"
+#include <android-base/logging.h>
+#include <inttypes.h>
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace bar {
+namespace V1_0 {
+namespace implementation {
+
+Bar::Bar() {
+ mFoo = IFoo::getService("", true);
+}
+
+// Methods from ::android::hardware::tests::foo::V1_0::IFoo follow.
+Return<void> Bar::doThis(float param) {
+ return mFoo->doThis(param);
+}
+
+Return<void> Bar::doThis(uint32_t param) {
+ return mFoo->doThis(param);
+}
+
+Return<int32_t> Bar::doThatAndReturnSomething(
+ int64_t param) {
+ return mFoo->doThatAndReturnSomething(param);
+}
+
+Return<double> Bar::doQuiteABit(
+ int32_t a,
+ int64_t b,
+ float c,
+ double d) {
+ return mFoo->doQuiteABit(a, b, c, d);
+}
+
+Return<void> Bar::doSomethingElse(
+ const hidl_array<int32_t, 15> &param, doSomethingElse_cb _cb) {
+ return mFoo->doSomethingElse(param, _cb);
+}
+
+Return<void> Bar::doStuffAndReturnAString(
+ doStuffAndReturnAString_cb _cb) {
+ return mFoo->doStuffAndReturnAString(_cb);
+}
+
+Return<void> Bar::mapThisVector(
+ const hidl_vec<int32_t> &param, mapThisVector_cb _cb) {
+ return mFoo->mapThisVector(param, _cb);
+}
+
+Return<void> Bar::callMe(
+ const sp<IFooCallback> &cb) {
+ return mFoo->callMe(cb);
+}
+
+Return<Bar::SomeEnum> Bar::useAnEnum(SomeEnum param) {
+ return mFoo->useAnEnum(param);
+}
+
+Return<void> Bar::haveAGooberVec(const hidl_vec<Goober>& param) {
+ return mFoo->haveAGooberVec(param);
+}
+
+Return<void> Bar::haveAGoober(const Goober &g) {
+ return mFoo->haveAGoober(g);
+}
+
+Return<void> Bar::haveAGooberArray(const hidl_array<Goober, 20> &lots) {
+ return mFoo->haveAGooberArray(lots);
+}
+
+Return<void> Bar::haveATypeFromAnotherFile(const Abc &def) {
+ return mFoo->haveATypeFromAnotherFile(def);
+}
+
+Return<void> Bar::haveSomeStrings(
+ const hidl_array<hidl_string, 3> &array,
+ haveSomeStrings_cb _cb) {
+ return mFoo->haveSomeStrings(array, _cb);
+}
+
+Return<void> Bar::haveAStringVec(
+ const hidl_vec<hidl_string> &vector,
+ haveAStringVec_cb _cb) {
+ return mFoo->haveAStringVec(vector, _cb);
+}
+
+Return<void> Bar::transposeMe(
+ const hidl_array<float, 3, 5> &in, transposeMe_cb _cb) {
+ return mFoo->transposeMe(in, _cb);
+}
+
+Return<void> Bar::callingDrWho(
+ const MultiDimensional &in, callingDrWho_cb _hidl_cb) {
+ return mFoo->callingDrWho(in, _hidl_cb);
+}
+
+Return<void> Bar::transpose(const StringMatrix5x3 &in, transpose_cb _hidl_cb) {
+ return mFoo->transpose(in, _hidl_cb);
+}
+
+Return<void> Bar::transpose2(
+ const hidl_array<hidl_string, 5, 3> &in, transpose2_cb _hidl_cb) {
+ return mFoo->transpose2(in, _hidl_cb);
+}
+
+Return<void> Bar::sendVec(
+ const hidl_vec<uint8_t> &data, sendVec_cb _hidl_cb) {
+ return mFoo->sendVec(data, _hidl_cb);
+}
+
+Return<void> Bar::sendVecVec(sendVecVec_cb _hidl_cb) {
+ return mFoo->sendVecVec(_hidl_cb);
+}
+
+// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
+Return<void> Bar::thisIsNew() {
+ ALOGI("SERVER(Bar) thisIsNew");
+
+ return Void();
+}
+
+IBar* HIDL_FETCH_IBar(const char* /* name */) {
+ return new Bar();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace bar
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h
new file mode 100644
index 0000000000..58d9f9a1ba
--- /dev/null
+++ b/tests/bar/1.0/default/Bar.h
@@ -0,0 +1,68 @@
+#ifndef HIDL_GENERATED_android_hardware_tests_bar_V1_0_Bar_H_
+#define HIDL_GENERATED_android_hardware_tests_bar_V1_0_Bar_H_
+
+#include <android/hardware/tests/bar/1.0/IBar.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tests {
+namespace bar {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::bar::V1_0::IBar;
+using ::android::hardware::tests::foo::V1_0::Abc;
+using ::android::hardware::tests::foo::V1_0::IFoo;
+using ::android::hardware::tests::foo::V1_0::IFooCallback;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct Bar : public IBar {
+
+ Bar();
+
+ // Methods from ::android::hardware::tests::foo::V1_0::IFoo follow.
+ virtual Return<void> doThis(float param) override;
+ virtual Return<void> doThis(uint32_t param) override;
+ virtual Return<int32_t> doThatAndReturnSomething(int64_t param) override;
+ virtual Return<double> doQuiteABit(int32_t a, int64_t b, float c, double d) override;
+ virtual Return<void> doSomethingElse(const hidl_array<int32_t, 15 /* 15 */>& param, doSomethingElse_cb _hidl_cb) override;
+ virtual Return<void> doStuffAndReturnAString(doStuffAndReturnAString_cb _hidl_cb) override;
+ virtual Return<void> mapThisVector(const hidl_vec<int32_t>& param, mapThisVector_cb _hidl_cb) override;
+ virtual Return<void> callMe(const sp<IFooCallback>& cb) override;
+ virtual Return<IFoo::SomeEnum> useAnEnum(IFoo::SomeEnum zzz) override;
+ virtual Return<void> haveAGooberVec(const hidl_vec<IFoo::Goober>& param) override;
+ virtual Return<void> haveAGoober(const IFoo::Goober& g) override;
+ virtual Return<void> haveAGooberArray(const hidl_array<IFoo::Goober, 20 /* 20 */>& lots) override;
+ virtual Return<void> haveATypeFromAnotherFile(const Abc& def) override;
+ virtual Return<void> haveSomeStrings(const hidl_array<hidl_string, 3 /* 3 */>& array, haveSomeStrings_cb _hidl_cb) override;
+ virtual Return<void> haveAStringVec(const hidl_vec<hidl_string>& vector, haveAStringVec_cb _hidl_cb) override;
+ virtual Return<void> transposeMe(const hidl_array<float, 3 /* 3 */, 5 /* 5 */>& in, transposeMe_cb _hidl_cb) override;
+ virtual Return<void> callingDrWho(const IFoo::MultiDimensional& in, callingDrWho_cb _hidl_cb) override;
+ virtual Return<void> transpose(const IFoo::StringMatrix5x3& in, transpose_cb _hidl_cb) override;
+ virtual Return<void> transpose2(const hidl_array<hidl_string, 5 /* 5 */, 3 /* 3 */>& in, transpose2_cb _hidl_cb) override;
+ virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb) override;
+ virtual Return<void> sendVecVec(sendVecVec_cb _hidl_cb) override;
+
+ // Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
+ Return<void> thisIsNew() override;
+
+private:
+ sp<IFoo> mFoo;
+};
+
+extern "C" IBar* HIDL_FETCH_IBar(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace bar
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tests_bar_V1_0_Bar_H_
diff --git a/tests/bar/1.0/default/ImportTypes.cpp b/tests/bar/1.0/default/ImportTypes.cpp
new file mode 100644
index 0000000000..06ce4e5dfd
--- /dev/null
+++ b/tests/bar/1.0/default/ImportTypes.cpp
@@ -0,0 +1,21 @@
+#include "ImportTypes.h"
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace bar {
+namespace V1_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::tests::bar::V1_0::IImportTypes follow.
+
+IImportTypes* HIDL_FETCH_IImportTypes(const char* /* name */) {
+ return new ImportTypes();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace bar
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/bar/1.0/default/ImportTypes.h b/tests/bar/1.0/default/ImportTypes.h
new file mode 100644
index 0000000000..b43be70bfd
--- /dev/null
+++ b/tests/bar/1.0/default/ImportTypes.h
@@ -0,0 +1,36 @@
+#ifndef HIDL_GENERATED_android_hardware_tests_bar_V1_0_ImportTypes_H_
+#define HIDL_GENERATED_android_hardware_tests_bar_V1_0_ImportTypes_H_
+
+#include <android/hardware/tests/bar/1.0/IImportTypes.h>
+#include <hidl/Status.h>
+
+#include <hidl/MQDescriptor.h>
+namespace android {
+namespace hardware {
+namespace tests {
+namespace bar {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::bar::V1_0::IImportTypes;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+struct ImportTypes : public IImportTypes {
+ // Methods from ::android::hardware::tests::bar::V1_0::IImportTypes follow.
+
+};
+
+extern "C" IImportTypes* HIDL_FETCH_IImportTypes(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace bar
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // HIDL_GENERATED_android_hardware_tests_bar_V1_0_ImportTypes_H_