mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35: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"],
|
jni_libs: ["libsamsungparts_jni"],
|
||||||
static_libs: ["androidx.preference_preference"],
|
static_libs: ["androidx.preference_preference"],
|
||||||
defaults: ["SettingsLibDefaults"],
|
defaults: ["SettingsLibDefaults"],
|
||||||
|
required: ["vendor.eureka.hardware.parts@1.0-service"],
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,7 @@ cc_library_shared {
|
||||||
"libhidlbase",
|
"libhidlbase",
|
||||||
"liblog",
|
"liblog",
|
||||||
"libutils",
|
"libutils",
|
||||||
"vendor.eureka.hardware.battery@1.0",
|
"vendor.eureka.hardware.parts@1.0",
|
||||||
"vendor.eureka.hardware.flashlight@1.0",
|
|
||||||
"vendor.eureka.hardware.gpu@1.0",
|
|
||||||
"vendor.eureka.security.selinux@1.0",
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
#include <hidl/HidlSupport.h>
|
#include <hidl/HidlSupport.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
#include <hidl/Status.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"
|
#include "jni.h"
|
||||||
|
|
||||||
using android::sp;
|
using android::sp;
|
||||||
using vendor::eureka::hardware::battery::V1_0::IBattery;
|
using vendor::eureka::hardware::parts::V1_0::IBattery;
|
||||||
using vendor::eureka::hardware::battery::V1_0::Number;
|
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||||
using vendor::eureka::hardware::battery::V1_0::SysfsType;
|
using vendor::eureka::hardware::parts::V1_0::SysfsType;
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_eurekateam_samsungextras_interfaces_Battery_setChargeSysfs(JNIEnv* env,
|
Java_com_eurekateam_samsungextras_interfaces_Battery_setChargeSysfs(JNIEnv* env,
|
||||||
|
|
|
||||||
|
|
@ -2,49 +2,49 @@
|
||||||
#include <hidl/HidlSupport.h>
|
#include <hidl/HidlSupport.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
#include <hidl/Status.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"
|
#include "jni.h"
|
||||||
|
|
||||||
using android::sp;
|
using android::sp;
|
||||||
using vendor::eureka::hardware::flashlight::V1_0::Device;
|
using vendor::eureka::hardware::parts::V1_0::Device;
|
||||||
using vendor::eureka::hardware::flashlight::V1_0::Enable;
|
using vendor::eureka::hardware::parts::V1_0::Value;
|
||||||
using vendor::eureka::hardware::flashlight::V1_0::IFlashlight;
|
using vendor::eureka::hardware::parts::V1_0::IFlashLight;
|
||||||
using vendor::eureka::hardware::flashlight::V1_0::Number;
|
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL Java_com_eurekateam_samsungextras_interfaces_Flashlight_setFlash(
|
extern "C" JNIEXPORT void JNICALL Java_com_eurekateam_samsungextras_interfaces_Flashlight_setFlash(
|
||||||
JNIEnv* env, __unused jobject obj, jint value) {
|
JNIEnv* env, __unused jobject obj, jint value) {
|
||||||
android::sp<IFlashlight> service = IFlashlight::getService();
|
android::sp<IFlashlight> service = IFlashLight::getService();
|
||||||
service->setFlashlightEnable(Enable::ENABLE);
|
service->setFlashlightEnable(Number::ENABLE);
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 1:
|
case 1:
|
||||||
service->setFlashlightWritable(Number::ONEUI);
|
service->setFlashlightWritable(Value::ONEUI);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
service->setFlashlightWritable(Number::TWOUI);
|
service->setFlashlightWritable(Value::TWOUI);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
service->setFlashlightWritable(Number::THREEUI);
|
service->setFlashlightWritable(Value::THREEUI);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
service->setFlashlightWritable(Number::FOURUI);
|
service->setFlashlightWritable(Value::FOURUI);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
service->setFlashlightWritable(Number::FIVEUI);
|
service->setFlashlightWritable(Value::FIVEUI);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
service->setFlashlightWritable(Number::SIXUI);
|
service->setFlashlightWritable(Value::SIXUI);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
service->setFlashlightWritable(Number::SEVENUI);
|
service->setFlashlightWritable(Value::SEVENUI);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
service->setFlashlightWritable(Number::EIGHTUI);
|
service->setFlashlightWritable(Value::EIGHTUI);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
service->setFlashlightWritable(Number::NINEUI);
|
service->setFlashlightWritable(Value::NINEUI);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
service->setFlashlightWritable(Number::TENUI);
|
service->setFlashlightWritable(Value::TENUI);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
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(
|
extern "C" JNIEXPORT jint JNICALL Java_com_eurekateam_samsungextras_interfaces_Flashlight_getFlash(
|
||||||
JNIEnv* env, jobject clazz, jint isA10) {
|
JNIEnv* env, jobject clazz, jint isA10) {
|
||||||
android::sp<IFlashlight> service = IFlashlight::getService();
|
android::sp<IFlashlight> service = IFlashLight::getService();
|
||||||
int ret;
|
int ret;
|
||||||
if (isA10 == 1) {
|
if (isA10 == 1) {
|
||||||
ret = service->readFlashlightstats(Device::A10);
|
ret = service->readFlashlightstats(Device::A10);
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,20 @@
|
||||||
#include <hidl/HidlSupport.h>
|
#include <hidl/HidlSupport.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
#include <hidl/Status.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"
|
#include "jni.h"
|
||||||
|
|
||||||
using android::sp;
|
using android::sp;
|
||||||
using vendor::eureka::hardware::gpu::V1_0::Enable;
|
using vendor::eureka::hardware::parts::V1_0::Enable;
|
||||||
using vendor::eureka::hardware::gpu::V1_0::IGpu;
|
using vendor::eureka::hardware::parts::V1_0::IGpu;
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_eurekateam_samsungextras_interfaces_GPU_setGPU(JNIEnv* env, jclass clazz, jint enable) {
|
Java_com_eurekateam_samsungextras_interfaces_GPU_setGPU(JNIEnv* env, jclass clazz, jint enable) {
|
||||||
android::sp<IGpu> service = IGpu::getService();
|
android::sp<IGpu> service = IGpu::getService();
|
||||||
if (enable == 1) {
|
if (enable == 1) {
|
||||||
service->setGpuWritable(Enable::ENABLE);
|
service->setGpuWritable(Number::ENABLE);
|
||||||
} else {
|
} else {
|
||||||
service->setGpuWritable(Enable::DISABLE);
|
service->setGpuWritable(Number::DISABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
extern "C" JNIEXPORT jint JNICALL
|
extern "C" JNIEXPORT jint JNICALL
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
#include <hidl/HidlSupport.h>
|
#include <hidl/HidlSupport.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
#include <hidl/Status.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"
|
#include "jni.h"
|
||||||
|
|
||||||
using android::sp;
|
using android::sp;
|
||||||
using vendor::eureka::security::selinux::V1_0::Enable;
|
using vendor::eureka::hardware::parts::V1_0::Number;
|
||||||
using vendor::eureka::security::selinux::V1_0::ISELinux;
|
using vendor::eureka::hardware::parts::V1_0::ISELinux;
|
||||||
|
|
||||||
extern "C" JNIEXPORT jint JNICALL
|
extern "C" JNIEXPORT jint JNICALL
|
||||||
Java_com_eurekateam_samsungextras_interfaces_SELinux_getSELinux(JNIEnv* env, jclass clazz) {
|
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
|
# SamsungParts
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
SamsungParts \
|
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
|
|
||||||
|
|
||||||
# Extra Command-Line Tools
|
# Extra Command-Line Tools
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue