universal7885: parts: implement display controls

Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2022-04-12 16:45:48 +09:00
commit 15f84d5a7b
No known key found for this signature in database
GPG key ID: 50ABF73F0D19445D
17 changed files with 79 additions and 310 deletions

View file

@ -0,0 +1,33 @@
#include <hardware/hardware.h>
#include <hidl/HidlSupport.h>
#include <hidl/LegacySupport.h>
#include <hidl/Status.h>
#include <vendor/eureka/hardware/parts/1.0/IDisplayConfigs.h>
#include "jni.h"
using android::sp;
using vendor::eureka::hardware::parts::V1_0::Number;
using vendor::eureka::hardware::parts::V1_0::Display;
using vendor::eureka::hardware::parts::V1_0::IDisplayConfigs;
static android::sp<IDisplayConfigs> service = IDisplayConfigs::getService();
extern "C" JNIEXPORT void JNICALL
Java_com_eurekateam_samsungextras_interfaces_Display_setDT2W(JNIEnv* env, jclass clazz, jboolean enable) {
if (enable) {
service->writeDisplay(Number::ENABLE,
Display::DOUBLE_TAP);
} else {
service->writeDisplay(Number::DISABLE,
Display::DOUBLE_TAP);
}
}
extern "C" JNIEXPORT void JNICALL
Java_com_eurekateam_samsungextras_interfaces_Display_setGloveMode(JNIEnv* env, jclass clazz, jboolean enable) {
if (enable) {
service->writeDisplay(Number::ENABLE, Display::GLOVE_MODE);
} else {
service->writeDisplay(Number::DISABLE, Display::GLOVE_MODE);
}
}