diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | api/system-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/WallpaperManager.java | 28 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wallpaper/WallpaperManagerService.java | 2 |
4 files changed, 19 insertions, 15 deletions
diff --git a/api/current.txt b/api/current.txt index a126fd714d66..fd2d6369460a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6261,6 +6261,7 @@ package android.app { method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler); method public void clear() throws java.io.IOException; method public void clear(int) throws java.io.IOException; + method public void clearWallpaper(); method public void clearWallpaperOffsets(android.os.IBinder); method public void forgetLoadedWallpaper(); method public android.graphics.drawable.Drawable getBuiltInDrawable(); @@ -6287,6 +6288,7 @@ package android.app { method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException; method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException; method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean, int) throws java.io.IOException; + method public void setDisplayPadding(android.graphics.Rect); method public void setResource(int) throws java.io.IOException; method public int setResource(int, int) throws java.io.IOException; method public void setStream(java.io.InputStream) throws java.io.IOException; diff --git a/api/system-current.txt b/api/system-current.txt index e049f5316c72..ced5224bdad3 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -400,10 +400,8 @@ package android.app { } public class WallpaperManager { - method public void clearWallpaper(); method public void clearWallpaper(int, int); method public void setDisplayOffset(android.os.IBinder, int, int); - method public void setDisplayPadding(android.graphics.Rect); method public boolean setWallpaperComponent(android.content.ComponentName); } diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java index 19240e25bcd8..a6e42cf8aef7 100644 --- a/core/java/android/app/WallpaperManager.java +++ b/core/java/android/app/WallpaperManager.java @@ -57,10 +57,7 @@ import android.os.IBinder; import android.os.Looper; import android.os.ParcelFileDescriptor; import android.os.RemoteException; -import android.os.ServiceManager; import android.os.SystemProperties; -import android.os.UserHandle; -import android.service.wallpaper.WallpaperService; import android.text.TextUtils; import android.util.Log; import android.util.Pair; @@ -915,9 +912,14 @@ public class WallpaperManager { /** * Get the primary colors of a wallpaper. * - * <p>You can expect null if: - * • Colors are still being processed by the system. - * • A live wallpaper doesn't implement {@link WallpaperService.Engine#onComputeColors()}. + * <p>This method can return {@code null} when: + * <ul> + * <li>Colors are still being processed by the system.</li> + * <li>The user has chosen to use a live wallpaper: live wallpapers might not + * implement + * {@link android.service.wallpaper.WallpaperService.Engine#onComputeColors() + * WallpaperService.Engine#onComputeColors()}.</li> + * </ul> * * @param which Wallpaper type. Must be either {@link #FLAG_SYSTEM} or * {@link #FLAG_LOCK}. @@ -929,7 +931,7 @@ public class WallpaperManager { } /** - * Get the primary colors of a wallpaper + * Get the primary colors of the wallpaper configured in the given user. * @param which wallpaper type. Must be either {@link #FLAG_SYSTEM} or * {@link #FLAG_LOCK} * @param userId Owner of the wallpaper. @@ -1559,11 +1561,13 @@ public class WallpaperManager { * Specify extra padding that the wallpaper should have outside of the display. * That is, the given padding supplies additional pixels the wallpaper should extend * outside of the display itself. + * + * <p>This method requires the caller to hold the permission + * {@link android.Manifest.permission#SET_WALLPAPER_HINTS}. + * * @param padding The number of pixels the wallpaper should extend beyond the display, * on its left, top, right, and bottom sides. - * @hide */ - @SystemApi @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_HINTS) public void setDisplayPadding(Rect padding) { try { @@ -1600,11 +1604,11 @@ public class WallpaperManager { } /** - * Clear the wallpaper. + * Reset all wallpaper to the factory default. * - * @hide + * <p>This method requires the caller to hold the permission + * {@link android.Manifest.permission#SET_WALLPAPER}. */ - @SystemApi @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void clearWallpaper() { clearWallpaper(FLAG_LOCK, mContext.getUserId()); diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index 8901b044047c..d123099c9635 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -1428,7 +1428,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub void clearWallpaperLocked(boolean defaultFailed, int which, int userId, IRemoteCallback reply) { if (which != FLAG_SYSTEM && which != FLAG_LOCK) { - throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to read"); + throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to clear"); } WallpaperData wallpaper = null; |