Loading services/java/com/android/server/PowerManagerService.java +30 −19 Original line number Diff line number Diff line Loading @@ -1373,8 +1373,9 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage } private void updateLightsLocked(int newState, int forceState) { int oldState = mPowerState; int difference = (newState ^ oldState) | forceState; final int oldState = mPowerState; final int realDifference = (newState ^ oldState); final int difference = realDifference | forceState; if (difference == 0) { return; } Loading Loading @@ -1430,7 +1431,13 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage if ((difference & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0) { if (ANIMATE_SCREEN_LIGHTS) { int nominalCurrentValue; int nominalCurrentValue = -1; // If there was an actual difference in the light state, then // figure out the "ideal" current value based on the previous // state. Otherwise, this is a change due to the brightness // override, so we want to animate from whatever the current // value is. if ((realDifference & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0) { switch (oldState & (SCREEN_BRIGHT_BIT|SCREEN_ON_BIT)) { case SCREEN_BRIGHT_BIT | SCREEN_ON_BIT: nominalCurrentValue = preferredBrightness; Loading @@ -1447,6 +1454,7 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage nominalCurrentValue = (int)mScreenBrightness.curValue; break; } } if ((newState & SCREEN_BRIGHT_BIT) == 0) { // dim or turn off backlight, depending on if the screen is on // the scale is because the brightness ramp isn't linear and this biases Loading Loading @@ -1575,7 +1583,9 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage curValue = (float)initialValue; } targetValue = target; delta = (targetValue-nominalCurrentValue) / stepsToTarget; delta = (targetValue - (nominalCurrentValue >= 0 ? nominalCurrentValue : curValue)) / stepsToTarget; if (mSpew) { String noticeMe = nominalCurrentValue == curValue ? "" : " ******************"; Log.i(TAG, "Setting target " + mask + ": cur=" + curValue Loading @@ -1596,6 +1606,7 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage int curIntValue = (int)curValue; boolean more = true; if (delta == 0) { curValue = curIntValue = targetValue; more = false; } else if (delta > 0) { if (curIntValue >= targetValue) { Loading services/java/com/android/server/WindowManagerService.java +8 −1 Original line number Diff line number Diff line Loading @@ -7799,6 +7799,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo boolean blurring = false; boolean dimming = false; boolean covered = false; boolean syswin = false; for (i=N-1; i>=0; i--) { WindowState w = (WindowState)mWindows.get(i); Loading Loading @@ -8058,9 +8059,15 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo if ((attrFlags&FLAG_KEEP_SCREEN_ON) != 0) { holdScreen = w.mSession; } if (w.mAttrs.screenBrightness >= 0 && screenBrightness < 0) { if (!syswin && w.mAttrs.screenBrightness >= 0 && screenBrightness < 0) { screenBrightness = w.mAttrs.screenBrightness; } if (attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG || attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD || attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_ERROR) { syswin = true; } } if (w.isFullscreenOpaque(dw, dh)) { // This window completely covers everything behind it, Loading Loading
services/java/com/android/server/PowerManagerService.java +30 −19 Original line number Diff line number Diff line Loading @@ -1373,8 +1373,9 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage } private void updateLightsLocked(int newState, int forceState) { int oldState = mPowerState; int difference = (newState ^ oldState) | forceState; final int oldState = mPowerState; final int realDifference = (newState ^ oldState); final int difference = realDifference | forceState; if (difference == 0) { return; } Loading Loading @@ -1430,7 +1431,13 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage if ((difference & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0) { if (ANIMATE_SCREEN_LIGHTS) { int nominalCurrentValue; int nominalCurrentValue = -1; // If there was an actual difference in the light state, then // figure out the "ideal" current value based on the previous // state. Otherwise, this is a change due to the brightness // override, so we want to animate from whatever the current // value is. if ((realDifference & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0) { switch (oldState & (SCREEN_BRIGHT_BIT|SCREEN_ON_BIT)) { case SCREEN_BRIGHT_BIT | SCREEN_ON_BIT: nominalCurrentValue = preferredBrightness; Loading @@ -1447,6 +1454,7 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage nominalCurrentValue = (int)mScreenBrightness.curValue; break; } } if ((newState & SCREEN_BRIGHT_BIT) == 0) { // dim or turn off backlight, depending on if the screen is on // the scale is because the brightness ramp isn't linear and this biases Loading Loading @@ -1575,7 +1583,9 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage curValue = (float)initialValue; } targetValue = target; delta = (targetValue-nominalCurrentValue) / stepsToTarget; delta = (targetValue - (nominalCurrentValue >= 0 ? nominalCurrentValue : curValue)) / stepsToTarget; if (mSpew) { String noticeMe = nominalCurrentValue == curValue ? "" : " ******************"; Log.i(TAG, "Setting target " + mask + ": cur=" + curValue Loading @@ -1596,6 +1606,7 @@ class PowerManagerService extends IPowerManager.Stub implements LocalPowerManage int curIntValue = (int)curValue; boolean more = true; if (delta == 0) { curValue = curIntValue = targetValue; more = false; } else if (delta > 0) { if (curIntValue >= targetValue) { Loading
services/java/com/android/server/WindowManagerService.java +8 −1 Original line number Diff line number Diff line Loading @@ -7799,6 +7799,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo boolean blurring = false; boolean dimming = false; boolean covered = false; boolean syswin = false; for (i=N-1; i>=0; i--) { WindowState w = (WindowState)mWindows.get(i); Loading Loading @@ -8058,9 +8059,15 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo if ((attrFlags&FLAG_KEEP_SCREEN_ON) != 0) { holdScreen = w.mSession; } if (w.mAttrs.screenBrightness >= 0 && screenBrightness < 0) { if (!syswin && w.mAttrs.screenBrightness >= 0 && screenBrightness < 0) { screenBrightness = w.mAttrs.screenBrightness; } if (attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG || attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD || attrs.type == WindowManager.LayoutParams.TYPE_SYSTEM_ERROR) { syswin = true; } } if (w.isFullscreenOpaque(dw, dh)) { // This window completely covers everything behind it, Loading