mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-02-01 07:50:47 +00:00
wahoo: toggle special touch mode when VR mode is active
Bug: 37515573 Change-Id: I5b741323f97f7d4713636a1688f50c9459d2764f
This commit is contained in:
@@ -153,6 +153,8 @@ static void DumpTouch(int fd) {
|
||||
if (!access("/sys/class/input/ftm4_touch", R_OK)) {
|
||||
DumpFileToFd(fd, "STM touch firmware config",
|
||||
"/sys/class/input/ftm4_touch/version");
|
||||
DumpFileToFd(fd, "STM touch VR Mode",
|
||||
"/sys/class/input/ftm4_touch/vrmode");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -484,6 +484,9 @@ on boot
|
||||
# Make the ftm4 command node writeable from dumpstate
|
||||
chown system system /sys/devices/virtual/input/ftm4_touch/cmd
|
||||
|
||||
# ftm4 VR mode
|
||||
chown system system /sys/devices/virtual/input/ftm4_touch/vrmode
|
||||
|
||||
service init-elabel-sh /system/bin/init.elabel.sh
|
||||
class late_start
|
||||
user system
|
||||
|
||||
4
sepolicy/vendor/hal_vr.te
vendored
4
sepolicy/vendor/hal_vr.te
vendored
@@ -1,2 +1,6 @@
|
||||
# interact with thermal_config
|
||||
set_prop(hal_vr, thermal_prop)
|
||||
|
||||
# Access to touch vrmode node
|
||||
allow hal_vr sysfs_touch:dir r_dir_perms;
|
||||
allow hal_vr sysfs_touch:file rw_file_perms;
|
||||
|
||||
@@ -48,6 +48,16 @@ Return<void> VrDevice::setVrMode(bool enabled) {
|
||||
if (!android::base::SetProperty("ctl.restart", "thermal-engine")) {
|
||||
LOG(ERROR) << "Couldn't set thermal_engine restart property";
|
||||
}
|
||||
if (!access("/sys/class/input/ftm4_touch", R_OK)) {
|
||||
FILE *f = fopen("/sys/class/input/ftm4_touch/vrmode", "w");
|
||||
if (f) {
|
||||
fprintf(f, "%d", (enabled ? 1 : 0));
|
||||
fclose(f);
|
||||
}
|
||||
else {
|
||||
LOG(ERROR) << "Couldn't open vrmode sysfs node";
|
||||
}
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user