Skip to content

Commit fed7a99

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
Merge "Quick fix for bug 5646217 blocking automation tests" into ics-mr1
2 parents 4e5d3f2 + 7d46c61 commit fed7a99

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,6 +3465,15 @@ public void run() {
34653465
if (localLOGV) Log.v(TAG, "mScreenSaverActivator: not running screen saver when not plugged in");
34663466
return;
34673467
}
3468+
// Quick fix for automation tests.
3469+
// The correct fix is to move this triggering logic to PowerManager, where more complete
3470+
// information about wakelocks (including StayOnWhilePluggedIn) is available.
3471+
if (Settings.System.getInt(mContext.getContentResolver(),
3472+
Settings.System.STAY_ON_WHILE_PLUGGED_IN,
3473+
BatteryManager.BATTERY_PLUGGED_AC) != 0) {
3474+
Log.v(TAG, "mScreenSaverActivator: not running screen saver when STAY_ON_WHILE_PLUGGED_IN");
3475+
return;
3476+
}
34683477

34693478
if (localLOGV) Log.v(TAG, "mScreenSaverActivator entering dreamland");
34703479

0 commit comments

Comments
 (0)