am fed7a99a: Merge "Quick fix for bug 5646217 blocking automation tests" into ics-mr1

* commit 'fed7a99a5294856d930e18225898828bd6755be1':
  Quick fix for bug 5646217 blocking automation tests
This commit is contained in:
Daniel Sandler
2011-11-29 05:51:18 -08:00
committed by Android Git Automerger

View File

@@ -3465,6 +3465,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (localLOGV) Log.v(TAG, "mScreenSaverActivator: not running screen saver when not plugged in");
return;
}
// Quick fix for automation tests.
// The correct fix is to move this triggering logic to PowerManager, where more complete
// information about wakelocks (including StayOnWhilePluggedIn) is available.
if (Settings.System.getInt(mContext.getContentResolver(),
Settings.System.STAY_ON_WHILE_PLUGGED_IN,
BatteryManager.BATTERY_PLUGGED_AC) != 0) {
Log.v(TAG, "mScreenSaverActivator: not running screen saver when STAY_ON_WHILE_PLUGGED_IN");
return;
}
if (localLOGV) Log.v(TAG, "mScreenSaverActivator entering dreamland");