Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb9f5078 authored by Zhuoyao Zhang's avatar Zhuoyao Zhang
Browse files

Add implementation for hwbinder benchmark service.

Bug:32279499
Test: make android.hardware.tests.libhwbinder@1.0-impl
Change-Id: I75056afa32b8189020608779ec495659ea35ed48
parent 5bc16ac3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
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",
    ],
}
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
#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 −0
Original line number Diff line number Diff line
#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_