This commit removes the dependency on hal and hidl from interfaces related to the memory.
- IMemory@1.0
- IAllocator@1.0
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
${CMAKE_CURRENT_SOURCE_DIR}/hidl/manager/1.0/ServiceManagerAll.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hidl/manager/1.0/ServiceNotificationAll.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hidl/manager/1.1/ServiceManagerAll.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/hidl/memory/1.0/MapperAll.cpp
+# ${CMAKE_CURRENT_SOURCE_DIR}/hidl/memory/1.0/MapperAll.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hidl/memory/1.0/MemoryAll.cpp
)
#define LOG_TAG "android.hidl.allocator@1.0::Allocator"
+#include <android/hidl/allocator/1.0/IAllocator.h>
+
+#if 0 // REF-ANN
#include <android/log.h>
#include <cutils/trace.h>
#include <hidl/HidlTransportSupport.h>
#include <android/hidl/allocator/1.0/BsAllocator.h>
#include <android/hidl/base/1.0/BpHwBase.h>
#include <hidl/ServiceManagement.h>
+#endif // REF-ANN
namespace android {
namespace hidl {
const char* IAllocator::descriptor("android.hidl.allocator@1.0::IAllocator");
+#if 0 // REF-ANN
__attribute__((constructor))static void static_constructor() {
::android::hardware::details::gBnConstructorMap.set(IAllocator::descriptor,
[](void *iIntf) -> ::android::sp<::android::hardware::IBinder> {
}
return iface;
}
+#endif // REF-ANN
// static
::android::sp<IAllocator> IAllocator::getService(const std::string &serviceName, const bool getStub) {
+ // TODO-NNRT re-implement this. Should return an Allocator appropriate for serviceName.
+ return nullptr;
+#if 0 // REF-ANN
using ::android::hardware::defaultServiceManager;
using ::android::hardware::details::waitForHwService;
using ::android::hardware::getPassthroughServiceManager;
}
}
return iface;
+#endif // REF-ANN
}
+#if 0 // REF-ANN
::android::status_t IAllocator::registerAsService(const std::string &serviceName) {
::android::hardware::details::onRegistration("android.hidl.allocator@1.0", "IAllocator", serviceName);
static_assert(sizeof(::android::hardware::hidl_memory) == 40, "wrong size");
static_assert(sizeof(::android::hardware::hidl_string) == 16, "wrong size");
static_assert(sizeof(::android::hardware::hidl_vec<char>) == 16, "wrong size");
+#endif // REF-ANN
} // namespace V1_0
} // namespace allocator
#define LOG_TAG "android.hidl.memory@1.0::Memory"
+#include <android/hidl/memory/1.0/IMemory.h>
+#if 0 // REF-ANN
#include <android/log.h>
#include <cutils/trace.h>
#include <hidl/HidlTransportSupport.h>
#include <android/hidl/memory/1.0/BsMemory.h>
#include <android/hidl/base/1.0/BpHwBase.h>
#include <hidl/ServiceManagement.h>
+#endif // REF-ANN
namespace android {
namespace hidl {
const char* IMemory::descriptor("android.hidl.memory@1.0::IMemory");
+#if 0 // REF-ANN
__attribute__((constructor))static void static_constructor() {
::android::hardware::details::gBnConstructorMap.set(IMemory::descriptor,
[](void *iIntf) -> ::android::sp<::android::hardware::IBinder> {
static_assert(sizeof(::android::hardware::hidl_memory) == 40, "wrong size");
static_assert(sizeof(::android::hardware::hidl_string) == 16, "wrong size");
static_assert(sizeof(::android::hardware::hidl_vec<char>) == 16, "wrong size");
+#endif // REF-ANN
} // namespace V1_0
} // namespace memory
#ifndef HIDL_GENERATED_ANDROID_HIDL_ALLOCATOR_V1_0_IALLOCATOR_H
#define HIDL_GENERATED_ANDROID_HIDL_ALLOCATOR_V1_0_IALLOCATOR_H
+#include <hidl/Status.h>
+#include <utils/RefBase.h>
+#include <hidl/HidlSupport.h>
+#if 0 // REF-ANN
#include <android/hidl/base/1.0/IBase.h>
#include <android/hidl/manager/1.0/IServiceNotification.h>
-#include <hidl/HidlSupport.h>
#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
#include <utils/NativeHandle.h>
#include <utils/misc.h>
+#endif // REF-ANN
namespace android {
namespace hidl {
namespace allocator {
namespace V1_0 {
-struct IAllocator : public ::android::hidl::base::V1_0::IBase {
- virtual bool isRemote() const override { return false; }
+struct IAllocator : virtual public ::android::RefBase {
+ static const char* descriptor;
+ virtual bool isRemote() const { return false; }
using allocate_cb = std::function<void(bool success, const ::android::hardware::hidl_memory& mem)>;
virtual ::android::hardware::Return<void> allocate(uint64_t size, allocate_cb _hidl_cb) = 0;
+ static ::android::sp<IAllocator> getService(const std::string &serviceName="default", bool getStub=false);
+ static ::android::sp<IAllocator> getService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return getService(str, getStub); }
+};
+
+#if 0 // REF-ANN
+struct IAllocator : public ::android::hidl::base::V1_0::IBase {
using batchAllocate_cb = std::function<void(bool success, const ::android::hardware::hidl_vec<::android::hardware::hidl_memory>& batch)>;
virtual ::android::hardware::Return<void> batchAllocate(uint64_t size, uint64_t count, batchAllocate_cb _hidl_cb) = 0;
static ::android::hardware::Return<::android::sp<IAllocator>> castFrom(const ::android::sp<IAllocator>& parent, bool emitError = false);
static ::android::hardware::Return<::android::sp<IAllocator>> castFrom(const ::android::sp<::android::hidl::base::V1_0::IBase>& parent, bool emitError = false);
- static const char* descriptor;
-
static ::android::sp<IAllocator> tryGetService(const std::string &serviceName="default", bool getStub=false);
static ::android::sp<IAllocator> tryGetService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return tryGetService(str, getStub); }
static ::android::sp<IAllocator> tryGetService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return tryGetService(str, getStub); }
static ::android::sp<IAllocator> tryGetService(bool getStub) { return tryGetService("default", getStub); }
- static ::android::sp<IAllocator> getService(const std::string &serviceName="default", bool getStub=false);
static ::android::sp<IAllocator> getService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return getService(str, getStub); }
- static ::android::sp<IAllocator> getService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return getService(str, getStub); }
static ::android::sp<IAllocator> getService(bool getStub) { return getService("default", getStub); }
__attribute__ ((warn_unused_result))::android::status_t registerAsService(const std::string &serviceName="default");
static bool registerForNotifications(
const std::string &serviceName,
const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> ¬ification);
};
+#endif // REF-ANN
std::string toString(const ::android::sp<IAllocator>&);
#ifndef HIDL_GENERATED_ANDROID_HIDL_MEMORY_V1_0_IMEMORY_H
#define HIDL_GENERATED_ANDROID_HIDL_MEMORY_V1_0_IMEMORY_H
+
+#include <hidl/Status.h>
+#include <utils/RefBase.h>
+#if 0 // REF-ANN
#include <android/hidl/base/1.0/IBase.h>
#include <android/hidl/manager/1.0/IServiceNotification.h>
#include <hidl/HidlSupport.h>
#include <hidl/MQDescriptor.h>
-#include <hidl/Status.h>
#include <utils/NativeHandle.h>
#include <utils/misc.h>
+#endif // REF-ANN
namespace android {
namespace hidl {
namespace memory {
namespace V1_0 {
-struct IMemory : public ::android::hidl::base::V1_0::IBase {
- virtual bool isRemote() const override { return false; }
-
+struct IMemory : virtual public ::android::RefBase {
+ static const char* descriptor;
+ virtual bool isRemote() const { return false; }
+ virtual ::android::hardware::Return<void*> getPointer() = 0;
virtual ::android::hardware::Return<void> update() = 0;
+ virtual ::android::hardware::Return<void> commit() = 0;
+};
+#if 0 // REF-ANN
+struct IMemory : public ::android::hidl::base::V1_0::IBase {
virtual ::android::hardware::Return<void> updateRange(uint64_t start, uint64_t length) = 0;
virtual ::android::hardware::Return<void> read() = 0;
virtual ::android::hardware::Return<void> readRange(uint64_t start, uint64_t length) = 0;
- virtual ::android::hardware::Return<void> commit() = 0;
-
- virtual ::android::hardware::Return<void*> getPointer() = 0;
-
virtual ::android::hardware::Return<uint64_t> getSize() = 0;
using interfaceChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
static ::android::hardware::Return<::android::sp<IMemory>> castFrom(const ::android::sp<IMemory>& parent, bool emitError = false);
static ::android::hardware::Return<::android::sp<IMemory>> castFrom(const ::android::sp<::android::hidl::base::V1_0::IBase>& parent, bool emitError = false);
- static const char* descriptor;
-
static ::android::sp<IMemory> tryGetService(const std::string &serviceName="default", bool getStub=false);
static ::android::sp<IMemory> tryGetService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return tryGetService(str, getStub); }
static ::android::sp<IMemory> tryGetService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return tryGetService(str, getStub); }
const std::string &serviceName,
const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> ¬ification);
};
+#endif // REF-ANN
std::string toString(const ::android::sp<IMemory>&);