diff --git a/liblight/lights.c b/liblight/lights.c index 1928a98..46a7d8a 100644 --- a/liblight/lights.c +++ b/liblight/lights.c @@ -104,11 +104,12 @@ set_light_buttons(struct light_device_t* dev, struct light_state_t const* state) { int err = 0; + int on = (state->color & 0xFF); if(!dev) { return -1; } pthread_mutex_lock(&g_lock); - err = write_int(BUTTON_FILE, state->color & 0xFF); + err = write_int(BUTTON_FILE, on == 255 ? 1 : 0); pthread_mutex_unlock(&g_lock); return err; } diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 4d551a1..a671050 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -261,6 +261,15 @@ on boot chown system media_rw /sys/class/graphics/fb0/csc_cfg chmod 0660 /sys/class/graphics/fb0/csc_cfg + # Permissions for Input Device + chown system radio /sys/class/sec/tsp/cmd + chown system system /sys/class/sec/tsp/input/enabled + chmod 0660 /sys/class/sec/tsp/input/enabled + chown system system /sys/class/sec/sec_touchkey/input/enabled + chmod 0660 /sys/class/sec/sec_touchkey/input/enabled + chown system system /sys/class/sec/sec_touchkey/brightness + chmod 0660 /sys/class/sec/sec_touchkey/brightness + # Permissions for SENSOR # Fingerprint_sensor chown system radio /sys/class/fingerprint/fingerprint/type_check