mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 12:05:32 -04:00
universal7885: parts-jni: Adapt to hidl changes
This commit is contained in:
parent
1603054a6e
commit
53b5d14b3c
3 changed files with 28 additions and 29 deletions
|
|
@ -6,10 +6,9 @@
|
|||
#include <vendor/eureka/hardware/parts/1.0/IFlashBrightness.h>
|
||||
|
||||
using android::sp;
|
||||
using vendor::eureka::hardware::parts::V1_0::Device;
|
||||
|
||||
using vendor::eureka::hardware::parts::V1_0::IFlashBrightness;
|
||||
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||
using vendor::eureka::hardware::parts::V1_0::Value;
|
||||
using vendor::eureka::hardware::parts::V1_0::Status;
|
||||
|
||||
static android::sp<IFlashBrightness> service = IFlashBrightness::getService();
|
||||
|
||||
|
|
@ -17,16 +16,16 @@ extern "C" JNIEXPORT void JNICALL
|
|||
Java_com_eurekateam_samsungextras_interfaces_Flashlight_setEnabled(
|
||||
JNIEnv /*env*/, __unused jobject obj, jboolean enabled) {
|
||||
if (enabled) {
|
||||
service->setFlashlightEnable(Number::ENABLE);
|
||||
service->setFlashlightEnable(Status::ENABLE);
|
||||
} else {
|
||||
service->setFlashlightEnable(Number::DISABLE);
|
||||
service->setFlashlightEnable(Status::DISABLE);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_Flashlight_setFlash(
|
||||
JNIEnv /*env*/, __unused jobject obj, jint value) {
|
||||
service->setFlashlightWritable(static_cast<Value>(value));
|
||||
service->setFlashlightWritable(value);
|
||||
}
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_Flashlight_getFlash(JNIEnv /*env*/,
|
||||
|
|
@ -34,9 +33,9 @@ Java_com_eurekateam_samsungextras_interfaces_Flashlight_getFlash(JNIEnv /*env*/,
|
|||
jint isA10) {
|
||||
int ret;
|
||||
if (isA10 == 1) {
|
||||
ret = service->readFlashlightstats(Device::A10);
|
||||
ret = service->readFlashlightstats(false);
|
||||
} else {
|
||||
ret = service->readFlashlightstats(Device::NOTA10);
|
||||
ret = service->readFlashlightstats(true);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue