1 #ifndef __VTS_DRIVER__android_hardware_tests_msgq_V1_0_ITestMsgQ__ 2 #define __VTS_DRIVER__android_hardware_tests_msgq_V1_0_ITestMsgQ__ 3 4 #undef LOG_TAG 5 #define LOG_TAG "FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ" 6 7 #include <stdio.h> 8 #include <stdarg.h> 9 #include <stdlib.h> 10 #include <string.h> 11 #include <utils/Log.h> 12 13 #include <driver_base/DriverBase.h> 14 #include <driver_base/DriverCallbackBase.h> 15 16 #include <VtsDriverCommUtil.h> 17 18 #include <android/hardware/tests/msgq/1.0/ITestMsgQ.h> 19 #include <hidl/HidlSupport.h> 20 #include <android/hidl/base/1.0/types.h> 21 22 23 using namespace android::hardware::tests::msgq::V1_0; 24 namespace android { 25 namespace vts { 26 ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits EnumValue__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const ScalarDataValueMessage& arg); 27 uint32_t Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(); 28 bool Verify__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result); 29 void SetResult__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(VariableSpecificationMessage* result_msg, ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits result_value); 30 31 class Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ : public ::android::hardware::tests::msgq::V1_0::ITestMsgQ, public DriverCallbackBase { 32 public: 33 Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string& callback_socket_name) 34 : callback_socket_name_(callback_socket_name) {}; 35 36 virtual ~Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ() = default; 37 38 ::android::hardware::Return<void> configureFmqSyncReadWrite( 39 std::function<void(bool arg0,const ::android::hardware::MQDescriptorSync<uint16_t>& arg1)> cb) override; 40 41 ::android::hardware::Return<void> getFmqUnsyncWrite( 42 bool arg0, std::function<void(bool arg0,const ::android::hardware::MQDescriptorUnsync<uint16_t>& arg1)> cb) override; 43 44 ::android::hardware::Return<bool> requestWriteFmqSync( 45 int32_t arg0) override; 46 47 ::android::hardware::Return<bool> requestReadFmqSync( 48 int32_t arg0) override; 49 50 ::android::hardware::Return<bool> requestWriteFmqUnsync( 51 int32_t arg0) override; 52 53 ::android::hardware::Return<bool> requestReadFmqUnsync( 54 int32_t arg0) override; 55 56 ::android::hardware::Return<void> requestBlockingRead( 57 int32_t arg0) override; 58 59 ::android::hardware::Return<void> requestBlockingReadDefaultEventFlagBits( 60 int32_t arg0) override; 61 62 ::android::hardware::Return<void> requestBlockingReadRepeat( 63 int32_t arg0, 64 int32_t arg1) override; 65 66 67 private: 68 string callback_socket_name_; 69 }; 70 71 sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> VtsFuzzerCreateVts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string& callback_socket_name); 72 73 class FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ : public DriverBase { 74 public: 75 FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ() : DriverBase(HAL_HIDL), hw_binder_proxy_() {} 76 77 explicit FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ(::android::hardware::tests::msgq::V1_0::ITestMsgQ* hw_binder_proxy) : DriverBase(HAL_HIDL), hw_binder_proxy_(hw_binder_proxy) {} 78 uint64_t GetHidlInterfaceProxy() const { 79 return reinterpret_cast<uintptr_t>(hw_binder_proxy_.get()); 80 } 81 protected: 82 bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name); 83 bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg); 84 bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result); 85 bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result); 86 bool GetService(bool get_stub, const char* service_name); 87 88 private: 89 sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> hw_binder_proxy_; 90 }; 91 92 93 extern "C" { 94 extern android::vts::DriverBase* vts_func_4_android_hardware_tests_msgq_V1_0_ITestMsgQ_(); 95 extern android::vts::DriverBase* vts_func_4_android_hardware_tests_msgq_V1_0_ITestMsgQ_with_arg(uint64_t hw_binder_proxy); 96 } 97 } // namespace vts 98 } // namespace android 99 #endif 100