diff options
Diffstat (limited to 'core/java/android/app')
-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 |