universal7885: SamsungParts: Inital HAL test

This commit is contained in:
roynatech2544 2021-10-25 16:58:45 +09:00
commit e04e91f54f
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
15 changed files with 318 additions and 150 deletions

View file

@ -0,0 +1,29 @@
#include <vendor/eureka/security/selinux/1.0/ISELinux.h>
#include <hidl/Status.h>
#include <hidl/LegacySupport.h>
#include <hardware/hardware.h>
#include <hidl/HidlSupport.h>
#include "jni.h"
using vendor::eureka::security::selinux::V1_0::ISELinux;
using vendor::eureka::security::selinux::V1_0::Enable;
using android::sp;
extern "C"
JNIEXPORT jint JNICALL
Java_com_eurekateam_samsungextras_interfaces_SELinux_getSELinux(JNIEnv *env, jclass clazz) {
android::sp<ISELinux> service = ISELinux::getService();
int ret = service->readSELinuxstats();
return ret;
}
extern "C"
JNIEXPORT void JNICALL
Java_com_eurekateam_samsungextras_interfaces_SELinux_setSELinux(JNIEnv *env, jclass clazz,
jint enable) {
android::sp<ISELinux> service = ISELinux::getService();
if (enable == 1){
service->setSELinuxWritable(Enable::ENABLE);
}else{
service->setSELinuxWritable(Enable::DISABLE);
}
}