History log of /frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
84bf070824139da825d5e9e74674ca4232ba6121 16-May-2018 Michael Wright <michaelwr@google.com> Merge "Generally improve brightness dumpsys." into pi-dev
2155bc2be3d38b876335eb06f08e81fc2d563831 01-May-2018 Michael Wright <michaelwr@google.com> Generally improve brightness dumpsys.

For the recent spate of autobrightness bugs, being able
to determine both current state of the display brightness and the
overall situational context of the device (e.g. ALS readings) is
critical to quick diagnosis. This tidies up the logs and adds some more
state information so we have more context about the situation the device
is in.

Bug: 78909876
Test: adb shell dumpsys display
Change-Id: I0e3cd5d00268b5b44f3d486fae8940d7d7d2ed2e
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
b8f4f77d9e12e125408b058bcbd505f4a0bdd50e 01-May-2018 Michael Wright <michaelwr@google.com> Reset auto-brightness on new BrightnessConfiguration

In theory, the newly pushed configuration should take into account all
of the brightness adjustments that the user has made throughout the day,
so applying any part of the short term model on top of that would be
effectively adjusting for them twice over. To avoid getting into this
state, we reset the short-term model.

Bug: 78910182
Test: Manual
Change-Id: I52121eac84eb8ceb914a94a95af2f174ab2f5b73
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
c135225466eb1b209e12c8c2df135641a21c5d66 27-Apr-2018 Dan Gittik <dangittik@google.com> Reset short term model on user switch.

Test: manual.

Change-Id: I96082673094eac111a9f4cf796dcd1e574c33f41
Fixes: 78214953
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
5878442bc6c23a1c1cd87a5fb1a2c241329835aa 05-Apr-2018 Dan Gittik <dangittik@google.com> Fixed auto-brightness when ALS malfunctions.

When the ALS is broken or misbehaving, auto-brightness might get
stuck in a state where it completely ignores user data points;
this fixes the issue, and reverts to manual brightness whenever
auto-brightness can't be used reliably.

Test: manual.

Change-Id: I5eb80b99dbf7cc25229dc217732515b2a4ac1b79
Fixes: 77280930
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
57d6f11d6ab5d409f3291923ea34f9be709925bc 27-Mar-2018 Dan Gittik <dangittik@google.com> Added gamma correction to autobrightness.

Moved the gamma correction determined by the brightness adjustment to the brightness mapping
strategy, and added a best-effort attempt to gamma correct the curve to meet user data points
before resorting to spline-bending.

Test: manual (see https://drive.google.com/file/d/1VH6LpnmFYTAdRB1Rh_tNmu7xQxEaKlqe/view?usp=sharing
for instructions).

Fixes: 72734580

Change-Id: I74063f262a5559c048280b6f1d04ac84b0004160
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
6d1009f882f1b0234e77ec3bb583a58090bfff39 14-Mar-2018 Kenny Guy <kennyguy@google.com> Get current and default brightness configs.

Getter System API to match existing setter for
the bightness configurations.
Getter System API to read the default brightness
configuration.

Bug: 74105596
Test: atest BrightnessTest

Change-Id: If0a0effad6a4ba6da2e5391dd6bde91dc04bad9c
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
c5d3291487d4b6a09cbeac222831bb1b2203d957 22-Feb-2018 Dan Gittik <dangittik@google.com> Add short term model reset threshold

Add a threshold to prevent user birghtness adjustments from reseting
without a drastic enough change in the ambient light, and some minor
refactoring

Test: manually adjust brightness; turn screen off for 30 seconds;
turn screen back on; brightness shouldn't change
Test: manually adjust brightness; turn screen off for 30 seconds;
cover light sensor; turn screen back on; brightness should change

Make short term model reset decision only happen once, and change its
threshold to be relative

Test: same as before

Minor refactoring

Test: same as before
Fixes: 72734580

Change-Id: I724e88ddb79a55cadb547463d73131028bb57825
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
53d0661f38d6ada39aefaac5ce016f802e74bd44 30-Jan-2018 Kenny Guy <kennyguy@google.com> Add information about brightness config to slider events.

Whether the config is using the default curve.
Whether the config has a user data point.
Whether the config has a power save offset.

