klte-common: Add PowerHAL extension for touchscreen

* Disable touchscreen when display is off
* Add touchscreen permissions

Change-Id: I96bd00690cb4fe8a9f93fa572e633c9e86891abe
This commit is contained in:
Matt Filetto 2014-09-12 03:20:42 -07:00 committed by Ethan Chen
parent 47a9e6d610
commit 54184885b1
2 changed files with 11 additions and 2 deletions

View File

@ -21,7 +21,11 @@
#define LOG_TAG "PowerHAL_H_Ext"
#include <utils/Log.h>
#define TSP_POWER "/sys/class/input/input1/enabled"
/* touchkeys */
#define TK_POWER "/sys/class/input/input1/enabled"
/* touchscreen */
#define TS_POWER "/sys/class/input/input2/enabled"
static void sysfs_write(char *path, char *s) {
char buf[80];
@ -45,5 +49,6 @@ static void sysfs_write(char *path, char *s) {
void cm_power_set_interactive_ext(int on) {
ALOGD("%s: %s input devices", __func__, on ? "enabling" : "disabling");
sysfs_write(TSP_POWER, on ? "1" : "0");
sysfs_write(TK_POWER, on ? "1" : "0");
sysfs_write(TS_POWER, on ? "1" : "0");
}

View File

@ -194,6 +194,10 @@ on post-fs-data
chmod 0660 /sys/class/leds/torch-sec1/brightness
chown system camera /sys/class/leds/torch-sec1/brightness
# Touchscreen
chmod 0660 /sys/class/input/input2/enabled
chown system system /sys/class/input/input2/enabled
# Vibrator
chmod 0644 /sys/class/timed_output/vibrator/pwm_value
chown root system /sys/class/timed_output/vibrator/pwm_value