mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 20:15:32 -04:00
universal7885: parts: Implement swap on /data ctrl
This commit is contained in:
parent
442aa11e81
commit
f5d3e25c02
20 changed files with 329 additions and 1 deletions
28
universal7885-common/apps/SamsungParts/jni/SwapBridge.cpp
Normal file
28
universal7885-common/apps/SamsungParts/jni/SwapBridge.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "jni.h"
|
||||
#include <hardware/hardware.h>
|
||||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <vendor/eureka/hardware/parts/1.0/ISwapOnData.h>
|
||||
|
||||
using android::sp;
|
||||
using vendor::eureka::hardware::parts::V1_0::ISwapOnData;
|
||||
|
||||
static sp<ISwapOnData> service = ISwapOnData::getService();
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_Swap_setSize(JNIEnv *env,
|
||||
jclass clazz,
|
||||
jint size) {
|
||||
service->setSwapSize(size);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_Swap_setSwapOn(
|
||||
JNIEnv *env, jclass clazz, jboolean enable) {
|
||||
if (enable){
|
||||
service->setSwapOn();
|
||||
} else {
|
||||
service->setSwapOff();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue