Merge "Add implementation for hwbinder benchmark service."

This commit is contained in:
Zhuoyao Zhang
2016-10-24 16:52:48 +00:00
committed by Gerrit Code Review
4 changed files with 76 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ subdirs = [
"tests/foo/1.0",
"tests/foo/1.0/default",
"tests/libhwbinder/1.0",
"tests/libhwbinder/1.0/default",
"tests/msgq/1.0",
"tests/pointer/1.0",
"tests/pointer/1.0/default",

View File

@@ -0,0 +1,16 @@
cc_library_shared {
name: "android.hardware.tests.libhwbinder@1.0-impl",
relative_install_path: "hw",
srcs: [
"Benchmark.cpp",
],
shared_libs: [
"libbase",
"libhidl",
"libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.libhwbinder@1.0",
],
}

View File

@@ -0,0 +1,28 @@
#define LOG_TAG "libhwbinder_benchmark"
#include "Benchmark.h"
namespace android {
namespace hardware {
namespace tests {
namespace libhwbinder {
namespace V1_0 {
namespace implementation {
Return<void> Benchmark::sendVec(
const ::android::hardware::hidl_vec<uint8_t>& data,
sendVec_cb _hidl_cb) {
_hidl_cb(data);
return Void();
}
IBenchmark* HIDL_FETCH_IBenchmark(const char* /* name */) {
return new Benchmark();
}
} // namespace implementation
} // namespace V1_0
} // namespace libhwbinder
} // namespace tests
} // namespace hardware
} // namespace android

View File

@@ -0,0 +1,31 @@
#ifndef HIDL_GENERATED_android_hardware_benchmark_V1_0_Benchmark_H_
#define HIDL_GENERATED_android_hardware_benchmark_V1_0_Benchmark_H_
#include <android/hardware/tests/libhwbinder/1.0/IBenchmark.h>
#include <hidl/Status.h>
namespace android {
namespace hardware {
namespace tests {
namespace libhwbinder {
namespace V1_0 {
namespace implementation {
using ::android::hardware::tests::libhwbinder::V1_0::IBenchmark;
using ::android::hardware::Return;
using ::android::hardware::hidl_vec;
struct Benchmark : public IBenchmark {
virtual Return<void> sendVec(const hidl_vec<uint8_t>& data, sendVec_cb _hidl_cb) override;
};
extern "C" IBenchmark* HIDL_FETCH_IBenchmark(const char* name);
} // namespace implementation
} // namespace V1_0
} // namespace libhwbinder
} // namespace tests
} // namespace hardware
} // namespace android
#endif // HIDL_GENERATED_android_hardware_benchmark_V1_0_Benchmark_H_