History log of /frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4d269ba32037485bfa5ffba4dd23f796cbf10c43 15-Nov-2014 Prashant Malani <pmalani@google.com> am fb26a2c8: Merge "Don\'t animate screen brightness if there is a pending off transition" into lmp-sprout-dev

* commit 'fb26a2c80b988118983251caf36492f2ae39559c':
Don't animate screen brightness if there is a pending off transition
33538249f26f0cc637eac636f3712f972916595d 13-Nov-2014 Prashant Malani <pmalani@google.com> Don't animate screen brightness if there is a pending off transition

When the DisplayPowerRequest policy is POLICY_OFF, a screen state
transition animation to DISPLAY_OFF is intiated. However, in
updatePowerState() the screen brightness setting, based on the current
display state, is set to normal brightness and an animation is
triggered. This causes a transient flash on some devices, which are
transitioning from a dimmed screen to screen off.

This change checks for a pending screen off transition before
triggering a screen brightness animation, to prevent the flashes.

Bug: 18136235
Change-Id: I37f9fb28b3ec8a4fdbb45920c40d25ebd50c220b
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
72f1e3b9c9992bfc3449c5441bc8e50e7b05f083 13-Nov-2014 Jeff Brown <jeffbrown@google.com> am 1cbff0e3: Merge "Improve screen brightness boost behavior." into lmp-sprout-dev

* commit '1cbff0e310b0fba6b25ca1c1e14eaefeabdee0d9':
Improve screen brightness boost behavior.
7b5be5e2a738859d36e1977cdc756cf83361d72f 13-Nov-2014 Jeff Brown <jeffbrown@google.com> Improve screen brightness boost behavior.

Wake-up when entering brightness boost mode, don't boost in ambient
mode since some display device drivers do strange things in that mode and
boost doesn't work. Waking up feels more natural as well.

Don't flutter the power HAL's interactive mode bit simply due to changes
in display ready state since that may result in visible artifacts
such as display flashes.

Don't stop the auto-brightness sensor while temporarily boosted.

Don't prevent the display from entering the ready state while in brightness
boost since that would unnecessarily delay the transition from DOZING to AWAKE
until boost is finished.

Restart the user activity timeout when brightness boost ends and prevent
the display from dimming while boosted.

The pixel fairies basked in the sunlight.

Bug: 18262044
Bug: 18261782
Change-Id: I8c42a1e6091b0fe1253e90265ac248087ebc24e1
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
a15aa7d426972daecc0e8cd31dcf4d6bc656f1e9 28-Oct-2014 Filip Gruszczynski <gruszczy@google.com> Automatic brightness using ALS while dozing.

Bug: 16525667

Change-Id: Ib75cfebf46f2c122e7b68556591b601d22a318e1
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
e333e674a758c39885d4d9779a1aad387fb0e6aa 28-Oct-2014 Jeff Brown <jeffbrown@google.com> Add a function to boost screen brightness temporarily.

When PowerManager.boostScreenBrightness() is called, the screen
brightness is set to maximum for 5 seconds. This action is
also considered to be user activity.

Bug: 17934954
Change-Id: I1cb4a03a60705c6c1c5cc9ff84b1c5dbd2932fcd
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
bf4e414cf0d0f512a0929ecd4e662a925d7684f0 02-Oct-2014 Jeff Brown <jeffbrown@google.com> Fix a bug with screen brightness during screen off animation.

Due to a recent change there was a regression that caused the
screen brightness to be animated down to 0 while the screen
off animation was running. When the brightness was low this
would cause the screen off animation to be cut short.

This change ensures that we take into account the actual screen
state instead of the desired screen state when making screen
brightness decisions in case we are in the middle of a transition.

The darkness came early. The pixel fairies trembled.

Bug: 17718416
Change-Id: Ib4b55d61b359abbc70920e324f08a5db07bdd035
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
0a434776b836f8fbea1f84b7bfe158b4ddafc876 30-Sep-2014 Jeff Brown <jeffbrown@google.com> Reduce latency from doze to screen on.

Don't wait for the brightness ramp to complete before reporting
display ready. Keep track of whether we have any unfinished
brightness changes and take care to grab a wakelock to ensure
they are eventually applied.

Ideally we would rewrite the whole state machine to more carefully
coordinate screen state and brightness changes but that's too
risky for now.

