forked from LeddaZ/frameworks_base
display: Handle zero auto brightness adjustment
Some apps (such as miui camera) resets the auto brightness adjustment to 0.0f instead of correctly using Float.NaN, causing auto brightness animation to be disabled afterwards. Prevent this scenario by overriding it to Float.NaN ourselves. Change-Id: Idc39d120db306403482c7011db7c556f4f902468
This commit is contained in:
parent
52d4e72859
commit
0cc9546ef8
|
@ -4607,7 +4607,11 @@ public final class DisplayManagerService extends SystemService {
|
|||
@Override // Binder call
|
||||
public void setTemporaryAutoBrightnessAdjustment(float adjustment) {
|
||||
setTemporaryAutoBrightnessAdjustment_enforcePermission();
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
if (adjustment == 0.0f) {
|
||||
Slog.w(TAG, "Invalid auto brightness adjustment 0.0f, use Float.NaN instead!");
|
||||
adjustment = Float.NaN;
|
||||
}
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
synchronized (mSyncRoot) {
|
||||
mDisplayPowerControllers.get(Display.DEFAULT_DISPLAY)
|
||||
|
|
Loading…
Reference in New Issue