diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java index ae33b83b49dc..6e5ddddcbe7f 100644 --- a/services/core/java/com/android/server/display/DisplayManagerService.java +++ b/services/core/java/com/android/server/display/DisplayManagerService.java @@ -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)