Skip to content

Commit c4892cd

Browse files
adithya2306neobuddy89
authored andcommitted
display: Allow HBM in manual brightness if no time limitation
If a display does not set time limitation for HBM, it means it can safely run at HBM for as long as it wants. With this in mind, we can allow HBM in manual brightness too for such displays. This still obeys the thermal throttling and battery saver conditions for obvious reasons. Change-Id: I18ca7748c1f32dca1e70497afd0b6df8ed81ad5d Signed-off-by: Pranav Vashi <[email protected]>
1 parent 4af05ef commit c4892cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/core/java/com/android/server/display/HighBrightnessModeController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ boolean isHbmCurrentlyAllowed() {
379379
// brightness maximum; so we implement HDR-HBM in a way that doesn't adjust the max.
380380
// See {@link #getHdrBrightnessValue}.
381381
return !mIsHdrLayerPresent
382-
&& (mIsAutoBrightnessEnabled && mIsTimeAvailable && mIsInAllowedAmbientRange
383-
&& !mIsBlockedByLowPowerMode);
382+
&& ((mIsAutoBrightnessEnabled && mIsTimeAvailable && mIsInAllowedAmbientRange)
383+
|| (!mIsAutoBrightnessEnabled && mHbmData.timeWindowMillis == 0))
384+
&& !mIsBlockedByLowPowerMode;
384385
}
385386

386387
boolean deviceSupportsHbm() {

0 commit comments

Comments
 (0)