Add a mechanism to adjust auto-brightness at night.

Uses the twilight service to determine the hours of
sunrise and sunset.  Shortly after sunset or before sunrise
gradually start to apply a gamma correction factor to the
auto-brightness calculations to make the screen a little
dimmer at night.

The effect is relatively small and is mostly noticeable
in dark rooms.  This is just a first pass at the algorithm,
we can tweak the adjustment later to ensure that it has even less
impact in moderate or bright environments.

Change-Id: Idf89022a5d0bb52975e04779352d53fa63371178
This commit is contained in:
Jeff Brown
2012-08-21 22:14:26 -07:00
parent 2416e09649
commit aa202a6dc3
3 changed files with 90 additions and 5 deletions

View File

@ -741,7 +741,12 @@ class ServerThread extends Thread {
w.getDefaultDisplay().getMetrics(metrics);
context.getResources().updateConfiguration(config, metrics);
power.systemReady();
try {
power.systemReady(twilight);
} catch (Throwable e) {
reportWtf("making Power Manager Service ready", e);
}
try {
pm.systemReady();
} catch (Throwable e) {