diff options
author | Filip Gruszczynski <gruszczy@google.com> | 2015-02-06 00:16:41 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-02-06 00:16:41 +0000 |
commit | fe7712e758c12e3fbe26c652dc4ca33267210bd0 (patch) | |
tree | e4c8ff1685b47f3d72ed89b369dc0b183701847c /core/java | |
parent | 3f579c71674784aebb673d4c82abe63e86883546 (diff) | |
parent | 96f3462958977a29aeb8acf102dd5e86c4a5417a (diff) | |
download | frameworks_base-fe7712e758c12e3fbe26c652dc4ca33267210bd0.zip frameworks_base-fe7712e758c12e3fbe26c652dc4ca33267210bd0.tar.gz frameworks_base-fe7712e758c12e3fbe26c652dc4ca33267210bd0.tar.bz2 |
am 7acd679c: Merge "Add wallpaper controlling system apis." into lmp-mr1-modular-dev
automerge: 96f3462
* commit '96f3462958977a29aeb8acf102dd5e86c4a5417a':
Add wallpaper controlling system apis.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/WallpaperManager.java | 41 |
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 |