Loading core/java/android/os/IPowerManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ interface IPowerManager void userActivity(long time, int event, int flags); void wakeUp(long time); void goToSleep(long time, int reason); void nap(long time); boolean isScreenOn(); void reboot(String reason); Loading core/java/android/os/PowerManager.java +31 −3 Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ public final class PowerManager { * </p> * * @param when The time of the user activity, in the {@link SystemClock#uptimeMillis()} * time base. This timestamp is used to correctly order the user activity with * time base. This timestamp is used to correctly order the user activity request with * other power management functions. It should be set * to the timestamp of the input event that caused the user activity. * @param noChangeLights If true, does not cause the keyboard backlight to turn on Loading Loading @@ -457,7 +457,7 @@ public final class PowerManager { * * @param time The time when the request to go to sleep was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the user activity with other power management functions. It should be set * order the go to sleep request with other power management functions. It should be set * to the timestamp of the input event that caused the request to go to sleep. * * @see #userActivity Loading @@ -481,7 +481,7 @@ public final class PowerManager { * * @param time The time when the request to wake up was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the user activity with other power management functions. It should be set * order the wake up request with other power management functions. It should be set * to the timestamp of the input event that caused the request to wake up. * * @see #userActivity Loading @@ -494,6 +494,34 @@ public final class PowerManager { } } /** * Forces the device to start napping. * <p> * If the device is currently awake, starts dreaming, otherwise does nothing. * When the dream ends or if the dream cannot be started, the device will * either wake up or go to sleep depending on whether there has been recent * user activity. * </p><p> * Requires the {@link android.Manifest.permission#DEVICE_POWER} permission. * </p> * * @param time The time when the request to nap was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the nap request with other power management functions. It should be set * to the timestamp of the input event that caused the request to nap. * * @see #wakeUp * @see #goToSleep * * @hide */ public void nap(long time) { try { mService.nap(time); } catch (RemoteException e) { } } /** * Sets the brightness of the backlights (screen, keyboard, button). * <p> Loading core/java/android/service/dreams/Dream.java +8 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,12 @@ public class Dream extends Service implements Window.Callback { private final static boolean DEBUG = true; private final String TAG = Dream.class.getSimpleName() + "[" + getClass().getSimpleName() + "]"; /** * The name of the dream manager service. * @hide */ public static final String DREAM_SERVICE = "dreams"; /** * Used with {@link Intent#ACTION_MAIN} to declare the necessary intent-filter for a dream. * Loading Loading @@ -499,7 +505,7 @@ public class Dream extends Service implements Window.Callback { // end public api private void loadSandman() { mSandman = IDreamManager.Stub.asInterface(ServiceManager.getService("dreams")); mSandman = IDreamManager.Stub.asInterface(ServiceManager.getService(DREAM_SERVICE)); } private final void attach(IBinder windowToken) { Loading Loading @@ -584,7 +590,7 @@ public class Dream extends Service implements Window.Callback { mFinished = true; if (mSandman != null) { mSandman.awakenSelf(mWindowToken); mSandman.finishSelf(mWindowToken); } else { Slog.w(TAG, "No dream manager found"); } Loading core/java/android/service/dreams/IDreamManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -30,5 +30,5 @@ interface IDreamManager { ComponentName getDefaultDreamComponent(); void testDream(in ComponentName componentName); boolean isDreaming(); void awakenSelf(in IBinder token); void finishSelf(in IBinder token); } No newline at end of file packages/SystemUI/src/com/android/systemui/Somnambulator.java +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.Activity; import android.content.Intent; import android.os.RemoteException; import android.os.ServiceManager; import android.service.dreams.Dream; import android.service.dreams.IDreamManager; import android.util.Slog; Loading @@ -45,7 +46,7 @@ public class Somnambulator extends Activity { setResult(RESULT_OK, resultIntent); } else { IDreamManager somnambulist = IDreamManager.Stub.asInterface( ServiceManager.checkService("dreams")); ServiceManager.checkService(Dream.DREAM_SERVICE)); if (somnambulist != null) { try { Slog.v("Somnambulator", "Dreaming by user request."); Loading Loading
core/java/android/os/IPowerManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ interface IPowerManager void userActivity(long time, int event, int flags); void wakeUp(long time); void goToSleep(long time, int reason); void nap(long time); boolean isScreenOn(); void reboot(String reason); Loading
core/java/android/os/PowerManager.java +31 −3 Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ public final class PowerManager { * </p> * * @param when The time of the user activity, in the {@link SystemClock#uptimeMillis()} * time base. This timestamp is used to correctly order the user activity with * time base. This timestamp is used to correctly order the user activity request with * other power management functions. It should be set * to the timestamp of the input event that caused the user activity. * @param noChangeLights If true, does not cause the keyboard backlight to turn on Loading Loading @@ -457,7 +457,7 @@ public final class PowerManager { * * @param time The time when the request to go to sleep was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the user activity with other power management functions. It should be set * order the go to sleep request with other power management functions. It should be set * to the timestamp of the input event that caused the request to go to sleep. * * @see #userActivity Loading @@ -481,7 +481,7 @@ public final class PowerManager { * * @param time The time when the request to wake up was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the user activity with other power management functions. It should be set * order the wake up request with other power management functions. It should be set * to the timestamp of the input event that caused the request to wake up. * * @see #userActivity Loading @@ -494,6 +494,34 @@ public final class PowerManager { } } /** * Forces the device to start napping. * <p> * If the device is currently awake, starts dreaming, otherwise does nothing. * When the dream ends or if the dream cannot be started, the device will * either wake up or go to sleep depending on whether there has been recent * user activity. * </p><p> * Requires the {@link android.Manifest.permission#DEVICE_POWER} permission. * </p> * * @param time The time when the request to nap was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the nap request with other power management functions. It should be set * to the timestamp of the input event that caused the request to nap. * * @see #wakeUp * @see #goToSleep * * @hide */ public void nap(long time) { try { mService.nap(time); } catch (RemoteException e) { } } /** * Sets the brightness of the backlights (screen, keyboard, button). * <p> Loading
core/java/android/service/dreams/Dream.java +8 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,12 @@ public class Dream extends Service implements Window.Callback { private final static boolean DEBUG = true; private final String TAG = Dream.class.getSimpleName() + "[" + getClass().getSimpleName() + "]"; /** * The name of the dream manager service. * @hide */ public static final String DREAM_SERVICE = "dreams"; /** * Used with {@link Intent#ACTION_MAIN} to declare the necessary intent-filter for a dream. * Loading Loading @@ -499,7 +505,7 @@ public class Dream extends Service implements Window.Callback { // end public api private void loadSandman() { mSandman = IDreamManager.Stub.asInterface(ServiceManager.getService("dreams")); mSandman = IDreamManager.Stub.asInterface(ServiceManager.getService(DREAM_SERVICE)); } private final void attach(IBinder windowToken) { Loading Loading @@ -584,7 +590,7 @@ public class Dream extends Service implements Window.Callback { mFinished = true; if (mSandman != null) { mSandman.awakenSelf(mWindowToken); mSandman.finishSelf(mWindowToken); } else { Slog.w(TAG, "No dream manager found"); } Loading
core/java/android/service/dreams/IDreamManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -30,5 +30,5 @@ interface IDreamManager { ComponentName getDefaultDreamComponent(); void testDream(in ComponentName componentName); boolean isDreaming(); void awakenSelf(in IBinder token); void finishSelf(in IBinder token); } No newline at end of file
packages/SystemUI/src/com/android/systemui/Somnambulator.java +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.Activity; import android.content.Intent; import android.os.RemoteException; import android.os.ServiceManager; import android.service.dreams.Dream; import android.service.dreams.IDreamManager; import android.util.Slog; Loading @@ -45,7 +46,7 @@ public class Somnambulator extends Activity { setResult(RESULT_OK, resultIntent); } else { IDreamManager somnambulist = IDreamManager.Stub.asInterface( ServiceManager.checkService("dreams")); ServiceManager.checkService(Dream.DREAM_SERVICE)); if (somnambulist != null) { try { Slog.v("Somnambulator", "Dreaming by user request."); Loading