From c279339ab927e2bdb77aa42973ef3e320c025364 Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Thu, 6 Feb 2020 23:02:18 +0800 Subject: sdm660-common: Improve lights HAL * Use libbase logging and file utils * Read max brightness from sysfs * Convert constants to constexpr * Move helper functions to anonymous namespace * Bug fixes * Remove redundant chmod * Start the service after permissions are set up because it reads max brightness in constructor. Change-Id: I145d393c785e182060c5651e796d489f8c4d697b [SQUASHME] Let's dejank paths a bit... Change-Id: Ifd3d05588b0271e7a361aa4c7374a91fe5639a1f --- light/android.hardware.light@2.0-service.xiaomi_sdm660.rc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'light/android.hardware.light@2.0-service.xiaomi_sdm660.rc') diff --git a/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc b/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc index 7dac2e6..969bdac 100644 --- a/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc +++ b/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc @@ -3,21 +3,19 @@ on boot chown system system /sys/class/leds/white/blink chown system system /sys/class/leds/white/brightness chown system system /sys/class/leds/white/duty_pcts + chown system system /sys/class/leds/white/max_brightness chown system system /sys/class/leds/white/pause_hi chown system system /sys/class/leds/white/pause_lo chown system system /sys/class/leds/white/ramp_step_ms chown system system /sys/class/leds/white/start_idx - chmod 660 /sys/class/leds/white/blink - chmod 660 /sys/class/leds/white/brightness - chmod 660 /sys/class/leds/white/duty_pcts - chmod 660 /sys/class/leds/white/pause_hi - chmod 660 /sys/class/leds/white/pause_lo - chmod 660 /sys/class/leds/white/ramp_step_ms - chmod 660 /sys/class/leds/white/start_idx + chown system system /sys/class/leds/lcd-backlight/max_brightness + + start vendor.light-hal-2-0 service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.xiaomi_sdm660 class hal user system group system shutdown critical + disabled -- cgit v1.2.3