Loading core/java/android/view/SurfaceControl.java +4 −2 Original line number Diff line number Diff line Loading @@ -3896,10 +3896,12 @@ public final class SurfaceControl implements Parcelable { float currentBufferRatio, float desiredRatio) { checkPreconditions(sc); if (!Float.isFinite(currentBufferRatio) || currentBufferRatio < 1.0f) { throw new IllegalArgumentException("currentBufferRatio must be finite && >= 1.0f"); throw new IllegalArgumentException( "currentBufferRatio must be finite && >= 1.0f; got " + currentBufferRatio); } if (!Float.isFinite(desiredRatio) || desiredRatio < 1.0f) { throw new IllegalArgumentException("desiredRatio must be finite && >= 1.0f"); throw new IllegalArgumentException( "desiredRatio must be finite && >= 1.0f; got " + desiredRatio); } nativeSetExtendedRangeBrightness(mNativeObject, sc.mNativeObject, currentBufferRatio, desiredRatio); Loading services/core/java/com/android/server/display/LocalDisplayAdapter.java +2 −1 Original line number Diff line number Diff line Loading @@ -911,7 +911,8 @@ final class LocalDisplayAdapter extends DisplayAdapter { final float newHdrSdrRatio; if (displayNits != DisplayDeviceConfig.NITS_INVALID && sdrNits != DisplayDeviceConfig.NITS_INVALID) { newHdrSdrRatio = displayNits / sdrNits; // Ensure the ratio stays >= 1.0f as values below that are nonsensical newHdrSdrRatio = Math.max(1.f, displayNits / sdrNits); } else { newHdrSdrRatio = Float.NaN; } Loading Loading
core/java/android/view/SurfaceControl.java +4 −2 Original line number Diff line number Diff line Loading @@ -3896,10 +3896,12 @@ public final class SurfaceControl implements Parcelable { float currentBufferRatio, float desiredRatio) { checkPreconditions(sc); if (!Float.isFinite(currentBufferRatio) || currentBufferRatio < 1.0f) { throw new IllegalArgumentException("currentBufferRatio must be finite && >= 1.0f"); throw new IllegalArgumentException( "currentBufferRatio must be finite && >= 1.0f; got " + currentBufferRatio); } if (!Float.isFinite(desiredRatio) || desiredRatio < 1.0f) { throw new IllegalArgumentException("desiredRatio must be finite && >= 1.0f"); throw new IllegalArgumentException( "desiredRatio must be finite && >= 1.0f; got " + desiredRatio); } nativeSetExtendedRangeBrightness(mNativeObject, sc.mNativeObject, currentBufferRatio, desiredRatio); Loading
services/core/java/com/android/server/display/LocalDisplayAdapter.java +2 −1 Original line number Diff line number Diff line Loading @@ -911,7 +911,8 @@ final class LocalDisplayAdapter extends DisplayAdapter { final float newHdrSdrRatio; if (displayNits != DisplayDeviceConfig.NITS_INVALID && sdrNits != DisplayDeviceConfig.NITS_INVALID) { newHdrSdrRatio = displayNits / sdrNits; // Ensure the ratio stays >= 1.0f as values below that are nonsensical newHdrSdrRatio = Math.max(1.f, displayNits / sdrNits); } else { newHdrSdrRatio = Float.NaN; } Loading