From 356bd4cf2c6db38c61c79e81fd5d9d119d299b8d Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 26 Oct 2012 18:22:56 -0700 Subject: [PATCH] Don't scale screen brightness by electron beam level. This change removes the modulation of the screen brightness by the electron beam level. The screen brightness remains constant while the electron beam animation is playing. Previously we were multiplying the screen brightness by the electron beam level so as to animate both at the same time. The problem is that when the screen brightness is already dim to begin with, it may not be possible to see the electron beam animation because the modulated screen brightness rapidly converges on 0. This may manifest give the appearance of an abrupt transition or a flash as the screen turns off. Bug: 7387800 Change-Id: I27b90f0098bbdc3de1d66fad819548d1301405cd --- services/java/com/android/server/power/DisplayPowerState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/java/com/android/server/power/DisplayPowerState.java b/services/java/com/android/server/power/DisplayPowerState.java index 6bb7ec5946e8e..fa318f8b61989 100644 --- a/services/java/com/android/server/power/DisplayPowerState.java +++ b/services/java/com/android/server/power/DisplayPowerState.java @@ -302,8 +302,8 @@ final class DisplayPowerState { public void run() { mScreenUpdatePending = false; - if (mPhotonicModulator.setState(mScreenOn, - mScreenOn ? (int)(mScreenBrightness * mElectronBeamLevel) : 0)) { + int brightness = mScreenOn && mElectronBeamLevel > 0f ? mScreenBrightness : 0; + if (mPhotonicModulator.setState(mScreenOn, brightness)) { mScreenReady = true; invokeCleanListenerIfNeeded(); }