Bug: 72482479
Test: atest BrightnessTrackerTest
Change-Id: I137a919ae2604244b0b2f78e00e31b7a72df4967
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
617564ff2cdee2e9a50339544129283503ae71a8 25-Jan-2018 Michael Wright <michaelwr@google.com> Reset brightness adjustment when user sets brightness directly.

If the user has a non-zero brightness adjustment then short-term model
returns an incorrect value after they make a direct change to the
brightness with auto-brightness on, which then looks like the
auto-brightness is ignoring their input. To avoid this , if they're
making a direct change to auto-brightness go ahead and reset the
brightness adjustment.

Change-Id: I257a6ecc7ca3df0e610710df19d81a65b009af45
Fixes: 72506596
Test: manual
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
d846023804ddadcd692666152db420c54594ddb9 16-Jan-2018 Michael Wright <michaelwr@google.com> Slider always represents absolute brightness

Currently the slider represents a gamma adjustment to the brightness
curve when auto brightness is enabled and the absolute screen brightness
when it's not. This is a fairly confusing behavior to most people, so
this consolidates them to a single behavior: the slider always
represents the current brightness and auto-brightness will automatically
adjust it.

This also moves a bunch of the brightness methods from PowerManager over
to DisplayManager, since it's really the DisplayPowerController that's
responsible for determining and setting the display brightness.

Test: atest com.android.server.display.BrightnessMappingStrategyTest
Bug: 69406898
Change-Id: I73b5982809a94cd50d563426a72d7965e923c994
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
eef0e13f018f33bf3db2f8311bbb429369e13394 21-Nov-2017 Michael Wright <michaelwr@google.com> Add an API for setting a new brightness curve.

In addition, this also provides multiple strategies for mapping from
ambient room brightness in lux to display brightness. The default one is
the classic strategy, where we map directly from lux to backlight
brightness in an arbitrary unit. The newer and preferred strategy is to
use the physical brightness of the display, but requires that the
brightness properties of the display are appropriately configured.

Bug: 69406783
Test: atest com.android.server.display.BrightnessMappingStrategyTest &&
atest android.hardware.display.BrightnessConfigurationTest &&
atest android.hardware.display.PersistentDataStoreTeset

Change-Id: I60227bdb6c299d0fa92686cbf3e5994b336a3a79
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
b0a1d3d08fc459e0d9937e299e16de17d1388ac4 22-Sep-2017 Michael Wright <michaelwr@google.com> Skip brightness ramp if ColorFade is covering the screen content.

Also, add more tracing so it's easier to investigate auto-brightness
issues.

Test: trace wake-up, see us immediately transition to new brightness
instead of ramping for several seconds

Change-Id: I58e244ede3c51b5586c381a2e179fff20ef6d3d6
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
0a933141e2dd72bc868598cfa2146b2c72b85d5d 16-Aug-2017 Michael Wright <michaelwr@google.com> Add new "fast" filter for ambient light.

The slow filter wasn't converging fast enough when we shortened the
debounce timings but we still want it to ensure there's a long term
change happening, so add a new filter that converges much faster. This
new fast filter is just a weighted sliding window just like the slow
filter, but it has a significantly smaller horizon.

Bug: 64514692
Test: manual
Change-Id: I1e990ac1e6a56268fa42a85399a2d41cc8dd2104
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
a8edffd804d3940dec1fa5c9777d10beccb2f6a6 23-Mar-2017 Soroosh Mariooryad <soroosh@google.com> Fixing auto-brightness logs:

- Previously old values of were set after update of new, resulting in
losing the correct old values.

Test: manual

Change-Id: Ie94c89df7d6fcb19da3da10774810d2d17ba5270
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
5483cea67a60d3c5012fa7120f62e6eacc6ad3ba 02-Feb-2017 Justin Klaassen <justinklaassen@google.com> Remove experimental twilight-based automatic brightness

Bug: 31602449
Test: verified adaptive brightness no longer varies with twilight with
"brightness_use_twilight" set to "1".

Change-Id: I6b5f7310020b2128c2b292414a205b6052270a0a
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
5d7170963ac0cfa30400292841c3673b8cdea5b5 25-Oct-2016 Julius D'souza <jdsouza@google.com> Add initial ambient light sensor rate

Bug: 32153559
Test: Existing tests pass.

