Loading services/core/java/com/android/server/display/DisplayDeviceConfig.java +7 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,13 @@ public class DisplayDeviceConfig { return mBacklightToNitsSpline.interpolate(backlight); } /** * @return true if there is sdrHdrRatioMap, false otherwise. */ public boolean hasSdrToHdrRatioSpline() { return mSdrToHdrRatioSpline != null; } /** * Calculate the HDR brightness for the specified SDR brightenss, restricted by the * maxDesiredHdrSdrRatio (the ratio between the HDR luminance and SDR luminance) Loading services/core/java/com/android/server/display/LocalDisplayAdapter.java +3 −1 Original line number Diff line number Diff line Loading @@ -888,7 +888,9 @@ final class LocalDisplayAdapter extends DisplayAdapter { BrightnessSynchronizer.brightnessFloatToInt( sdrBrightnessState)); if (getDisplayDeviceConfig().hasSdrToHdrRatioSpline()) { handleHdrSdrNitsChanged(nits, sdrNits); } } finally { Trace.traceEnd(Trace.TRACE_TAG_POWER); Loading services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; Loading Loading @@ -981,6 +982,7 @@ public class LocalDisplayAdapterTest { DisplayDevice displayDevice = mListener.addedDisplays.get(0); // Turn on / initialize assumeTrue(displayDevice.getDisplayDeviceConfig().hasSdrToHdrRatioSpline()); Runnable changeStateRunnable = displayDevice.requestDisplayStateLocked(Display.STATE_ON, 0, 0); changeStateRunnable.run(); Loading Loading
services/core/java/com/android/server/display/DisplayDeviceConfig.java +7 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,13 @@ public class DisplayDeviceConfig { return mBacklightToNitsSpline.interpolate(backlight); } /** * @return true if there is sdrHdrRatioMap, false otherwise. */ public boolean hasSdrToHdrRatioSpline() { return mSdrToHdrRatioSpline != null; } /** * Calculate the HDR brightness for the specified SDR brightenss, restricted by the * maxDesiredHdrSdrRatio (the ratio between the HDR luminance and SDR luminance) Loading
services/core/java/com/android/server/display/LocalDisplayAdapter.java +3 −1 Original line number Diff line number Diff line Loading @@ -888,7 +888,9 @@ final class LocalDisplayAdapter extends DisplayAdapter { BrightnessSynchronizer.brightnessFloatToInt( sdrBrightnessState)); if (getDisplayDeviceConfig().hasSdrToHdrRatioSpline()) { handleHdrSdrNitsChanged(nits, sdrNits); } } finally { Trace.traceEnd(Trace.TRACE_TAG_POWER); Loading
services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; Loading Loading @@ -981,6 +982,7 @@ public class LocalDisplayAdapterTest { DisplayDevice displayDevice = mListener.addedDisplays.get(0); // Turn on / initialize assumeTrue(displayDevice.getDisplayDeviceConfig().hasSdrToHdrRatioSpline()); Runnable changeStateRunnable = displayDevice.requestDisplayStateLocked(Display.STATE_ON, 0, 0); changeStateRunnable.run(); Loading