mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 12:05:32 -04:00
universal7885: parts-aidl: Just send callback through setSwapOn()
- Set callback on JNI, since Java class cant be sent through, use the ndk backend to implement callback and send to swapon()
This commit is contained in:
parent
72f2eb6800
commit
ef97fdeb77
18 changed files with 209 additions and 30 deletions
|
|
@ -0,0 +1,12 @@
|
|||
#include "SwapCallbackImpl.h"
|
||||
|
||||
#include <android/binder_manager.h>
|
||||
|
||||
#include <aidl/vendor/eureka/hardware/parts/BnSwapOnData.h>
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_Swap_setSwapOn
|
||||
(JNIEnv *env, jclass clazz, jboolean cb) {
|
||||
auto svc = ISwapOnData::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService("vendor.eureka.hardware.parts.ISwapOnData/default")));
|
||||
svc->setSwapOn(cb ? ndk::SharedRefBase::make<SwapCallbackImpl>(env, clazz) : nullptr);
|
||||
}
|
||||
Loading…
Reference in a new issue