Improve max brightness handling
If we can detect the directory, why don't we detect maximum as well? Additional patch by: Matt Mower Replace clunky /nobrightness handling Cleanup TWFunc::Set_Brightness() and blanktimer::getBrightness() a bit, primarily for the purpose of relying on the value in tw_has_brightnesss_file instead of checking for a phony brightness path. Change-Id: Ib22595df53cefa8db7a1172a581984c42ad461c6
This commit is contained in:
committed by
Dees Troy
parent
6069a793ea
commit
548a175182
+6
-9
@@ -81,16 +81,13 @@ void blanktimer::checkForTimeout() {
|
||||
|
||||
string blanktimer::getBrightness(void) {
|
||||
string result;
|
||||
string brightness_path;
|
||||
DataManager::GetValue("tw_brightness_file", brightness_path);
|
||||
if (brightness_path == "/nobrightness")
|
||||
return brightness_path;
|
||||
DataManager::GetValue("tw_brightness", result);
|
||||
if (result == "") {
|
||||
result = "255";
|
||||
|
||||
if (DataManager::GetIntValue("tw_has_brightnesss_file")) {
|
||||
DataManager::GetValue("tw_brightness", result);
|
||||
if (result.empty())
|
||||
result = "255";
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
void blanktimer::resetTimerAndUnblank(void) {
|
||||
@@ -112,7 +109,7 @@ void blanktimer::resetTimerAndUnblank(void) {
|
||||
gui_forceRender();
|
||||
// No break here, we want to keep going
|
||||
case kDim:
|
||||
if (orig_brightness != "/nobrightness")
|
||||
if (!orig_brightness.empty())
|
||||
TWFunc::Set_Brightness(orig_brightness);
|
||||
state = kOn;
|
||||
case kOn:
|
||||
|
||||
Reference in New Issue
Block a user