Skip to content

Commit a4e96d5

Browse files
author
Craig Mautner
committed
Disable automatic screen dimming.
Done by setting the dimming period to Integer.MAX_VALUE. While it doesn't technically disable dimming it will take 248 days to get to any target value. Fixes bug 6616423. Change-Id: I5b753286b9d93664fbff79021be38adf4d8a007d
1 parent b215726 commit a4e96d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/java/com/android/server/PowerManagerService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ public class PowerManagerService extends IPowerManager.Stub
178178
static final int ANIM_STEPS = 60; // nominal # of frames at 60Hz
179179
// Slower animation for autobrightness changes
180180
static final int AUTOBRIGHTNESS_ANIM_STEPS = 2 * ANIM_STEPS;
181-
// Even slower animation for autodimness changes
182-
static final int AUTODIMNESS_ANIM_STEPS = 15 * ANIM_STEPS;
181+
// Even slower animation for autodimness changes. Set to max to effectively disable dimming.
182+
// Note 100 is used to keep the mWindowScaleAnimation scaling below from overflowing an int.
183+
static final int AUTODIMNESS_ANIM_STEPS = Integer.MAX_VALUE / (NOMINAL_FRAME_TIME_MS * 100);
183184
// Number of steps when performing a more immediate brightness change.
184185
static final int IMMEDIATE_ANIM_STEPS = 4;
185186

0 commit comments

Comments
 (0)