Loading packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java +7 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,13 @@ public class DozeScreenState implements DozeMachine.Part { * Delay entering low power mode when animating to make sure that we'll have * time to move all elements into their final positions while still at 60 fps. */ private static final int ENTER_DOZE_DELAY = 3000; private static final int ENTER_DOZE_DELAY = 6000; /** * Hide wallpaper earlier when entering low power mode. The gap between * hiding the wallpaper and changing the display mode is necessary to hide * the black frame that's inherent to hardware specs. */ public static final int ENTER_DOZE_HIDE_WALLPAPER_DELAY = 2000; private final DozeMachine.Service mDozeService; private final Handler mHandler; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java +3 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.internal.hardware.AmbientDisplayConfiguration; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.doze.AlwaysOnDisplayPolicy; import com.android.systemui.doze.DozeScreenState; import com.android.systemui.tuner.TunerService; import java.io.PrintWriter; Loading Loading @@ -153,7 +154,8 @@ public class DozeParameters implements TunerService.Tunable { * @return duration in millis. */ public long getWallpaperAodDuration() { return mAlwaysOnPolicy.wallpaperVisibilityDuration; return shouldControlScreenOff() ? DozeScreenState.ENTER_DOZE_HIDE_WALLPAPER_DELAY : mAlwaysOnPolicy.wallpaperVisibilityDuration; } /** Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.support.test.runner.AndroidJUnit4; import android.test.suitebuilder.annotation.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.doze.DozeScreenState; import com.android.systemui.statusbar.phone.DozeParameters.IntInOutMatcher; import org.junit.Assert; Loading Loading @@ -218,6 +219,15 @@ public class DozeParametersTest extends SysuiTestCase { verify(dozeParameters.getPowerManager()).setDozeAfterScreenOff(eq(false)); } @Test public void test_getWallpaperAodDuration_when_shouldControlScreenOff() { TestableDozeParameters dozeParameters = new TestableDozeParameters(getContext()); dozeParameters.setControlScreenOffAnimation(true); Assert.assertEquals("wallpaper hides faster when controlling screen off", dozeParameters.getWallpaperAodDuration(), DozeScreenState.ENTER_DOZE_HIDE_WALLPAPER_DELAY); } private class TestableDozeParameters extends DozeParameters { private PowerManager mPowerManager; Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java +7 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,13 @@ public class DozeScreenState implements DozeMachine.Part { * Delay entering low power mode when animating to make sure that we'll have * time to move all elements into their final positions while still at 60 fps. */ private static final int ENTER_DOZE_DELAY = 3000; private static final int ENTER_DOZE_DELAY = 6000; /** * Hide wallpaper earlier when entering low power mode. The gap between * hiding the wallpaper and changing the display mode is necessary to hide * the black frame that's inherent to hardware specs. */ public static final int ENTER_DOZE_HIDE_WALLPAPER_DELAY = 2000; private final DozeMachine.Service mDozeService; private final Handler mHandler; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java +3 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.internal.hardware.AmbientDisplayConfiguration; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.doze.AlwaysOnDisplayPolicy; import com.android.systemui.doze.DozeScreenState; import com.android.systemui.tuner.TunerService; import java.io.PrintWriter; Loading Loading @@ -153,7 +154,8 @@ public class DozeParameters implements TunerService.Tunable { * @return duration in millis. */ public long getWallpaperAodDuration() { return mAlwaysOnPolicy.wallpaperVisibilityDuration; return shouldControlScreenOff() ? DozeScreenState.ENTER_DOZE_HIDE_WALLPAPER_DELAY : mAlwaysOnPolicy.wallpaperVisibilityDuration; } /** Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.support.test.runner.AndroidJUnit4; import android.test.suitebuilder.annotation.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.doze.DozeScreenState; import com.android.systemui.statusbar.phone.DozeParameters.IntInOutMatcher; import org.junit.Assert; Loading Loading @@ -218,6 +219,15 @@ public class DozeParametersTest extends SysuiTestCase { verify(dozeParameters.getPowerManager()).setDozeAfterScreenOff(eq(false)); } @Test public void test_getWallpaperAodDuration_when_shouldControlScreenOff() { TestableDozeParameters dozeParameters = new TestableDozeParameters(getContext()); dozeParameters.setControlScreenOffAnimation(true); Assert.assertEquals("wallpaper hides faster when controlling screen off", dozeParameters.getWallpaperAodDuration(), DozeScreenState.ENTER_DOZE_HIDE_WALLPAPER_DELAY); } private class TestableDozeParameters extends DozeParameters { private PowerManager mPowerManager; Loading