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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user