Change-Id: Ic54bded46f88991290ed1e4d2574f865b6f598ec
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
428aed01e1e2923968027dff57132d8d8d5c4905 08-Aug-2016 Julius D'souza <jdsouza@google.com> Add dynamic illuminance hysteresis support

Bug: 18572096

Change-Id: Ie0ff1990b8f4a3d435328834871f04a6e2bd5e97
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
908b86c796443ba4ec55c669e8a0297fc80574a6 08-Aug-2016 Justin Klaassen <justinklaassen@google.com> TwilightService v2.0

- Switched to using CalendarAstronomer for more accurate sunrise/sunset
times.
- Exposed sunrise/sunset times via TwilightState so that clients can
track the current twilight period and perform their own
interpolations.
- Adopted LocationRequest API for fused location updates:
(low power, min 1h, max 10m).
- TwilightService is now only activated when a listener is registered,
minimizing impact to system health on platforms / configurations
where twilight state is not needed.

Bug: 28588307
Bug: 30190450
Bug: 30282370
Bug: 30650316
Change-Id: Ic5c94d8608e8bb3a3d895e623676a1468d4abdcd
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
103fb78ac1b91874f8b90cc5a165e6f0502179c4 22-Apr-2016 Michael Wright <michaelwr@google.com> Add ambient light ring buffer for initial data gathering period.

We're seeing reports of the display being too dim at initial wake up.
Saving the buffer for this initial period lets determine whether this
is a calculation error or something wrong with the sensor readings.

Bug: 27951906
Change-Id: I96b5dd0772de056c3c5e54d59c13d1a3d902d343
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
5dbd4aad809e6fec51df62280bcc1bfe05cc7df5 07-Feb-2016 Jason Monk <jmonk@google.com> SysUI Tuner: Night mode v3

TwilightService:
- Add support for locking on/off twilight globally
- Change twilight state to have float amount rather than
having clients calculate it using the sunrise/set values
- State controlled through secure setting
- Override mode which locks to a state for a couple hours then
resets
- Add broadcast for SysUI to listen to

Brightness/Power:
- Updates to handle TwilightService changes
- Added secure setting to control whether or not to use
twilight when calculating brightness.

Tuner:
- UI Overhall
- NightModeController will set the values of the custom color matrix
taking into account the current twilight service state and any
custom calibration set by the user.
- Probably other stuff.

Change-Id: I213f1f76a143e711c507b2ba7d784f581bfc32b4
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
6fc42f549a6a67fe48e6e8e368dc2b164030d7c3 10-Dec-2015 Zoran Jovanovic <zoran.jovanovic@sonymobile.com> Customize auto-brightness parameters

Auto-brightness parameters are device dependent so they should be
configurable.

The common issue with original values manifests as the screen being
perceived as too bright in dark rooms with minimum brightness and
also laginess on backlight change.

Change-Id: I2b040608bca73a3397c65c24d3b28a1514499ae6
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
a576b4d3be8687f0a65fc5777424955d551604e4 24-Apr-2015 Jeff Brown <jeffbrown@google.com> Add code to collect data about auto-brightness adjustments.

Write samples of the old and new state to the binary event log whenever
the user modifies the auto-brightness adjustment. We wait a few seconds
before logging to ensure that the user is satisfied with the adjustment.

Bug: 19786916
Change-Id: I41402decd1034d0839aa0f47495bc00907ab9c08
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
d81ecd12cec5e1efa8ca49036bb023746f63d90a 06-Feb-2015 Filip Gruszczynski <gruszczy@google.com> Support for faster brightness response to light changes.

Bug: 18572096

Change-Id: Ic9448db672b036779d16883f3476249cea45d97a
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.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/AutomaticBrightnessController.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/AutomaticBrightnessController.java
6dee605c834fe4926cc1ae5c584563bdb2b608a1 14-May-2014 Adrian Roos <roosa@google.com> Fix adaptive auto brightness bugs

Fix update of the light sensor in AutoBrightnessController.
Register observer for Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ.

Change-Id: I5201259c4efc0afa200fea3ad9fe3af2991d8676
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java
daf7d410fc97647f2b3ab4254f73c09c923018de 13-May-2014 Adrian Roos <roosa@google.com> A better auto brightness

Bug: 14927472
Change-Id: I62d0695b7da16ffa7a27c465c3b6bc4b1515f9c0
/frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.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/AutomaticBrightnessController.java