create plugin
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
package android.hardware;
|
||||
|
||||
@JavaOnlyStableParcelable @NdkOnlyStableParcelable parcelable HardwareBuffer ndk_header "android/hardware_buffer_aidl.h";
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.omixlab.mosis;
|
||||
|
||||
import android.hardware.HardwareBuffer;
|
||||
|
||||
// oneway = fire-and-forget (asynchronous)
|
||||
oneway interface IMosisListener {
|
||||
void onServiceInitialized(boolean success);
|
||||
void onBufferAvailable(in HardwareBuffer buffer);
|
||||
void onFrameAvailable();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.omixlab.mosis;
|
||||
|
||||
import com.omixlab.mosis.IMosisListener;
|
||||
|
||||
interface IMosisService {
|
||||
boolean initOS(IMosisListener listener);
|
||||
void onTouchDown(float x, float y);
|
||||
void onTouchMove(float x, float y);
|
||||
void onTouchUp(float x, float y);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisListener.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "aidl/com/omixlab/mosis/IMosisListener.h"
|
||||
|
||||
#include <android/binder_ibinder.h>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef __BIONIC__
|
||||
#ifndef __assert2
|
||||
#define __assert2(a,b,c,d) ((void)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
class BnMosisListener : public ::ndk::BnCInterface<IMosisListener> {
|
||||
public:
|
||||
BnMosisListener();
|
||||
virtual ~BnMosisListener();
|
||||
protected:
|
||||
::ndk::SpAIBinder createBinder() override;
|
||||
private:
|
||||
};
|
||||
class IMosisListenerDelegator : public BnMosisListener {
|
||||
public:
|
||||
explicit IMosisListenerDelegator(const std::shared_ptr<IMosisListener> &impl) : _impl(impl) {
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus onServiceInitialized(bool in_success) override {
|
||||
return _impl->onServiceInitialized(in_success);
|
||||
}
|
||||
::ndk::ScopedAStatus onBufferAvailable(const ::aidl::android::hardware::HardwareBuffer& in_buffer) override {
|
||||
return _impl->onBufferAvailable(in_buffer);
|
||||
}
|
||||
::ndk::ScopedAStatus onFrameAvailable() override {
|
||||
return _impl->onFrameAvailable();
|
||||
}
|
||||
protected:
|
||||
private:
|
||||
std::shared_ptr<IMosisListener> _impl;
|
||||
};
|
||||
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisService.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "aidl/com/omixlab/mosis/IMosisService.h"
|
||||
|
||||
#include <android/binder_ibinder.h>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef __BIONIC__
|
||||
#ifndef __assert2
|
||||
#define __assert2(a,b,c,d) ((void)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
class BnMosisService : public ::ndk::BnCInterface<IMosisService> {
|
||||
public:
|
||||
BnMosisService();
|
||||
virtual ~BnMosisService();
|
||||
protected:
|
||||
::ndk::SpAIBinder createBinder() override;
|
||||
private:
|
||||
};
|
||||
class IMosisServiceDelegator : public BnMosisService {
|
||||
public:
|
||||
explicit IMosisServiceDelegator(const std::shared_ptr<IMosisService> &impl) : _impl(impl) {
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus initOS(const std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener>& in_listener, bool* _aidl_return) override {
|
||||
return _impl->initOS(in_listener, _aidl_return);
|
||||
}
|
||||
::ndk::ScopedAStatus onTouchDown(float in_x, float in_y) override {
|
||||
return _impl->onTouchDown(in_x, in_y);
|
||||
}
|
||||
::ndk::ScopedAStatus onTouchMove(float in_x, float in_y) override {
|
||||
return _impl->onTouchMove(in_x, in_y);
|
||||
}
|
||||
::ndk::ScopedAStatus onTouchUp(float in_x, float in_y) override {
|
||||
return _impl->onTouchUp(in_x, in_y);
|
||||
}
|
||||
protected:
|
||||
private:
|
||||
std::shared_ptr<IMosisService> _impl;
|
||||
};
|
||||
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisListener.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "aidl/com/omixlab/mosis/IMosisListener.h"
|
||||
|
||||
#include <android/binder_ibinder.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
class BpMosisListener : public ::ndk::BpCInterface<IMosisListener> {
|
||||
public:
|
||||
explicit BpMosisListener(const ::ndk::SpAIBinder& binder);
|
||||
virtual ~BpMosisListener();
|
||||
|
||||
::ndk::ScopedAStatus onServiceInitialized(bool in_success) override;
|
||||
::ndk::ScopedAStatus onBufferAvailable(const ::aidl::android::hardware::HardwareBuffer& in_buffer) override;
|
||||
::ndk::ScopedAStatus onFrameAvailable() override;
|
||||
};
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisService.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "aidl/com/omixlab/mosis/IMosisService.h"
|
||||
|
||||
#include <android/binder_ibinder.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
class BpMosisService : public ::ndk::BpCInterface<IMosisService> {
|
||||
public:
|
||||
explicit BpMosisService(const ::ndk::SpAIBinder& binder);
|
||||
virtual ~BpMosisService();
|
||||
|
||||
::ndk::ScopedAStatus initOS(const std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener>& in_listener, bool* _aidl_return) override;
|
||||
::ndk::ScopedAStatus onTouchDown(float in_x, float in_y) override;
|
||||
::ndk::ScopedAStatus onTouchMove(float in_x, float in_y) override;
|
||||
::ndk::ScopedAStatus onTouchUp(float in_x, float in_y) override;
|
||||
};
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisListener.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <android/binder_interface_utils.h>
|
||||
#include <android/hardware_buffer_aidl.h>
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
#include <android/binder_stability.h>
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
class IMosisListenerDelegator;
|
||||
|
||||
class IMosisListener : public ::ndk::ICInterface {
|
||||
public:
|
||||
typedef IMosisListenerDelegator DefaultDelegator;
|
||||
static const char* descriptor;
|
||||
IMosisListener();
|
||||
virtual ~IMosisListener();
|
||||
|
||||
static constexpr uint32_t TRANSACTION_onServiceInitialized = FIRST_CALL_TRANSACTION + 0;
|
||||
static constexpr uint32_t TRANSACTION_onBufferAvailable = FIRST_CALL_TRANSACTION + 1;
|
||||
static constexpr uint32_t TRANSACTION_onFrameAvailable = FIRST_CALL_TRANSACTION + 2;
|
||||
|
||||
static std::shared_ptr<IMosisListener> fromBinder(const ::ndk::SpAIBinder& binder);
|
||||
static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMosisListener>& instance);
|
||||
static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMosisListener>* instance);
|
||||
static bool setDefaultImpl(const std::shared_ptr<IMosisListener>& impl);
|
||||
static const std::shared_ptr<IMosisListener>& getDefaultImpl();
|
||||
virtual ::ndk::ScopedAStatus onServiceInitialized(bool in_success) = 0;
|
||||
virtual ::ndk::ScopedAStatus onBufferAvailable(const ::aidl::android::hardware::HardwareBuffer& in_buffer) = 0;
|
||||
virtual ::ndk::ScopedAStatus onFrameAvailable() = 0;
|
||||
private:
|
||||
static std::shared_ptr<IMosisListener> default_impl;
|
||||
};
|
||||
class IMosisListenerDefault : public IMosisListener {
|
||||
public:
|
||||
::ndk::ScopedAStatus onServiceInitialized(bool in_success) override;
|
||||
::ndk::ScopedAStatus onBufferAvailable(const ::aidl::android::hardware::HardwareBuffer& in_buffer) override;
|
||||
::ndk::ScopedAStatus onFrameAvailable() override;
|
||||
::ndk::SpAIBinder asBinder() override;
|
||||
bool isRemote() override;
|
||||
};
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisService.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <android/binder_interface_utils.h>
|
||||
#include <aidl/com/omixlab/mosis/IMosisListener.h>
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
#include <android/binder_stability.h>
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
|
||||
namespace aidl::com::omixlab::mosis {
|
||||
class IMosisListener;
|
||||
} // namespace aidl::com::omixlab::mosis
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
class IMosisServiceDelegator;
|
||||
|
||||
class IMosisService : public ::ndk::ICInterface {
|
||||
public:
|
||||
typedef IMosisServiceDelegator DefaultDelegator;
|
||||
static const char* descriptor;
|
||||
IMosisService();
|
||||
virtual ~IMosisService();
|
||||
|
||||
static constexpr uint32_t TRANSACTION_initOS = FIRST_CALL_TRANSACTION + 0;
|
||||
static constexpr uint32_t TRANSACTION_onTouchDown = FIRST_CALL_TRANSACTION + 1;
|
||||
static constexpr uint32_t TRANSACTION_onTouchMove = FIRST_CALL_TRANSACTION + 2;
|
||||
static constexpr uint32_t TRANSACTION_onTouchUp = FIRST_CALL_TRANSACTION + 3;
|
||||
|
||||
static std::shared_ptr<IMosisService> fromBinder(const ::ndk::SpAIBinder& binder);
|
||||
static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMosisService>& instance);
|
||||
static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMosisService>* instance);
|
||||
static bool setDefaultImpl(const std::shared_ptr<IMosisService>& impl);
|
||||
static const std::shared_ptr<IMosisService>& getDefaultImpl();
|
||||
virtual ::ndk::ScopedAStatus initOS(const std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener>& in_listener, bool* _aidl_return) = 0;
|
||||
virtual ::ndk::ScopedAStatus onTouchDown(float in_x, float in_y) = 0;
|
||||
virtual ::ndk::ScopedAStatus onTouchMove(float in_x, float in_y) = 0;
|
||||
virtual ::ndk::ScopedAStatus onTouchUp(float in_x, float in_y) = 0;
|
||||
private:
|
||||
static std::shared_ptr<IMosisService> default_impl;
|
||||
};
|
||||
class IMosisServiceDefault : public IMosisService {
|
||||
public:
|
||||
::ndk::ScopedAStatus initOS(const std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener>& in_listener, bool* _aidl_return) override;
|
||||
::ndk::ScopedAStatus onTouchDown(float in_x, float in_y) override;
|
||||
::ndk::ScopedAStatus onTouchMove(float in_x, float in_y) override;
|
||||
::ndk::ScopedAStatus onTouchUp(float in_x, float in_y) override;
|
||||
::ndk::SpAIBinder asBinder() override;
|
||||
bool isRemote() override;
|
||||
};
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisListener.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#include "aidl/com/omixlab/mosis/IMosisListener.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <android/binder_parcel.h>
|
||||
#include <android/binder_parcel_utils.h>
|
||||
#include <android/binder_status.h>
|
||||
#include <aidl/com/omixlab/mosis/BnMosisListener.h>
|
||||
#include <aidl/com/omixlab/mosis/BpMosisListener.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
static binder_status_t _aidl_com_omixlab_mosis_IMosisListener_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
|
||||
(void)_aidl_in;
|
||||
(void)_aidl_out;
|
||||
binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
|
||||
std::shared_ptr<BnMosisListener> _aidl_impl = std::static_pointer_cast<BnMosisListener>(::ndk::ICInterface::asInterface(_aidl_binder));
|
||||
switch (_aidl_code) {
|
||||
case (FIRST_CALL_TRANSACTION + 0 /*onServiceInitialized*/): {
|
||||
bool in_success;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_success);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->onServiceInitialized(in_success);
|
||||
_aidl_ret_status = STATUS_OK;
|
||||
break;
|
||||
}
|
||||
case (FIRST_CALL_TRANSACTION + 1 /*onBufferAvailable*/): {
|
||||
::aidl::android::hardware::HardwareBuffer in_buffer;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_buffer);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->onBufferAvailable(in_buffer);
|
||||
_aidl_ret_status = STATUS_OK;
|
||||
break;
|
||||
}
|
||||
case (FIRST_CALL_TRANSACTION + 2 /*onFrameAvailable*/): {
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->onFrameAvailable();
|
||||
_aidl_ret_status = STATUS_OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return _aidl_ret_status;
|
||||
}
|
||||
|
||||
static AIBinder_Class* _g_aidl_com_omixlab_mosis_IMosisListener_clazz = ::ndk::ICInterface::defineClass(IMosisListener::descriptor, _aidl_com_omixlab_mosis_IMosisListener_onTransact, nullptr, 0);
|
||||
|
||||
BpMosisListener::BpMosisListener(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
|
||||
BpMosisListener::~BpMosisListener() {}
|
||||
|
||||
::ndk::ScopedAStatus BpMosisListener::onServiceInitialized(bool in_success) {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_success);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 0 /*onServiceInitialized*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
FLAG_ONEWAY
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisListener::getDefaultImpl()) {
|
||||
_aidl_status = IMosisListener::getDefaultImpl()->onServiceInitialized(in_success);
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus BpMosisListener::onBufferAvailable(const ::aidl::android::hardware::HardwareBuffer& in_buffer) {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_buffer);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 1 /*onBufferAvailable*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
FLAG_ONEWAY
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisListener::getDefaultImpl()) {
|
||||
_aidl_status = IMosisListener::getDefaultImpl()->onBufferAvailable(in_buffer);
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus BpMosisListener::onFrameAvailable() {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 2 /*onFrameAvailable*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
FLAG_ONEWAY
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisListener::getDefaultImpl()) {
|
||||
_aidl_status = IMosisListener::getDefaultImpl()->onFrameAvailable();
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
// Source for BnMosisListener
|
||||
BnMosisListener::BnMosisListener() {}
|
||||
BnMosisListener::~BnMosisListener() {}
|
||||
::ndk::SpAIBinder BnMosisListener::createBinder() {
|
||||
AIBinder* binder = AIBinder_new(_g_aidl_com_omixlab_mosis_IMosisListener_clazz, static_cast<void*>(this));
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
AIBinder_markCompilationUnitStability(binder);
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
return ::ndk::SpAIBinder(binder);
|
||||
}
|
||||
// Source for IMosisListener
|
||||
const char* IMosisListener::descriptor = "com.omixlab.mosis.IMosisListener";
|
||||
IMosisListener::IMosisListener() {}
|
||||
IMosisListener::~IMosisListener() {}
|
||||
|
||||
|
||||
std::shared_ptr<IMosisListener> IMosisListener::fromBinder(const ::ndk::SpAIBinder& binder) {
|
||||
if (!AIBinder_associateClass(binder.get(), _g_aidl_com_omixlab_mosis_IMosisListener_clazz)) {
|
||||
#if __ANDROID_API__ >= 31
|
||||
const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
|
||||
if (originalClass == nullptr) return nullptr;
|
||||
if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
|
||||
return ::ndk::SharedRefBase::make<BpMosisListener>(binder);
|
||||
}
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
|
||||
if (interface) {
|
||||
return std::static_pointer_cast<IMosisListener>(interface);
|
||||
}
|
||||
return ::ndk::SharedRefBase::make<BpMosisListener>(binder);
|
||||
}
|
||||
|
||||
binder_status_t IMosisListener::writeToParcel(AParcel* parcel, const std::shared_ptr<IMosisListener>& instance) {
|
||||
return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
|
||||
}
|
||||
binder_status_t IMosisListener::readFromParcel(const AParcel* parcel, std::shared_ptr<IMosisListener>* instance) {
|
||||
::ndk::SpAIBinder binder;
|
||||
binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
|
||||
if (status != STATUS_OK) return status;
|
||||
*instance = IMosisListener::fromBinder(binder);
|
||||
return STATUS_OK;
|
||||
}
|
||||
bool IMosisListener::setDefaultImpl(const std::shared_ptr<IMosisListener>& impl) {
|
||||
// Only one user of this interface can use this function
|
||||
// at a time. This is a heuristic to detect if two different
|
||||
// users in the same process use this function.
|
||||
assert(!IMosisListener::default_impl);
|
||||
if (impl) {
|
||||
IMosisListener::default_impl = impl;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const std::shared_ptr<IMosisListener>& IMosisListener::getDefaultImpl() {
|
||||
return IMosisListener::default_impl;
|
||||
}
|
||||
std::shared_ptr<IMosisListener> IMosisListener::default_impl = nullptr;
|
||||
::ndk::ScopedAStatus IMosisListenerDefault::onServiceInitialized(bool /*in_success*/) {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus IMosisListenerDefault::onBufferAvailable(const ::aidl::android::hardware::HardwareBuffer& /*in_buffer*/) {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus IMosisListenerDefault::onFrameAvailable() {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::SpAIBinder IMosisListenerDefault::asBinder() {
|
||||
return ::ndk::SpAIBinder();
|
||||
}
|
||||
bool IMosisListenerDefault::isRemote() {
|
||||
return false;
|
||||
}
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,360 @@
|
||||
/*
|
||||
* This file is auto-generated. DO NOT MODIFY.
|
||||
* Using: C:\\Users\\omara\\AppData\\Local\\Android\\Sdk\\build-tools/36.1.0/aidl.exe --lang=ndk --min_sdk_version=36 -I D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL -o D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated -h D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\Generated D:\\Dev\\Mosis\\MosisUnreal\\Plugins\\MosisSDK\\Source\\MosisSDK\\AIDL\\com/omixlab/mosis\\IMosisService.aidl
|
||||
*
|
||||
* DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
|
||||
* ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
|
||||
* AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
|
||||
*/
|
||||
#include "aidl/com/omixlab/mosis/IMosisService.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <android/binder_parcel.h>
|
||||
#include <android/binder_parcel_utils.h>
|
||||
#include <android/binder_status.h>
|
||||
#include <aidl/com/omixlab/mosis/BnMosisListener.h>
|
||||
#include <aidl/com/omixlab/mosis/BnMosisService.h>
|
||||
#include <aidl/com/omixlab/mosis/BpMosisListener.h>
|
||||
#include <aidl/com/omixlab/mosis/BpMosisService.h>
|
||||
#include <aidl/com/omixlab/mosis/IMosisListener.h>
|
||||
|
||||
namespace aidl {
|
||||
namespace com {
|
||||
namespace omixlab {
|
||||
namespace mosis {
|
||||
static binder_status_t _aidl_com_omixlab_mosis_IMosisService_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
|
||||
(void)_aidl_in;
|
||||
(void)_aidl_out;
|
||||
binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
|
||||
std::shared_ptr<BnMosisService> _aidl_impl = std::static_pointer_cast<BnMosisService>(::ndk::ICInterface::asInterface(_aidl_binder));
|
||||
switch (_aidl_code) {
|
||||
case (FIRST_CALL_TRANSACTION + 0 /*initOS*/): {
|
||||
std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener> in_listener;
|
||||
bool _aidl_return;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_listener);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->initOS(in_listener, &_aidl_return);
|
||||
_aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) break;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
break;
|
||||
}
|
||||
case (FIRST_CALL_TRANSACTION + 1 /*onTouchDown*/): {
|
||||
float in_x;
|
||||
float in_y;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_x);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_y);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->onTouchDown(in_x, in_y);
|
||||
_aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) break;
|
||||
|
||||
break;
|
||||
}
|
||||
case (FIRST_CALL_TRANSACTION + 2 /*onTouchMove*/): {
|
||||
float in_x;
|
||||
float in_y;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_x);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_y);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->onTouchMove(in_x, in_y);
|
||||
_aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) break;
|
||||
|
||||
break;
|
||||
}
|
||||
case (FIRST_CALL_TRANSACTION + 3 /*onTouchUp*/): {
|
||||
float in_x;
|
||||
float in_y;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_x);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_y);
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
::ndk::ScopedAStatus _aidl_status = _aidl_impl->onTouchUp(in_x, in_y);
|
||||
_aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
|
||||
if (_aidl_ret_status != STATUS_OK) break;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) break;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
return _aidl_ret_status;
|
||||
}
|
||||
|
||||
static AIBinder_Class* _g_aidl_com_omixlab_mosis_IMosisService_clazz = ::ndk::ICInterface::defineClass(IMosisService::descriptor, _aidl_com_omixlab_mosis_IMosisService_onTransact, nullptr, 0);
|
||||
|
||||
BpMosisService::BpMosisService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
|
||||
BpMosisService::~BpMosisService() {}
|
||||
|
||||
::ndk::ScopedAStatus BpMosisService::initOS(const std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener>& in_listener, bool* _aidl_return) {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_listener);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 0 /*initOS*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
0
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisService::getDefaultImpl()) {
|
||||
_aidl_status = IMosisService::getDefaultImpl()->initOS(in_listener, _aidl_return);
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
|
||||
_aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus BpMosisService::onTouchDown(float in_x, float in_y) {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_x);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_y);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 1 /*onTouchDown*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
0
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisService::getDefaultImpl()) {
|
||||
_aidl_status = IMosisService::getDefaultImpl()->onTouchDown(in_x, in_y);
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus BpMosisService::onTouchMove(float in_x, float in_y) {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_x);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_y);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 2 /*onTouchMove*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
0
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisService::getDefaultImpl()) {
|
||||
_aidl_status = IMosisService::getDefaultImpl()->onTouchMove(in_x, in_y);
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus BpMosisService::onTouchUp(float in_x, float in_y) {
|
||||
binder_status_t _aidl_ret_status = STATUS_OK;
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
::ndk::ScopedAParcel _aidl_in;
|
||||
::ndk::ScopedAParcel _aidl_out;
|
||||
|
||||
_aidl_ret_status = AIBinder_prepareTransaction(asBinderReference().get(), _aidl_in.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_x);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_y);
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AIBinder_transact(
|
||||
asBinderReference().get(),
|
||||
(FIRST_CALL_TRANSACTION + 3 /*onTouchUp*/),
|
||||
_aidl_in.getR(),
|
||||
_aidl_out.getR(),
|
||||
0
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
| static_cast<int>(FLAG_PRIVATE_LOCAL)
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
);
|
||||
if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMosisService::getDefaultImpl()) {
|
||||
_aidl_status = IMosisService::getDefaultImpl()->onTouchUp(in_x, in_y);
|
||||
goto _aidl_status_return;
|
||||
}
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
_aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
|
||||
if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
|
||||
|
||||
if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
|
||||
_aidl_error:
|
||||
_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
|
||||
_aidl_status_return:
|
||||
return _aidl_status;
|
||||
}
|
||||
// Source for BnMosisService
|
||||
BnMosisService::BnMosisService() {}
|
||||
BnMosisService::~BnMosisService() {}
|
||||
::ndk::SpAIBinder BnMosisService::createBinder() {
|
||||
AIBinder* binder = AIBinder_new(_g_aidl_com_omixlab_mosis_IMosisService_clazz, static_cast<void*>(this));
|
||||
#ifdef BINDER_STABILITY_SUPPORT
|
||||
AIBinder_markCompilationUnitStability(binder);
|
||||
#endif // BINDER_STABILITY_SUPPORT
|
||||
return ::ndk::SpAIBinder(binder);
|
||||
}
|
||||
// Source for IMosisService
|
||||
const char* IMosisService::descriptor = "com.omixlab.mosis.IMosisService";
|
||||
IMosisService::IMosisService() {}
|
||||
IMosisService::~IMosisService() {}
|
||||
|
||||
|
||||
std::shared_ptr<IMosisService> IMosisService::fromBinder(const ::ndk::SpAIBinder& binder) {
|
||||
if (!AIBinder_associateClass(binder.get(), _g_aidl_com_omixlab_mosis_IMosisService_clazz)) {
|
||||
#if __ANDROID_API__ >= 31
|
||||
const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
|
||||
if (originalClass == nullptr) return nullptr;
|
||||
if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
|
||||
return ::ndk::SharedRefBase::make<BpMosisService>(binder);
|
||||
}
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
|
||||
if (interface) {
|
||||
return std::static_pointer_cast<IMosisService>(interface);
|
||||
}
|
||||
return ::ndk::SharedRefBase::make<BpMosisService>(binder);
|
||||
}
|
||||
|
||||
binder_status_t IMosisService::writeToParcel(AParcel* parcel, const std::shared_ptr<IMosisService>& instance) {
|
||||
return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
|
||||
}
|
||||
binder_status_t IMosisService::readFromParcel(const AParcel* parcel, std::shared_ptr<IMosisService>* instance) {
|
||||
::ndk::SpAIBinder binder;
|
||||
binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
|
||||
if (status != STATUS_OK) return status;
|
||||
*instance = IMosisService::fromBinder(binder);
|
||||
return STATUS_OK;
|
||||
}
|
||||
bool IMosisService::setDefaultImpl(const std::shared_ptr<IMosisService>& impl) {
|
||||
// Only one user of this interface can use this function
|
||||
// at a time. This is a heuristic to detect if two different
|
||||
// users in the same process use this function.
|
||||
assert(!IMosisService::default_impl);
|
||||
if (impl) {
|
||||
IMosisService::default_impl = impl;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const std::shared_ptr<IMosisService>& IMosisService::getDefaultImpl() {
|
||||
return IMosisService::default_impl;
|
||||
}
|
||||
std::shared_ptr<IMosisService> IMosisService::default_impl = nullptr;
|
||||
::ndk::ScopedAStatus IMosisServiceDefault::initOS(const std::shared_ptr<::aidl::com::omixlab::mosis::IMosisListener>& /*in_listener*/, bool* /*_aidl_return*/) {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus IMosisServiceDefault::onTouchDown(float /*in_x*/, float /*in_y*/) {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus IMosisServiceDefault::onTouchMove(float /*in_x*/, float /*in_y*/) {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::ScopedAStatus IMosisServiceDefault::onTouchUp(float /*in_x*/, float /*in_y*/) {
|
||||
::ndk::ScopedAStatus _aidl_status;
|
||||
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
|
||||
return _aidl_status;
|
||||
}
|
||||
::ndk::SpAIBinder IMosisServiceDefault::asBinder() {
|
||||
return ::ndk::SpAIBinder();
|
||||
}
|
||||
bool IMosisServiceDefault::isRemote() {
|
||||
return false;
|
||||
}
|
||||
} // namespace mosis
|
||||
} // namespace omixlab
|
||||
} // namespace com
|
||||
} // namespace aidl
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.omixlab.mosis
|
||||
|
||||
import android.util.Log
|
||||
import android.content.ComponentName
|
||||
import android.content.Context.BIND_AUTO_CREATE
|
||||
import android.content.Intent
|
||||
import android.content.ServiceConnection
|
||||
import android.os.IBinder
|
||||
import androidx.core.content.ContextCompat.startForegroundService
|
||||
import com.omixlab.mosis.IMosisService
|
||||
import com.epicgames.unreal.GameActivity
|
||||
|
||||
class MyKotlinPlugin {
|
||||
companion object {
|
||||
val instance: MyKotlinPlugin by lazy { MyKotlinPlugin() }
|
||||
@JvmStatic
|
||||
fun StartMosisService() {
|
||||
instance.startRemoteService()
|
||||
}
|
||||
}
|
||||
var remote_service: IMosisService? = null
|
||||
val connection = object : ServiceConnection {
|
||||
override fun onServiceConnected(className: ComponentName, service: IBinder) {
|
||||
Log.d("MosisTest", "Service Connected")
|
||||
remote_service = IMosisService.Stub.asInterface(service)
|
||||
serviceConnected(service)
|
||||
}
|
||||
override fun onServiceDisconnected(arg0: ComponentName) {
|
||||
Log.d("MosisTest", "Service Disconnected")
|
||||
}
|
||||
}
|
||||
fun startRemoteService() {
|
||||
val intent = Intent("com.omixlab.mosis.SERVICE")
|
||||
intent.setPackage("com.omixlab.mosis")
|
||||
val currentActivity = GameActivity.Get()
|
||||
try {
|
||||
startForegroundService(currentActivity, intent)
|
||||
val result = currentActivity.bindService(intent, connection, BIND_AUTO_CREATE)
|
||||
Log.d("MosisTest", "Bind result: $result")
|
||||
} catch (e: Exception) {
|
||||
Log.e("MosisTest", "Bind failed", e)
|
||||
}
|
||||
}
|
||||
external fun serviceConnected(binder: IBinder)
|
||||
}
|
||||
70
Plugins/MosisSDK/Source/MosisSDK/MosisSDK.Build.cs
Normal file
70
Plugins/MosisSDK/Source/MosisSDK/MosisSDK.Build.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class MosisSDK : ModuleRules
|
||||
{
|
||||
public MosisSDK(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"Launch"
|
||||
// ... add private dependencies that you statically link with here ...
|
||||
}
|
||||
);
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Android)
|
||||
{
|
||||
// Register the UPL file
|
||||
string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
|
||||
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "MosisSDK_UPL.xml"));
|
||||
PublicAdditionalLibraries.Add("binder_ndk");
|
||||
|
||||
string SDKPath = Environment.GetEnvironmentVariable("ANDROID_HOME");
|
||||
string BinderPath = Path.Combine(SDKPath, "platforms/android-36/optional/libbinder_ndk_cpp");
|
||||
PublicIncludePaths.Add(BinderPath);
|
||||
|
||||
string AidlPath = Path.Combine(SDKPath, "build-tools/36.1.0/aidl.exe");
|
||||
string AidlSourceDir = Path.Combine(ModuleDirectory, "AIDL");
|
||||
string OutputHeaderDir = Path.Combine(ModuleDirectory, "Generated");
|
||||
string OutputCppDir = OutputHeaderDir;
|
||||
|
||||
string[] Files = Directory.GetFiles(Path.Combine(AidlSourceDir, "com/omixlab/mosis"), "*.aidl", SearchOption.AllDirectories);
|
||||
|
||||
foreach (string FilePath in Files)
|
||||
{
|
||||
string Args = $"--lang=ndk --min_sdk_version=36 -I \"{AidlSourceDir}\" -o \"{OutputCppDir}\" -h \"{OutputHeaderDir}\" \"{FilePath}\"";
|
||||
ProcessStartInfo PSI = new ProcessStartInfo();
|
||||
PSI.FileName = AidlPath;
|
||||
PSI.Arguments = Args;
|
||||
PSI.RedirectStandardOutput = true;
|
||||
PSI.RedirectStandardError = true;
|
||||
PSI.UseShellExecute = false;
|
||||
PSI.CreateNoWindow = true;
|
||||
|
||||
Console.WriteLine($"Running AIDL : {Args}");
|
||||
|
||||
using (Process Proc = Process.Start(PSI))
|
||||
{
|
||||
Proc.WaitForExit();
|
||||
if (Proc.ExitCode != 0)
|
||||
{
|
||||
string Error = Proc.StandardError.ReadToEnd();
|
||||
Console.WriteLine($"AIDL Error: {Error}");
|
||||
throw new BuildException($"Failed to compile AIDL: {FilePath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Plugins/MosisSDK/Source/MosisSDK/MosisSDK_UPL.xml
Normal file
50
Plugins/MosisSDK/Source/MosisSDK/MosisSDK_UPL.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<androidManifestUpdates>
|
||||
<addElements tag="manifest">
|
||||
<queries>
|
||||
<package android:name="com.omixlab.mosis" />
|
||||
</queries>
|
||||
</addElements>
|
||||
</androidManifestUpdates>
|
||||
<proguardAdditions>
|
||||
<insert>
|
||||
-keep class com.omixlab.mosis.MyKotlinPlugin { *; }
|
||||
-keep interface com.omixlab.mosis.IMosisListener { *; }
|
||||
-keep interface com.omixlab.mosis.IMosisService { *; }
|
||||
</insert>
|
||||
</proguardAdditions>
|
||||
<buildscriptGradleAdditions>
|
||||
<insert>
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.0"
|
||||
}
|
||||
</insert>
|
||||
</buildscriptGradleAdditions>
|
||||
<buildGradleAdditions>
|
||||
<insert>
|
||||
apply plugin: 'kotlin-android'
|
||||
android {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
buildFeatures {
|
||||
aidl = true
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
kotlin.srcDirs += ['src/main/kotlin']
|
||||
java.srcDirs += ['src/main/aidl_gen']
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.3.0'
|
||||
}
|
||||
</insert>
|
||||
</buildGradleAdditions>
|
||||
<resourceCopies>
|
||||
<copyDir src="$S(PluginDir)/Java" dst="$S(BuildDir)/gradle/app/src/main/kotlin" />
|
||||
<copyDir src="$S(PluginDir)/../../../../../MosisService/build/generated/aidl_source_output_dir/debug/out" dst="$S(BuildDir)/gradle/app/src/main/aidl_gen" />
|
||||
</resourceCopies>
|
||||
</root>
|
||||
46
Plugins/MosisSDK/Source/MosisSDK/Private/MosisSDK.cpp
Normal file
46
Plugins/MosisSDK/Source/MosisSDK/Private/MosisSDK.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "MosisSDK.h"
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
|
||||
#include "Android/AndroidApplication.h"
|
||||
#include "Android/AndroidJNI.h"
|
||||
#include "Android/AndroidJava.h"
|
||||
#include <android/binder_ibinder_jni.h>
|
||||
|
||||
void FMosisSDKModule::StartupModule()
|
||||
{
|
||||
if (JNIEnv* Env = FAndroidApplication::GetJavaEnv())
|
||||
{
|
||||
jclass ManagerClass = FAndroidApplication::FindJavaClass("com/omixlab/mosis/MyKotlinPlugin");
|
||||
if (ManagerClass)
|
||||
{
|
||||
jmethodID BindMethod = Env->GetStaticMethodID(ManagerClass, "StartMosisService", "()V");
|
||||
Env->CallStaticVoidMethod(ManagerClass, BindMethod);
|
||||
UE_LOG(LogTemp, Log, TEXT("Requested Bind to Android Service..."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FMosisSDKModule::ShutdownModule()
|
||||
{
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_omixlab_mosis_MyKotlinPlugin_serviceConnected(JNIEnv* env, jobject thiz,
|
||||
jobject binder)
|
||||
{
|
||||
AIBinder* pBinder = AIBinder_fromJavaBinder(env, binder);
|
||||
//const ndk::SpAIBinder spBinder(pBinder);
|
||||
//g_service = IMosisService::fromBinder(spBinder);
|
||||
//Logger::Log("Service Connected");
|
||||
//g_context = ndk::SharedRefBase::make<ServiceContext>();
|
||||
//bool result{};
|
||||
//g_service->initOS(g_context, &result);
|
||||
//Logger::Log(std::format("InitOS returned {}", result));
|
||||
}
|
||||
|
||||
#endif
|
||||
IMPLEMENT_MODULE(FMosisSDKModule, MosisSDK)
|
||||
15
Plugins/MosisSDK/Source/MosisSDK/Public/MosisSDK.h
Normal file
15
Plugins/MosisSDK/Source/MosisSDK/Public/MosisSDK.h
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class FMosisSDKModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
};
|
||||
Reference in New Issue
Block a user