am e02c88af: Work on process management.

* commit 'e02c88af7935c72fb90a478375e61e4a94465587':
  Work on process management.
This commit is contained in:
Dianne Hackborn
2011-10-31 12:26:15 +00:00
committed by Android Git Automerger
6 changed files with 102 additions and 81 deletions

View File

@ -2193,25 +2193,21 @@ public class PowerManagerService extends IPowerManager.Stub
}
public void run() {
if (mAnimateScreenLights) {
synchronized (mLocks) {
synchronized (mLocks) {
// we're turning off
final boolean turningOff = animating && targetValue == Power.BRIGHTNESS_OFF;
if (mAnimateScreenLights || !turningOff) {
long now = SystemClock.uptimeMillis();
boolean more = mScreenBrightness.stepLocked();
if (more) {
mScreenOffHandler.postAtTime(this, now+(1000/60));
}
}
} else {
synchronized (mLocks) {
// we're turning off
final boolean animate = animating && targetValue == Power.BRIGHTNESS_OFF;
if (animate) {
// It's pretty scary to hold mLocks for this long, and we should
// redesign this, but it works for now.
nativeStartSurfaceFlingerAnimation(
mScreenOffReason == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR
? 0 : mAnimationSetting);
}
} else {
// It's pretty scary to hold mLocks for this long, and we should
// redesign this, but it works for now.
nativeStartSurfaceFlingerAnimation(
mScreenOffReason == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR
? 0 : mAnimationSetting);
mScreenBrightness.jumpToTargetLocked();
}
}