mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
universal7885: parts: jni: Adapt for interface unify
* Also, Mark parts HAL is required for SamsungParts
This commit is contained in:
parent
4be8e028a2
commit
4b0238fe98
7 changed files with 33 additions and 40 deletions
|
|
@ -9,4 +9,5 @@ android_app {
|
|||
jni_libs: ["libsamsungparts_jni"],
|
||||
static_libs: ["androidx.preference_preference"],
|
||||
defaults: ["SettingsLibDefaults"],
|
||||
required: ["vendor.eureka.hardware.parts@1.0-service"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,7 @@ cc_library_shared {
|
|||
"libhidlbase",
|
||||
"liblog",
|
||||
"libutils",
|
||||
"vendor.eureka.hardware.battery@1.0",
|
||||
"vendor.eureka.hardware.flashlight@1.0",
|
||||
"vendor.eureka.hardware.gpu@1.0",
|
||||
"vendor.eureka.security.selinux@1.0",
|
||||
"vendor.eureka.hardware.parts@1.0",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <vendor/eureka/hardware/battery/1.0/IBattery.h>
|
||||
#include <vendor/eureka/hardware/parts/1.0/IBattery.h>
|
||||
#include "jni.h"
|
||||
|
||||
using android::sp;
|
||||
using vendor::eureka::hardware::battery::V1_0::IBattery;
|
||||
using vendor::eureka::hardware::battery::V1_0::Number;
|
||||
using vendor::eureka::hardware::battery::V1_0::SysfsType;
|
||||
using vendor::eureka::hardware::parts::V1_0::IBattery;
|
||||
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||
using vendor::eureka::hardware::parts::V1_0::SysfsType;
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_Battery_setChargeSysfs(JNIEnv* env,
|
||||
|
|
|
|||
|
|
@ -2,49 +2,49 @@
|
|||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <vendor/eureka/hardware/flashlight/1.0/IFlashlight.h>
|
||||
#include <vendor/eureka/hardware/parts/1.0/IFlashlight.h>
|
||||
#include "jni.h"
|
||||
|
||||
using android::sp;
|
||||
using vendor::eureka::hardware::flashlight::V1_0::Device;
|
||||
using vendor::eureka::hardware::flashlight::V1_0::Enable;
|
||||
using vendor::eureka::hardware::flashlight::V1_0::IFlashlight;
|
||||
using vendor::eureka::hardware::flashlight::V1_0::Number;
|
||||
using vendor::eureka::hardware::parts::V1_0::Device;
|
||||
using vendor::eureka::hardware::parts::V1_0::Value;
|
||||
using vendor::eureka::hardware::parts::V1_0::IFlashLight;
|
||||
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL Java_com_eurekateam_samsungextras_interfaces_Flashlight_setFlash(
|
||||
JNIEnv* env, __unused jobject obj, jint value) {
|
||||
android::sp<IFlashlight> service = IFlashlight::getService();
|
||||
service->setFlashlightEnable(Enable::ENABLE);
|
||||
android::sp<IFlashlight> service = IFlashLight::getService();
|
||||
service->setFlashlightEnable(Number::ENABLE);
|
||||
switch (value) {
|
||||
case 1:
|
||||
service->setFlashlightWritable(Number::ONEUI);
|
||||
service->setFlashlightWritable(Value::ONEUI);
|
||||
break;
|
||||
case 2:
|
||||
service->setFlashlightWritable(Number::TWOUI);
|
||||
service->setFlashlightWritable(Value::TWOUI);
|
||||
break;
|
||||
case 3:
|
||||
service->setFlashlightWritable(Number::THREEUI);
|
||||
service->setFlashlightWritable(Value::THREEUI);
|
||||
break;
|
||||
case 4:
|
||||
service->setFlashlightWritable(Number::FOURUI);
|
||||
service->setFlashlightWritable(Value::FOURUI);
|
||||
break;
|
||||
case 5:
|
||||
service->setFlashlightWritable(Number::FIVEUI);
|
||||
service->setFlashlightWritable(Value::FIVEUI);
|
||||
break;
|
||||
case 6:
|
||||
service->setFlashlightWritable(Number::SIXUI);
|
||||
service->setFlashlightWritable(Value::SIXUI);
|
||||
break;
|
||||
case 7:
|
||||
service->setFlashlightWritable(Number::SEVENUI);
|
||||
service->setFlashlightWritable(Value::SEVENUI);
|
||||
break;
|
||||
case 8:
|
||||
service->setFlashlightWritable(Number::EIGHTUI);
|
||||
service->setFlashlightWritable(Value::EIGHTUI);
|
||||
break;
|
||||
case 9:
|
||||
service->setFlashlightWritable(Number::NINEUI);
|
||||
service->setFlashlightWritable(Value::NINEUI);
|
||||
break;
|
||||
case 10:
|
||||
service->setFlashlightWritable(Number::TENUI);
|
||||
service->setFlashlightWritable(Value::TENUI);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -52,7 +52,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_eurekateam_samsungextras_interfaces_F
|
|||
}
|
||||
extern "C" JNIEXPORT jint JNICALL Java_com_eurekateam_samsungextras_interfaces_Flashlight_getFlash(
|
||||
JNIEnv* env, jobject clazz, jint isA10) {
|
||||
android::sp<IFlashlight> service = IFlashlight::getService();
|
||||
android::sp<IFlashlight> service = IFlashLight::getService();
|
||||
int ret;
|
||||
if (isA10 == 1) {
|
||||
ret = service->readFlashlightstats(Device::A10);
|
||||
|
|
|
|||
|
|
@ -2,20 +2,20 @@
|
|||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <vendor/eureka/hardware/gpu/1.0/IGpu.h>
|
||||
#include <vendor/eureka/hardware/parts/1.0/IGpu.h>
|
||||
#include "jni.h"
|
||||
|
||||
using android::sp;
|
||||
using vendor::eureka::hardware::gpu::V1_0::Enable;
|
||||
using vendor::eureka::hardware::gpu::V1_0::IGpu;
|
||||
using vendor::eureka::hardware::parts::V1_0::Enable;
|
||||
using vendor::eureka::hardware::parts::V1_0::IGpu;
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_GPU_setGPU(JNIEnv* env, jclass clazz, jint enable) {
|
||||
android::sp<IGpu> service = IGpu::getService();
|
||||
if (enable == 1) {
|
||||
service->setGpuWritable(Enable::ENABLE);
|
||||
service->setGpuWritable(Number::ENABLE);
|
||||
} else {
|
||||
service->setGpuWritable(Enable::DISABLE);
|
||||
service->setGpuWritable(Number::DISABLE);
|
||||
}
|
||||
}
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
#include <hidl/HidlSupport.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <vendor/eureka/security/selinux/1.0/ISELinux.h>
|
||||
#include <vendor/eureka/hardware/parts/1.0/ISELinux.h>
|
||||
#include "jni.h"
|
||||
|
||||
using android::sp;
|
||||
using vendor::eureka::security::selinux::V1_0::Enable;
|
||||
using vendor::eureka::security::selinux::V1_0::ISELinux;
|
||||
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||
using vendor::eureka::hardware::parts::V1_0::ISELinux;
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_com_eurekateam_samsungextras_interfaces_SELinux_getSELinux(JNIEnv* env, jclass clazz) {
|
||||
|
|
|
|||
|
|
@ -322,12 +322,7 @@ PRODUCT_CFI_INCLUDE_PATHS += hardware/samsung_slsi/scsc_wifibt/wpa_supplicant_li
|
|||
|
||||
# SamsungParts
|
||||
PRODUCT_PACKAGES += \
|
||||
SamsungParts \
|
||||
init.samsungparts.rc \
|
||||
vendor.eureka.hardware.battery@1.0-service \
|
||||
vendor.eureka.hardware.flashlight@1.0-service \
|
||||
vendor.eureka.hardware.gpu@1.0-service \
|
||||
vendor.eureka.security.selinux@1.0-service
|
||||
SamsungParts
|
||||
|
||||
# Extra Command-Line Tools
|
||||
PRODUCT_PACKAGES += \
|
||||
|
|
|
|||
Loading…
Reference in a new issue