diff options
| author | Josh Tsuji <tsuji@google.com> | 2021-04-18 23:12:00 -0400 |
|---|---|---|
| committer | Josh Tsuji <tsuji@google.com> | 2021-04-18 23:12:02 -0400 |
| commit | d5da89479eafee5fb8e28da1b8f83eda32d44ddf (patch) | |
| tree | 563b80b5900e183e573d2ee5f89e439aa96261de /core/java/android | |
| parent | 07d522f307a01ab0c1e103f2e3621d74c5844ed4 (diff) | |
Use the existing wallpaper command API to send wake/sleep events to the wallpaper.
This is already used for similar events such as icon drops and user taps. Using it to indicate that the user has woken/slept the device (and passing along location information) makes sense!
This was previously rolled back since WallpaperManager can be null in Car environments. This CL now checks if WallpaperManager is null.
Bug: 169693662
Test: locally with modified wallpaper, it receives events
Change-Id: Ie9d21b4ff4a1edf871540481bc0c4216ed686b7f
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/IWallpaperManager.aidl | 14 | ||||
| -rw-r--r-- | core/java/android/app/WallpaperManager.java | 24 |
2 files changed, 38 insertions, 0 deletions
diff --git a/core/java/android/app/IWallpaperManager.aidl b/core/java/android/app/IWallpaperManager.aidl index e83557c18f8f..4f7c6841d6bb 100644 --- a/core/java/android/app/IWallpaperManager.aidl +++ b/core/java/android/app/IWallpaperManager.aidl @@ -190,4 +190,18 @@ interface IWallpaperManager { * Called from SystemUI when it shows the AoD UI. */ oneway void setInAmbientMode(boolean inAmbientMode, long animationDuration); + + /** + * Called from SystemUI when the device is waking up. + * + * @hide + */ + oneway void notifyWakingUp(int x, int y, in Bundle extras); + + /** + * Called from SystemUI when the device is going to sleep. + * + * @hide + */ + void notifyGoingToSleep(int x, int y, in Bundle extras); } diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java index 6a71c92fbc37..8d332ab1d58b 100644 --- a/core/java/android/app/WallpaperManager.java +++ b/core/java/android/app/WallpaperManager.java @@ -190,6 +190,30 @@ public class WallpaperManager { public static final String COMMAND_DROP = "android.home.drop"; /** + * Command for {@link #sendWallpaperCommand}: reported by System UI when the device is waking + * up. The x and y arguments are a location (possibly very roughly) corresponding to the action + * that caused the device to wake up. For example, if the power button was pressed, this will be + * the location on the screen nearest the power button. + * + * If the location is unknown or not applicable, x and y will be -1. + * + * @hide + */ + public static final String COMMAND_WAKING_UP = "android.wallpaper.wakingup"; + + /** + * Command for {@link #sendWallpaperCommand}: reported by System UI when the device is going to + * sleep. The x and y arguments are a location (possibly very roughly) corresponding to the + * action that caused the device to go to sleep. For example, if the power button was pressed, + * this will be the location on the screen nearest the power button. + * + * If the location is unknown or not applicable, x and y will be -1. + * + * @hide + */ + public static final String COMMAND_GOING_TO_SLEEP = "android.wallpaper.goingtosleep"; + + /** * Command for {@link #sendWallpaperCommand}: reported when the wallpaper that was already * set is re-applied by the user. * @hide |
