Browse Source

recovery: Allow device specific backlight path

Change-Id: I4a2944d32df35c60892c0f7aca046ca862913ee5
Tom Marshall 3 years ago
parent
commit
b54bc2dadb
2 changed files with 8 additions and 2 deletions
  1. 6
    0
      Android.mk
  2. 2
    2
      ui.cpp

+ 6
- 0
Android.mk View File

@@ -148,6 +148,12 @@ else
148 148
 LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=0
149 149
 endif
150 150
 
151
+ifneq ($(TARGET_RECOVERY_BACKLIGHT_PATH),)
152
+LOCAL_CFLAGS += -DBACKLIGHT_PATH=\"$(TARGET_RECOVERY_BACKLIGHT_PATH)\"
153
+else
154
+LOCAL_CFLAGS += -DBACKLIGHT_PATH=\"/sys/class/leds/lcd-backlight\"
155
+endif
156
+
151 157
 LOCAL_C_INCLUDES += \
152 158
     system/vold \
153 159
 

+ 2
- 2
ui.cpp View File

@@ -49,8 +49,8 @@
49 49
 #include "device.h"
50 50
 
51 51
 static constexpr int UI_WAIT_KEY_TIMEOUT_SEC = 120;
52
-static constexpr const char* BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/brightness";
53
-static constexpr const char* MAX_BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/max_brightness";
52
+static constexpr const char* BRIGHTNESS_FILE = BACKLIGHT_PATH "/brightness";
53
+static constexpr const char* MAX_BRIGHTNESS_FILE = BACKLIGHT_PATH "/max_brightness";
54 54
 static constexpr const char* BRIGHTNESS_FILE_SDM =
55 55
     "/sys/class/backlight/panel0-backlight/brightness";
56 56
 static constexpr const char* MAX_BRIGHTNESS_FILE_SDM =