Merge "Read brightness-related properties from ro.recovery.ui" am: 1937b3fd30 am: 445fa201d9 am: 348895178c am: 825a34c678

Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/2646359

Change-Id: I7feb49cc9f501edb20bcfc006ae14bd8e2ef762c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chuong Hoang 2023-07-06 05:27:33 +00:00 committed by Automerger Merge Worker
commit 20c4c81209

View file

@ -43,24 +43,30 @@
using namespace std::chrono_literals;
constexpr int UI_WAIT_KEY_TIMEOUT_SEC = 120;
constexpr const char* BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/brightness";
constexpr const char* MAX_BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/max_brightness";
constexpr const char* DEFAULT_BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/brightness";
constexpr const char* DEFAULT_MAX_BRIGHTNESS_FILE = "/sys/class/leds/lcd-backlight/max_brightness";
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* 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;
constexpr int kDefaultNormalBrightnessPercent = 50;
constexpr int kDefaultDimmedBrightnessPercent = 25;
RecoveryUI::RecoveryUI()
: brightness_normal_(50),
brightness_dimmed_(25),
brightness_file_(BRIGHTNESS_FILE),
max_brightness_file_(MAX_BRIGHTNESS_FILE),
: brightness_normal_(android::base::GetIntProperty("ro.recovery.ui.brightness_normal_percent",
kDefaultNormalBrightnessPercent)),
brightness_dimmed_(android::base::GetIntProperty("ro.recovery.ui.brightness_dimmed_percent",
kDefaultDimmedBrightnessPercent)),
brightness_file_(
android::base::GetProperty("ro.recovery.ui.brightness_file", DEFAULT_BRIGHTNESS_FILE)),
max_brightness_file_(android::base::GetProperty("ro.recovery.ui.max_brightness_file",
DEFAULT_MAX_BRIGHTNESS_FILE)),
touch_screen_allowed_(false),
fastbootd_logo_enabled_(false),
touch_low_threshold_(android::base::GetIntProperty("ro.recovery.ui.touch_low_threshold",