Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4109,6 +4109,7 @@ package android.os { } public final class PowerManager { method public void dream(long); method public int getPowerSaveMode(); method public boolean setDynamicPowerSavings(boolean, int); method public boolean setPowerSaveMode(boolean); Loading core/java/android/os/PowerManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.service.dreams.Sandman; import android.util.Log; import android.util.proto.ProtoOutputStream; Loading Loading @@ -1000,6 +1001,29 @@ public final class PowerManager { } } /** * Requests the device to start dreaming. * <p> * If dream can not be started, for example if another {@link PowerManager} transition is in * progress, does nothing. Unlike {@link #nap(long)}, this does not put device to sleep when * dream ends. * </p><p> * Requires the {@link android.Manifest.permission#WRITE_DREAM_STATE} permission. * </p> * * @param time The time when the request to nap was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp may be used to correctly * order the dream request with other power management functions. It should be set * to the timestamp of the input event that caused the request to dream. * * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void dream(long time) { Sandman.startDreamByUserRequest(mContext); } /** * Boosts the brightness of the screen to maximum for a predetermined * period of time. This is used to make the screen more readable in bright Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4109,6 +4109,7 @@ package android.os { } public final class PowerManager { method public void dream(long); method public int getPowerSaveMode(); method public boolean setDynamicPowerSavings(boolean, int); method public boolean setPowerSaveMode(boolean); Loading
core/java/android/os/PowerManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.service.dreams.Sandman; import android.util.Log; import android.util.proto.ProtoOutputStream; Loading Loading @@ -1000,6 +1001,29 @@ public final class PowerManager { } } /** * Requests the device to start dreaming. * <p> * If dream can not be started, for example if another {@link PowerManager} transition is in * progress, does nothing. Unlike {@link #nap(long)}, this does not put device to sleep when * dream ends. * </p><p> * Requires the {@link android.Manifest.permission#WRITE_DREAM_STATE} permission. * </p> * * @param time The time when the request to nap was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp may be used to correctly * order the dream request with other power management functions. It should be set * to the timestamp of the input event that caused the request to dream. * * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void dream(long time) { Sandman.startDreamByUserRequest(mContext); } /** * Boosts the brightness of the screen to maximum for a predetermined * period of time. This is used to make the screen more readable in bright Loading