android_device_xiaomi_clover/light/android.hardware.light@2.0-service.xiaomi_clover.rc
Steven Moreland 73a8c26a67
clover: light: mark as shutdown critical
Required because the lights need to be turned off late in boot
(e.x. during fsck for disk health), and before, blank_screen
accessing light encountered a race condition where if it didn't
get scheduled before all of the processes which were getting
shutdown were getting killed, the screen wouldn't blank.

Bug: 74976325
Test: adjusting brightness continues to work
Test: screen blanks during shutdown at the correct time
    including when an artificial 5s delay is inserted when
    the phone normally fscks (which can also be quick)

Change-Id: I57ebc11d7ecf57ee327c681455712f4b53de6fd3
2018-10-19 11:52:05 +02:00

26 lines
914 B
Text

on boot
# White light
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/red/blink
chown system system /sys/class/leds/red/duty_pcts
chown system system /sys/class/leds/red/pause_hi
chown system system /sys/class/leds/red/pause_lo
chown system system /sys/class/leds/red/ramp_step_ms
chown system system /sys/class/leds/red/start_idx
chmod 660 /sys/class/leds/red/blink
chmod 660 /sys/class/leds/red/duty_pcts
chmod 660 /sys/class/leds/red/pause_hi
chmod 660 /sys/class/leds/red/pause_lo
chmod 660 /sys/class/leds/red/ramp_step_ms
chmod 660 /sys/class/leds/red/start_idx
# Button backlight
chown system system /sys/class/leds/button-backlight1/brightness
service light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.xiaomi_clover
class hal
user system
group system
shutdown critical