mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-02-01 07:50:47 +00:00
Merge "VR hal to choose thermal config"
This commit is contained in:
committed by
Android (Google) Code Review
commit
9e55f530d9
@@ -394,7 +394,7 @@ service perfd /vendor/bin/perfd
|
||||
group root readproc
|
||||
socket perfd seqpacket 0666 root system
|
||||
|
||||
service thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine.conf
|
||||
service thermal-engine /vendor/bin/thermal-engine -c ${sys.qcom.thermalcfg:-/vendor/etc/thermal-engine.conf}
|
||||
class main
|
||||
user root
|
||||
group root system
|
||||
|
||||
2
sepolicy/hal_vr.te
Normal file
2
sepolicy/hal_vr.te
Normal file
@@ -0,0 +1,2 @@
|
||||
# interact with thermal_config
|
||||
set_prop(hal_vr, thermal_prop)
|
||||
@@ -8,3 +8,4 @@ type ssr_prop, property_type;
|
||||
type cnss_diag_prop, property_type;
|
||||
type tee_listener_prop, property_type;
|
||||
type wc_prop, property_type;
|
||||
type thermal_prop, property_type;
|
||||
|
||||
@@ -11,3 +11,5 @@ debug.ssrdump u:object_r:ssr_prop:s0
|
||||
persist.sys.cnss. u:object_r:cnss_diag_prop:s0
|
||||
sys.listeners.registered u:object_r:tee_listener_prop:s0
|
||||
wc_transport. u:object_r:wc_prop:s0
|
||||
sys.qcom.thermalcfg u:object_r:thermal_prop:s0
|
||||
ctl.thermal-engine u:object_r:thermal_prop:s0
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
#define LOG_TAG "VrDevice"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/properties.h>
|
||||
#include "VrDevice.h"
|
||||
|
||||
namespace android {
|
||||
@@ -31,8 +33,21 @@ Return<void> VrDevice::init() {
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> VrDevice::setVrMode(bool /* enabled */) {
|
||||
// TODO(b/36514493): start or stop using thermal engine VR profile.
|
||||
Return<void> VrDevice::setVrMode(bool enabled) {
|
||||
if (enabled) {
|
||||
if (!android::base::SetProperty("sys.qcom.thermalcfg", "/vendor/etc/thermal-engine-vr.conf")) {
|
||||
LOG(ERROR) << "Couldn't set thermal_engine enable property";
|
||||
return Void();
|
||||
}
|
||||
} else {
|
||||
if (!android::base::SetProperty("sys.qcom.thermalcfg", "/vendor/etc/thermal-engine.conf")) {
|
||||
LOG(ERROR) << "Couldn't set thermal_engine disable property";
|
||||
return Void();
|
||||
}
|
||||
}
|
||||
if (!android::base::SetProperty("ctl.restart", "thermal-engine")) {
|
||||
LOG(ERROR) << "Couldn't set thermal_engine restart property";
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user