The pixel fairies are having a bad day.

Bug: 17718416

(cherry picked from commit 875f80c2732a3fbe652a6e8fc14031041f791308)

Change-Id: I7a2d8ba4591a12b773653d3dbf86c7db016f967e
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
3ee549ca2404067bb8b2fcbaa741ec118c76bf3e 23-Sep-2014 Jeff Brown <jeffbrown@google.com> Fix window manager policy state when waking from doze.

Once upon a time when the world was fresh and new, the heavens
had an easy rhythm. Day and night. Night and day. In the day,
the pixel fairies would cavort and play in the bright gardens
with narry a mark of shadow or gloom. In the night, they would
rest peacefully, dreaming no dreams and knowing no fear.

Then one night a fairy dreamed the first dream. At first
the dream was peaceful, full of colors and delight, hopes and
memories. Then all at once, jarringly, it awoke in bright
daylight. The pixel fairy knew fear, for the world had changed
and it was unprepared.

Time passed and the pixel fairies grew accustomed to their
fate, day and night, night and day, sometimes dreaming, until
there came a night when a fairy did not sleep. It roamed
the land in a dreamless doze, lost and afraid amid a grim haze
of grey and darkness. The fairy despaired. It wanted no
part of this place. It pretended for a time to be awake but
the bright daylight would not come. It pretended for a time to
be dreaming but the colors and memories would not come.
That is when the fairy wished for oblivion. Then just as
suddenly, it awoke in the daylight. It fell to the ground,
stunned as if it had forgotten how to walk in the too bright
daylight.

Though the world again grew softer and kinder in time, the pixel
fairies were never the same. For the night is dark and full
of terrors.

---

It used to be easy. Screen on and screen off could explain almost
everything about the state of the device but it's different now with
ambient display. We need to be able to wait for all windows to be
drawn even in the case where the device is still nominally asleep.
In truth, the window manager policy which drives a lot of these
interactions is a thicket of outdated assumptions.

Added a new method to tell the window manager policy when the screen
is being turned off so that it can correctly account for changes
to the interactive state (wakeUp and goingToSleep) and screen state
(screenTurningOn and screenTurnedOff). Now we can independently
poke keyguard during interactive state changes and we can apply
screen on blocking during screen state changes.

Moved the code which manages screen on blocking (which is what
ensures the UI has fully drawn before revealing screen contents)
from the power manager to the display manager since the display
manager is in a better position to accurately track the state of
the screen, particularly when the screen is being turned off.

Fixed a bunch of synchronization issues. Previously some work
had been moved to a handler without considering what might
happen if it became reordered relative to other work happening
elsewhere. Documented the desired behavior in the code to
prevent this from happening again.

There's still a bunch of stuff in here that isn't quite right,
particularly the assumption that there's only one screen, but
it's good enough for now. Hopefully there aren't too many bugs.

Bug: 17605802
Change-Id: Ic7319e09948c8a3cda014d7e169c964a3ad86f14
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
606e4e8c98304daf756f7e89d47005573288f72a 19-Sep-2014 Jeff Brown <jeffbrown@google.com> Ensure that the screen on blocker is applied while dozing.

The screen on blocker is used to keep the screen blank while the
system is drawing new content to prevent the user from seeing a
flash of stale content while the screen is being turned on.
This patch ensures that the screen on blocker functionality
is also applied while dozing.

Bug: 17516245
Change-Id: I77c2d0f2b99476a59ad212099f44c63aa2ef9c34
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
2175e9c366998ed7bd1a4501b94a02f4f49b932c 13-Sep-2014 Jeff Brown <jeffbrown@google.com> Add support for dozing after screen off.

On some devices, we want the screen off transition to complete before
we start dozing. Added a new config.xml attribute config_dozeAfterScreenOff
to configure this behavior.

Defer starting dreams until the display is ready.

Fixed some minor issues in the system UI doze service when setting the
display state.

Bug: 16187655
Change-Id: Ib1bc60de5457166f4b4880732db5df989dda67a4
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
3e9a13438dce2f4a7a437e9b5bbd222128c39d52 29-Aug-2014 Michael Wright <michaelwr@google.com> Use a linear spline if there's a non-monotonic brightness curve

