Delay setting initial screen brightness until after the sensors are initialized.

Some devices will not activate the light sensor properly on boot
unless we do this.

Change-Id: Ia27b6fc2d515c31eb8597e1d52127d70e2643bd7
BUG: 2269307

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2010-03-04 08:02:44 -05:00
parent 01f4385d86
commit b42ab0f41c

View File

@@ -557,14 +557,6 @@ class PowerManagerService extends IPowerManager.Stub
});
updateSettingsValues();
if (mUseSoftwareAutoBrightness) {
// turn the screen on
setPowerState(SCREEN_BRIGHT);
} else {
// turn everything on
setPowerState(ALL_BRIGHT);
}
synchronized (mHandlerThread) {
mInitComplete = true;
mHandlerThread.notifyAll();
@@ -2486,9 +2478,21 @@ class PowerManagerService extends IPowerManager.Stub
enableLightSensor(true);
}
// wait until sensors are enabled before turning on screen.
// some devices will not activate the light sensor properly on boot
// unless we do this.
if (mUseSoftwareAutoBrightness) {
// turn the screen on
setPowerState(SCREEN_BRIGHT);
} else {
// turn everything on
setPowerState(ALL_BRIGHT);
}
synchronized (mLocks) {
Slog.d(TAG, "system ready!");
mDoneBooting = true;
long identity = Binder.clearCallingIdentity();
try {
mBatteryStats.noteScreenBrightness(getPreferredBrightness());