Loading services/core/java/com/android/server/display/DisplayPowerController.java +3 −14 Original line number Diff line number Diff line Loading @@ -1638,21 +1638,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // SDR brightness is unchanged, so animate quickly as this is only impacting // a likely minority amount of display content // ie, the highlights of an HDR video or UltraHDR image // Ideally we'd do this as fast as possible (ie, skip the animation entirely), // but this requires display support and would need an entry in the // display configuration. For now just do the fast animation slowChange = false; // Going from HDR to no HDR; visually this should be a "no-op" anyway // as the remaining SDR content's brightness should be holding steady // due to the sdr brightness not shifting if (BrightnessSynchronizer.floatEquals(sdrAnimateValue, animateValue)) { skipAnimation = true; } // Going from no HDR to HDR; visually this is a significant scene change // and the animation just prevents advanced clients from doing their own // handling of enter/exit animations if they would like to do such a thing if (BrightnessSynchronizer.floatEquals(sdrAnimateValue, currentBrightness)) { skipAnimation = true; } } if (skipAnimation) { animateScreenBrightness(animateValue, sdrAnimateValue, Loading services/tests/displayservicetests/src/com/android/server/display/DisplayPowerControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -725,8 +725,8 @@ public final class DisplayPowerControllerTest { } @Test @RequiresFlagsEnabled(Flags.FLAG_FAST_HDR_TRANSITIONS) public void testDisplayBrightnessHdr_SkipAnimationOnHdrAppearance() { when(mDisplayManagerFlagsMock.isFastHdrTransitionsEnabled()).thenReturn(true); Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC); Loading Loading @@ -757,12 +757,12 @@ public final class DisplayPowerControllerTest { advanceTime(1); // Run updatePowerState verify(mHolder.animator).animateTo(eq(hdrBrightness), eq(sdrBrightness), eq(BRIGHTNESS_RAMP_RATE_MINIMUM), eq(false)); eq(BRIGHTNESS_RAMP_RATE_FAST_INCREASE), eq(false)); } @Test @RequiresFlagsEnabled(Flags.FLAG_FAST_HDR_TRANSITIONS) public void testDisplayBrightnessHdr_SkipAnimationOnHdrRemoval() { when(mDisplayManagerFlagsMock.isFastHdrTransitionsEnabled()).thenReturn(true); Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC); Loading Loading @@ -797,7 +797,7 @@ public final class DisplayPowerControllerTest { advanceTime(1); // Run updatePowerState verify(mHolder.animator).animateTo(eq(sdrBrightness), eq(sdrBrightness), eq(BRIGHTNESS_RAMP_RATE_MINIMUM), eq(false)); eq(BRIGHTNESS_RAMP_RATE_FAST_DECREASE), eq(false)); } @Test Loading Loading
services/core/java/com/android/server/display/DisplayPowerController.java +3 −14 Original line number Diff line number Diff line Loading @@ -1638,21 +1638,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // SDR brightness is unchanged, so animate quickly as this is only impacting // a likely minority amount of display content // ie, the highlights of an HDR video or UltraHDR image // Ideally we'd do this as fast as possible (ie, skip the animation entirely), // but this requires display support and would need an entry in the // display configuration. For now just do the fast animation slowChange = false; // Going from HDR to no HDR; visually this should be a "no-op" anyway // as the remaining SDR content's brightness should be holding steady // due to the sdr brightness not shifting if (BrightnessSynchronizer.floatEquals(sdrAnimateValue, animateValue)) { skipAnimation = true; } // Going from no HDR to HDR; visually this is a significant scene change // and the animation just prevents advanced clients from doing their own // handling of enter/exit animations if they would like to do such a thing if (BrightnessSynchronizer.floatEquals(sdrAnimateValue, currentBrightness)) { skipAnimation = true; } } if (skipAnimation) { animateScreenBrightness(animateValue, sdrAnimateValue, Loading
services/tests/displayservicetests/src/com/android/server/display/DisplayPowerControllerTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -725,8 +725,8 @@ public final class DisplayPowerControllerTest { } @Test @RequiresFlagsEnabled(Flags.FLAG_FAST_HDR_TRANSITIONS) public void testDisplayBrightnessHdr_SkipAnimationOnHdrAppearance() { when(mDisplayManagerFlagsMock.isFastHdrTransitionsEnabled()).thenReturn(true); Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC); Loading Loading @@ -757,12 +757,12 @@ public final class DisplayPowerControllerTest { advanceTime(1); // Run updatePowerState verify(mHolder.animator).animateTo(eq(hdrBrightness), eq(sdrBrightness), eq(BRIGHTNESS_RAMP_RATE_MINIMUM), eq(false)); eq(BRIGHTNESS_RAMP_RATE_FAST_INCREASE), eq(false)); } @Test @RequiresFlagsEnabled(Flags.FLAG_FAST_HDR_TRANSITIONS) public void testDisplayBrightnessHdr_SkipAnimationOnHdrRemoval() { when(mDisplayManagerFlagsMock.isFastHdrTransitionsEnabled()).thenReturn(true); Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC); Loading Loading @@ -797,7 +797,7 @@ public final class DisplayPowerControllerTest { advanceTime(1); // Run updatePowerState verify(mHolder.animator).animateTo(eq(sdrBrightness), eq(sdrBrightness), eq(BRIGHTNESS_RAMP_RATE_MINIMUM), eq(false)); eq(BRIGHTNESS_RAMP_RATE_FAST_DECREASE), eq(false)); } @Test Loading