summaryrefslogtreecommitdiffstats
path: root/recovery_ui
diff options
context:
space:
mode:
authorLincoln Atkinson <latkin@google.com>2020-03-09 23:22:29 +0100
committerShreerag Jayakrishnan <shreerag@google.com>2020-12-03 23:24:19 +0100
commitfcf4b6bca0b628ec757d6d231212c45a9a3a6b86 (patch)
tree875a453bd7f8c4800737354c47dd4f4f9335faf3 /recovery_ui
parentMerge "Add a fuzzer for OTA package verification" am: 6a4dbdf088 am: 923cdf3db1 am: ab1a7bb228 am: a66580cd75 (diff)
downloadandroid_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.tar
android_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.tar.gz
android_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.tar.bz2
android_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.tar.lz
android_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.tar.xz
android_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.tar.zst
android_bootable_recovery-fcf4b6bca0b628ec757d6d231212c45a9a3a6b86.zip
Diffstat (limited to 'recovery_ui')
-rw-r--r--recovery_ui/ui.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/recovery_ui/ui.cpp b/recovery_ui/ui.cpp
index 330721773..6e67b1d4e 100644
--- a/recovery_ui/ui.cpp
+++ b/recovery_ui/ui.cpp
@@ -48,6 +48,10 @@ constexpr const char* MAX_BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/max_b
constexpr const char* BRIGHTNESS_FILE_SDM = "/sys/class/backlight/panel0-backlight/brightness";
constexpr const char* MAX_BRIGHTNESS_FILE_SDM =
"/sys/class/backlight/panel0-backlight/max_brightness";
+constexpr const char* BRIGHTNESS_FILE_PWM =
+ "/sys/class/backlight/pwm-backlight.0/brightness";
+constexpr const char* MAX_BRIGHTNESS_FILE_PWM =
+ "/sys/class/backlight/pwm-backlight.0/max_brightness";
constexpr int kDefaultTouchLowThreshold = 50;
constexpr int kDefaultTouchHighThreshold = 90;
@@ -106,10 +110,19 @@ bool RecoveryUI::InitScreensaver() {
return false;
}
if (access(brightness_file_.c_str(), R_OK | W_OK)) {
- brightness_file_ = BRIGHTNESS_FILE_SDM;
+ if (!access(BRIGHTNESS_FILE_SDM, R_OK | W_OK)) {
+ brightness_file_ = BRIGHTNESS_FILE_SDM;
+ } else {
+ brightness_file_ = BRIGHTNESS_FILE_PWM;
+ }
}
+
if (access(max_brightness_file_.c_str(), R_OK)) {
- max_brightness_file_ = MAX_BRIGHTNESS_FILE_SDM;
+ if (!access(MAX_BRIGHTNESS_FILE_SDM, R_OK)) {
+ max_brightness_file_ = MAX_BRIGHTNESS_FILE_SDM;
+ } else {
+ max_brightness_file_ = MAX_BRIGHTNESS_FILE_PWM;
+ }
}
// Set the initial brightness level based on the max brightness. Note that reading the initial
// value from BRIGHTNESS_FILE doesn't give the actual brightness value (bullhead, sailfish), so