mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
universal7885: parts: implement display controls
Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
7bd40b3a4e
commit
15f84d5a7b
17 changed files with 79 additions and 310 deletions
33
universal7885-common/apps/SamsungParts/jni/DisplayBridge.cpp
Normal file
33
universal7885-common/apps/SamsungParts/jni/DisplayBridge.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue