mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Add implementation for hwbinder benchmark service.
Bug:32279499 Test: make android.hardware.tests.libhwbinder@1.0-impl Change-Id: I75056afa32b8189020608779ec495659ea35ed48
This commit is contained in:
@@ -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",
|
||||
|
||||
16
tests/libhwbinder/1.0/default/Android.bp
Normal file
16
tests/libhwbinder/1.0/default/Android.bp
Normal 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",
|
||||
],
|
||||
}
|
||||
28
tests/libhwbinder/1.0/default/Benchmark.cpp
Normal file
28
tests/libhwbinder/1.0/default/Benchmark.cpp
Normal 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
|
||||
31
tests/libhwbinder/1.0/default/Benchmark.h
Normal file
31
tests/libhwbinder/1.0/default/Benchmark.h
Normal 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_
|
||||
Reference in New Issue
Block a user