summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorFilip Gruszczynski <gruszczy@google.com>2015-01-28 15:59:46 -0800
committerFilip Gruszczynski <gruszczy@google.com>2015-02-05 12:29:42 -0800
commit9fedc72a0bd3bbdee0b1ed19357546dfe686e1a8 (patch)
treef1c9e8f15fefb011b132d79551cef4ed4eb379ee /core/java
parenteeb43fbd61adfc6511528e2e13fd5372a14e2831 (diff)
downloadframeworks_base-9fedc72a0bd3bbdee0b1ed19357546dfe686e1a8.zip
frameworks_base-9fedc72a0bd3bbdee0b1ed19357546dfe686e1a8.tar.gz
frameworks_base-9fedc72a0bd3bbdee0b1ed19357546dfe686e1a8.tar.bz2
Add wallpaper controlling system apis.
Change-Id: Ibaa8009e9b9d2e58254a4d9107a316c7f1de2211
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/WallpaperManager.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index 8bfe6d3..90d84ee 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -994,6 +994,47 @@ public class WallpaperManager {
}
/**
+ * Clear the wallpaper.
+ *
+ * @hide
+ */
+ @SystemApi
+ public void clearWallpaper() {
+ if (sGlobals.mService == null) {
+ Log.w(TAG, "WallpaperService not running");
+ return;
+ }
+ try {
+ sGlobals.mService.clearWallpaper();
+ } catch (RemoteException e) {
+ // Ignore
+ }
+ }
+
+ /**
+ * Set the live wallpaper.
+ *
+ * This can only be called by packages with android.permission.SET_WALLPAPER_COMPONENT
+ * permission.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean setWallpaperComponent(ComponentName name) {
+ if (sGlobals.mService == null) {
+ Log.w(TAG, "WallpaperService not running");
+ return false;
+ }
+ try {
+ sGlobals.mService.setWallpaperComponent(name);
+ return true;
+ } catch (RemoteException e) {
+ // Ignore
+ }
+ return false;
+ }
+
+ /**
* Set the position of the current wallpaper within any larger space, when
* that wallpaper is visible behind the given window. The X and Y offsets
* are floating point numbers ranging from 0 to 1, representing where the