Merge "Fix power manager issues." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d672b241f6
@@ -2285,6 +2285,10 @@ public class PowerManagerService extends IPowerManager.Stub
|
|||||||
|
|
||||||
public void animateTo(int target, int sensorTarget, int mask, int animationDuration) {
|
public void animateTo(int target, int sensorTarget, int mask, int animationDuration) {
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
|
if (isAnimating() && (mask ^ currentMask) != 0) {
|
||||||
|
// current animation is unrelated to new animation, jump to final values
|
||||||
|
cancelAnimation();
|
||||||
|
}
|
||||||
startValue = currentValue;
|
startValue = currentValue;
|
||||||
endValue = target;
|
endValue = target;
|
||||||
startSensorValue = mHighestLightSensorValue;
|
startSensorValue = mHighestLightSensorValue;
|
||||||
@@ -2409,7 +2413,8 @@ public class PowerManagerService extends IPowerManager.Stub
|
|||||||
|
|
||||||
private boolean isScreenTurningOffLocked() {
|
private boolean isScreenTurningOffLocked() {
|
||||||
return (mScreenBrightnessAnimator.isAnimating()
|
return (mScreenBrightnessAnimator.isAnimating()
|
||||||
&& mScreenBrightnessAnimator.endValue == PowerManager.BRIGHTNESS_OFF);
|
&& mScreenBrightnessAnimator.endValue == PowerManager.BRIGHTNESS_OFF
|
||||||
|
&& (mScreenBrightnessAnimator.currentMask & SCREEN_BRIGHT_BIT) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldLog(long time) {
|
private boolean shouldLog(long time) {
|
||||||
|
|||||||
Reference in New Issue
Block a user