From 89e12ed87411613fe90eba011c49475fdc4a3b73 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sun, 27 Dec 2020 19:48:05 +0000 Subject: [PATCH] davinci: lights: Remove LCD backlight handling Since composer HAL is now able to handle display brightness, this can be removed from the lights HAL. Change-Id: Ic10cead638382d448a94205bcec3543177d387f6 --- light/Light.cpp | 9 +-------- light/android.hardware.light@2.0-service.davinci.rc | 4 ---- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/light/Light.cpp b/light/Light.cpp index 7ce09e4..becbc67 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2019 The LineageOS Project + * Copyright (C) 2018-2020 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ #include -#define PANEL_LED "/sys/class/backlight/panel0-backlight/" #define NOTIFICATION_LED "/sys/class/leds/left/" #define BREATH "breath" @@ -97,11 +96,6 @@ static inline uint32_t getScaledBrightness(const LightState& state, uint32_t max return scaleBrightness(getBrightness(state), maxBrightness); } -static void handleBacklight(const LightState& state) { - uint32_t brightness = getScaledBrightness(state, getMaxBrightness(PANEL_LED MAX_BRIGHTNESS)); - set(PANEL_LED BRIGHTNESS, brightness); -} - static void handleNotification(const LightState& state) { uint32_t notificationBrightness = getScaledBrightness(state, getMaxBrightness(NOTIFICATION_LED MAX_BRIGHTNESS)); @@ -145,7 +139,6 @@ static std::vector backends = { { Type::ATTENTION, handleNotification }, { Type::NOTIFICATIONS, handleNotification }, { Type::BATTERY, handleNotification }, - { Type::BACKLIGHT, handleBacklight }, }; static LightStateHandler findHandler(Type type) { diff --git a/light/android.hardware.light@2.0-service.davinci.rc b/light/android.hardware.light@2.0-service.davinci.rc index 7fd8d1c..9803b27 100644 --- a/light/android.hardware.light@2.0-service.davinci.rc +++ b/light/android.hardware.light@2.0-service.davinci.rc @@ -1,13 +1,9 @@ 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/left/brightness chown system system /sys/class/leds/left/breath chown system system /sys/class/leds/right/brightness chown system system /sys/class/leds/right/breath - chmod 0644 /sys/class/backlight/panel0-backlight/brightness - chmod 0644 /sys/class/backlight/panel0-backlight/max_brightness chmod 0644 /sys/class/leds/left/brightness chmod 0644 /sys/class/leds/left/breath chmod 0644 /sys/class/leds/right/brightness