|
|
@ -43,13 +43,13 @@ bool SunlightEnhancement::isSupported() { |
|
|
|
Return<bool> SunlightEnhancement::isEnabled() { |
|
|
|
Return<bool> SunlightEnhancement::isEnabled() { |
|
|
|
std::string brightness; |
|
|
|
std::string brightness; |
|
|
|
ReadFileToString(kBrightnessPath, &brightness); |
|
|
|
ReadFileToString(kBrightnessPath, &brightness); |
|
|
|
return brightness == "365"; |
|
|
|
return brightness == "486"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Return<bool> SunlightEnhancement::setEnabled(bool enabled) { |
|
|
|
Return<bool> SunlightEnhancement::setEnabled(bool enabled) { |
|
|
|
if (enabled) { |
|
|
|
if (enabled) { |
|
|
|
ReadFileToString(kBrightnessPath, &previous_brightness); |
|
|
|
ReadFileToString(kBrightnessPath, &previous_brightness); |
|
|
|
return WriteStringToFile("365", kBrightnessPath, true); |
|
|
|
return WriteStringToFile("486", kBrightnessPath, true); |
|
|
|
} else if (!previous_brightness.empty()) { |
|
|
|
} else if (!previous_brightness.empty()) { |
|
|
|
return WriteStringToFile(previous_brightness, kBrightnessPath, true); |
|
|
|
return WriteStringToFile(previous_brightness, kBrightnessPath, true); |
|
|
|
} |
|
|
|
} |
|
|
|