Some devices may contain things like transflective displays where
they actually want the backlight brightness to decrease in the face
of high ambient light scenarios. In the interest of time, just use a
linear interpolation based on the brightness control points for these
cases but in the future we should consider adding a non-monotonic
cubic spline.

Bug: 15611140
Change-Id: I8fcee061b18c8ae9cc9a1b38d8b850aaec4478ce
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
1bfd0f463e279e3ac3f133c5e0ad11ccfd73eed5 22-Aug-2014 Jeff Brown <jeffbrown@google.com> Improve adaptive brightness in very dark rooms.

Added config_screenBrightnessDark to configure the minimum value
that will be used for auto-brightness adjustment. This value is
expected to be less than unadjusted minimum auto-brightness level
to provide some range for the user to make the screen dimmer
in dark rooms.

This configuration value is set to the lowest possible level
by default (1). Individual devices may need to override this value
in their framework resource overlay depending on their backlight
characteristics.

Change-Id: I9bd3a2355c65f894dff89aeaf7661cdf38f4a6ee
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
0c9a62dc8db7b39d5236aba70f14d4e99d38a194 20-Aug-2014 Michael Lentine <mlentine@google.com> Reduce shutdown animation duration.

Change-Id: Idb58e8ff9a7e05c6f3d6964970b32a6aa69615c1
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
3edf5272fb2185403dfe64b9722b9fc9b9de80f8 15-Aug-2014 Jeff Brown <jeffbrown@google.com> Add trace tag for power management.

Instrumented the basic power manager state transitions,
calling into the Power HAL, setting the display power mode,
and setting the backlight.

Bug: 17004602
Change-Id: I4e362162ddfd7292a7eea8b5d029ce3f6593c4a9
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
0839adb25c6d1a9f4e06fc5a098ffd03c67dbe99 30-Jul-2014 Michael Lentine <mlentine@google.com> New screen shut down animation.

Bug: 16845774

Change-Id: I355f8d73f54a873f6df180dc48c177b993f170f9
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
5c8ea084e609ecce17a038eb6b09fe118a81d700 25-Jul-2014 Jeff Brown <jeffbrown@google.com> Minor tweak to screen dimming policy.

Avoid accidentally raising the brightness above the normal minimum
if for some reason we already decided it should be less.

Change-Id: Ib47385287be3ef8719c25148575b1f59589add8c
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
970d4132ea28e748c1010be39450a98bbf7466f3 19-Jul-2014 Jeff Brown <jeffbrown@google.com> Allow dreams to control screen state and brightness.

Added setDozeScreenState() and setDozeScreenBrightness() methods to
DreamService. The values specified here only take effect once
startDozing is called and can be changed while dozing.

This required some significant rework of the display power controller
but the result seems quite nice and better represents the policy
we want to apply.

Changed the test dream a little bit to make it flash the screen
every minute using the new functions.

Bug: 15903322
Change-Id: I83bcc34503f1b87727d2b2b3c0ef08507f9f0808
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
5dc219142a756d57355b511c8f8ab913c01710da 18-Jul-2014 Jeff Brown <jeffbrown@google.com> Add new Display.STATE_DOZE_SUSPEND power state.

Change-Id: Ia62f4f0d25234281dc600d0b7f08b3c6a312db7a
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
6a5cacb8683ddd78fc78f01ef726f410bf4e0479 28-May-2014 Prashant Malani <pmalani@google.com> Change display state modification during dozing

Check that the BrightnessRamp animation has completed before updating
the display state to STATE_DOZING.

Bug: 13472578
Change-Id: Ib9751f7a987463e4df98571e846d829ec8e73b5e
Signed-off-by: Prashant Malani <pmalani@google.com>
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
4bfcae9a3f3f1e225bed08b0a7c09ebf293d6c87 21-May-2014 Jeff Brown <jeffbrown@google.com> am 77669abb: am 9beccf9f: Merge "Defer display ready until brightness ramp completes." into klp-modular-dev

* commit '77669abb8300b672700418216939b9253dc98bee':
Defer display ready until brightness ramp completes.
4255869ac00e700395832ee73b2294603d4b6ece 21-May-2014 Jeff Brown <jeffbrown@google.com> Defer display ready until brightness ramp completes.

Bug: 14494096
Change-Id: I6da6fffbbce2c7058170e5c6139eae4cb5a06d88
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
6da87ab684f104baa836138ca5153eb2d6c1f929 16-May-2014 Adrian Roos <roosa@google.com> Speed up brightness transition if auto brightness adjustment is changed

