diff --git a/light/Light.cpp b/light/Light.cpp index 54d05b3..a9b58f4 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -22,11 +22,11 @@ #include -#define LCD_LED "/sys/class/backlight/panel0-backlight/" -#define WHITE_LED "/sys/class/leds/white/" +#define PANEL_LED "/sys/class/backlight/panel0-backlight/" +#define NOTIFICATION_LED "/sys/class/leds/green/" -#define BREATH "breath" -#define BRIGHTNESS "brightness" +#define BREATH "breath" +#define BRIGHTNESS "brightness" #define MAX_LED_BRIGHTNESS 255 #define MAX_LCD_BRIGHTNESS 4095 @@ -83,24 +83,24 @@ static inline uint32_t getScaledBrightness(const LightState& state, uint32_t max static void handleBacklight(const LightState& state) { uint32_t brightness = getScaledBrightness(state, MAX_LCD_BRIGHTNESS); - set(LCD_LED BRIGHTNESS, brightness); + set(PANEL_LED BRIGHTNESS, brightness); } static void handleNotification(const LightState& state) { - uint32_t whiteBrightness = getScaledBrightness(state, MAX_LED_BRIGHTNESS); + uint32_t notificationBrightness = getScaledBrightness(state, MAX_LED_BRIGHTNESS); /* Disable breathing or blinking */ - set(WHITE_LED BREATH, 0); + set(NOTIFICATION_LED BREATH, 0); switch (state.flashMode) { case Flash::HARDWARE: case Flash::TIMED: /* Breathing */ - set(WHITE_LED BREATH, 1); + set(NOTIFICATION_LED BREATH, 1); break; case Flash::NONE: default: - set(WHITE_LED BRIGHTNESS, whiteBrightness); + set(NOTIFICATION_LED BRIGHTNESS, notificationBrightness); } } diff --git a/light/android.hardware.light@2.0-service.davinci.rc b/light/android.hardware.light@2.0-service.davinci.rc index 9bd6ad6..c550d82 100644 --- a/light/android.hardware.light@2.0-service.davinci.rc +++ b/light/android.hardware.light@2.0-service.davinci.rc @@ -1,13 +1,13 @@ on boot chown system system /sys/class/backlight/panel0-backlight/brightness chown system system /sys/class/backlight/panel0-backlight/max_brightness - chown system system /sys/class/leds/white/brightness - chown system system /sys/class/leds/white/breath + chown system system /sys/class/leds/green/brightness + chown system system /sys/class/leds/green/breath chmod 0644 /sys/class/backlight/panel0-backlight/brightness chmod 0644 /sys/class/backlight/panel0-backlight/max_brightness - chmod 0644 /sys/class/leds/white/brightness - chmod 0644 /sys/class/leds/white/breath + chmod 0644 /sys/class/leds/green/brightness + chmod 0644 /sys/class/leds/green/breath service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.davinci interface android.hardware.light@2.0::ILight default