Skip to content

Commit

Permalink
hidl: livedisplay: Don't disable HBM if it's already disabled
Browse files Browse the repository at this point in the history
Turning off HBM triggers an unwanted screen brightness change while
showing AOD screen on pdx225.

Change-Id: Ice027302b84082fd82d16c232c13c1cf388c7714
  • Loading branch information
luk1337 committed Jan 18, 2025
1 parent 01960f6 commit 4c0f2d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hidl/livedisplay/SunlightEnhancement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ Return<bool> SunlightEnhancement::isEnabled() {
}

Return<bool> SunlightEnhancement::setEnabled(bool enabled) {
if (isEnabled() == enabled) {
return true;
}
std::ofstream file(kHbmPath);
file << (enabled ? "1" : "0");
LOG(DEBUG) << "setEnabled fail " << file.fail();
Expand Down

0 comments on commit 4c0f2d5

Please sign in to comment.