Bug: 15019366
Change-Id: Id6e18f6b74d801bc8e87ba84c0948bbbabda368b
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
f974cc870635227ae13201480fb2f019d153af22 01-May-2014 Ruchi Kandoi <kandoiruchi@google.com> Display: Brightness: Low power mode scales the brightness to 50 percent.

When the device is in low power mode all changes to brightness will be
scaled to half of the brightness that would be normally set when not in
low power mode.

Change-Id: I03be820ef64c1d5631ded35f7dfc2799e807226b
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
e95c3cd89591ba586aa8a0f7a17660c6fb8770bc 03-May-2014 Jeff Brown <jeffbrown@google.com> Plumb display state and interactive information to BatteryStats.

Fixes an issue where dozing was treated the same as the screen
being fully on. Now dozing is treated the same as the screen
being fully off which is slightly better. The decision of how
to represent this state is now internal to the battery stats
so it can be improved later.

Removed noteInputEvent() since it is unused.

Bug: 14480844
Change-Id: Iee8cf8dce1a1f91c62678bb6d3d9fe567ad6db42
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
01ee6f6cf7de9fb98fc3a88509b43416caa71040 03-May-2014 Jeff Brown <jeffbrown@google.com> Plumb display state and interactive information to BatteryStats. (DO NOT MERGE)

Fixes an issue where dozing was treated the same as the screen
being fully on. Now dozing is treated the same as the screen
being fully off which is slightly better. The decision of how
to represent this state is now internal to the battery stats
so it can be improved later.

Removed noteInputEvent() since it is unused.

Bug: 14480844
Change-Id: Iee8cf8dce1a1f91c62678bb6d3d9fe567ad6db42
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
26c6a50f037c6af9c41b3f96269fe194748605ce 11-Apr-2014 Jeff Brown <jeffbrown@google.com> Rename isScreenOn() to isInteractive().

Fix build break due to an earlier merge.

Change-Id: I6e6583b251da9e027a4ade45cb4bb77e9d4ee624
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
4e5c089ef3e62e7f658e71c0be262d09bd3e399b 11-Apr-2014 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 337e764d to master

Change-Id: I8168dbf42b68c2f7b5ccb300e0080dddc627af26
037c33eae74bee2774897d969d48947f9abe254f 09-Apr-2014 Jeff Brown <jeffbrown@google.com> Plumb display power state through display manager.

Declare a new method, Display.getState() to retrieve the actual
power state of a display.

Improved documentation for Intent.ACTION_SCREEN_ON and
Intent.ACTION_SCREEN_OFF to clarify what they really mean in
terms of the interactive state of the device.

Deprecated PowerManager.isScreenOn() and replaced it with
PowerManager.isInteractive() with a more suggestive name and
better documentation.

Redirect display power state changes to go through the display
manager first and only then head over to the power manager for
legacy compatibility.

Eliminated the bright here and woke here policy flags since they
were unused. Simplified the input dispatch policy somewhat.

Ensure that screen wake locks are respected up until the point
when dozing really begins.

Fixed a regression in DreamService where onDreamingStarted
might be called before onWindowAttached.

Bug: 13133142
Bug: 13472578
Bug: 13929355
Bug: 13760290
Change-Id: Iabef96921dd554ce3768fb18619cefc3230b5fb0
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
131206b8a9d07400d7c98aea50cc45c38769448f 09-Apr-2014 Jeff Brown <jeffbrown@google.com> Move display power controller to display manager service.

This refactoring is in preparation for enabling the display manager
to have more control over the blanking state of individual displays.
There are no functional changes. Some bits will be cleaned up in
a subsequent patch.

Bug: 13133142
Change-Id: I159a060088344d8e6fcdf9208a1f242960f7ab90
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
ad9ef191f50767d8d5b6f0fbd4b59bb1400dcd25 09-Apr-2014 Jeff Brown <jeffbrown@google.com> Move display power controller to display manager service. (DO NOT MERGE)

This refactoring is in preparation for enabling the display manager
to have more control over the blanking state of individual displays.
There are no functional changes. Some bits will be cleaned up in
a subsequent patch.

Bug: 13133142
Change-Id: Ib811835e8757449c7899ac61807029baaf998161
/frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java