android_device_samsung_a20/universal7885-common/apps/SamsungParts/jni/GPUBridge.cpp
roynatech2544 0885f01f81
universal7885: interfaces: Forgot to rename package name
* Also, fix errors

Change-Id: Iafa0a6f6c34c9b13aff464765ef00cffbc6330dd
Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
2022-03-22 19:05:26 +09:00

26 lines
866 B
C++

#include <hardware/hardware.h>
#include <hidl/HidlSupport.h>
#include <hidl/LegacySupport.h>
#include <hidl/Status.h>
#include <vendor/eureka/hardware/parts/1.0/IGpu.h>
#include "jni.h"
using android::sp;
using vendor::eureka::hardware::parts::V1_0::Number;
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(Number::ENABLE);
} else {
service->setGpuWritable(Number::DISABLE);
}
}
extern "C" JNIEXPORT jint JNICALL
Java_com_eurekateam_samsungextras_interfaces_GPU_getGPU(JNIEnv* env, jclass clazz) {
android::sp<IGpu> service = IGpu::getService();
int ret = service->readGpustats();
return ret;
}