am 7fa61063: am f836acf2: Merge change I067d55ea into eclair

Merge commit '7fa610638b09f2a4a29d7df1b16d2fe686b5e5e6' into eclair-mr2-plus-aosp

* commit '7fa610638b09f2a4a29d7df1b16d2fe686b5e5e6':
  Fix issue #2179931: Power key to wake up frequently ignored when in dock app
This commit is contained in:
Dianne Hackborn
2009-10-12 11:21:04 -07:00
committed by Android Git Automerger

View File

@@ -1531,9 +1531,10 @@ class PowerManagerService extends IPowerManager.Stub
} finally { } finally {
Binder.restoreCallingIdentity(identity); Binder.restoreCallingIdentity(identity);
} }
mScreenBrightness.setTargetLocked(brightness, if (mScreenBrightness.setTargetLocked(brightness,
steps, INITIAL_SCREEN_BRIGHTNESS, nominalCurrentValue); steps, INITIAL_SCREEN_BRIGHTNESS, nominalCurrentValue)) {
startAnimation = true; startAnimation = true;
}
} else { } else {
if ((newState & SCREEN_BRIGHT_BIT) == 0) { if ((newState & SCREEN_BRIGHT_BIT) == 0) {
// dim or turn off backlight, depending on if the screen is on // dim or turn off backlight, depending on if the screen is on
@@ -1612,11 +1613,13 @@ class PowerManagerService extends IPowerManager.Stub
+ " delta=" + delta); + " delta=" + delta);
} }
void setTargetLocked(int target, int stepsToTarget, int initialValue, boolean setTargetLocked(int target, int stepsToTarget, int initialValue,
int nominalCurrentValue) { int nominalCurrentValue) {
if (!initialized) { if (!initialized) {
initialized = true; initialized = true;
curValue = (float)initialValue; curValue = (float)initialValue;
} else if (targetValue == target) {
return false;
} }
targetValue = target; targetValue = target;
delta = (targetValue - delta = (targetValue -
@@ -1630,6 +1633,7 @@ class PowerManagerService extends IPowerManager.Stub
+ noticeMe); + noticeMe);
} }
animating = true; animating = true;
return true;
} }
boolean stepLocked() { boolean stepLocked() {