diff options
| author | 2024-01-18 10:37:33 +0000 | |
|---|---|---|
| committer | 2024-01-18 12:42:56 +0000 | |
| commit | 358d6d9708d387609e43e40b0bdde1ce24949ee6 (patch) | |
| tree | 5f061df26afc6d8748c3c0700289a4b756efefb5 | |
| parent | ae30e283781894e19841d26f3805001c0c5f24d8 (diff) | |
Fix getWallpaperInfo javadoc (again!)
A mistakes was made in ag/24905907: the mention "before Android U" was
accidentally added to the overload that was added in U.
Also fix a couple typos.
Bug: 285731765
Test: NA, javadoc change
Flag: NA
Change-Id: Ie927639822a247a19aa0e051b430bfe12b25d52b
| -rw-r--r-- | core/api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/WallpaperManager.java | 30 |
2 files changed, 17 insertions, 15 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index d4cec2d5ba08..5d9f3075c7e0 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -7698,7 +7698,7 @@ package android.app { method @Nullable public android.app.WallpaperColors getWallpaperColors(int); method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_EXTERNAL_STORAGE, "android.permission.READ_WALLPAPER_INTERNAL"}) public android.os.ParcelFileDescriptor getWallpaperFile(int); method public int getWallpaperId(int); - method public android.app.WallpaperInfo getWallpaperInfo(); + method @RequiresPermission(value="QUERY_ALL_PACKAGES", conditional=true) public android.app.WallpaperInfo getWallpaperInfo(); method @Nullable public android.app.WallpaperInfo getWallpaperInfo(int); method public boolean hasResourceWallpaper(@RawRes int); method public boolean isSetWallpaperAllowed(); diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java index 62db90f79091..c6eca80c9f0f 100644 --- a/core/java/android/app/WallpaperManager.java +++ b/core/java/android/app/WallpaperManager.java @@ -1727,15 +1727,22 @@ public class WallpaperManager { /** * Returns the information about the home screen wallpaper if its current wallpaper is a live - * wallpaper component. Otherwise, if the wallpaper is a static image, this returns null. + * wallpaper component. Otherwise, if the wallpaper is a static image or is not set, or if the + * caller doesn't have the appropriate permissions, this returns {@code null}. * * <p> - * In order to use this, apps should declare a {@code <queries>} tag with the action - * {@code "android.service.wallpaper.WallpaperService"}. Otherwise, + * Before Android U, this method requires the + * {@link android.Manifest.permission#QUERY_ALL_PACKAGES} permission. + * </p> + * + * <p> + * Starting from Android U, in order to use this, apps should declare a {@code <queries>} tag + * with the action {@code "android.service.wallpaper.WallpaperService"}. Otherwise, * this method will return {@code null} if the caller doesn't otherwise have * <a href="{@docRoot}training/package-visibility">visibility</a> of the wallpaper package. * </p> */ + @RequiresPermission(value = "QUERY_ALL_PACKAGES", conditional = true) public WallpaperInfo getWallpaperInfo() { return getWallpaperInfoForUser(mContext.getUserId()); } @@ -1752,19 +1759,14 @@ public class WallpaperManager { } /** - * Returns the information about the home screen wallpaper if its current wallpaper is a live - * wallpaper component. Otherwise, if the wallpaper is a static image or is not set, or if the + * Returns the information about the designated wallpaper if its current wallpaper is a live + * wallpaper component. Otherwise, if the wallpaper is a static image or is not set, or if * the caller doesn't have the appropriate permissions, this returns {@code null}. * * <p> - * Before Android U, this method requires the - * {@link android.Manifest.permission#QUERY_ALL_PACKAGES} permission. - * </p> - * - * <p> - * Starting from Android U, In order to use this, apps should declare a {@code <queries>} tag - * with the action {@code "android.service.wallpaper.WallpaperService"}. Otherwise, - * this method will return {@code null} if the caller doesn't otherwise have + * In order to use this, apps should declare a {@code <queries>} tag with the action + * {@code "android.service.wallpaper.WallpaperService"}. Otherwise, this method will return + * {@code null} if the caller doesn't otherwise have * <a href="{@docRoot}training/package-visibility">visibility</a> of the wallpaper package. * </p> * @@ -1780,7 +1782,7 @@ public class WallpaperManager { /** * Returns the information about the designated wallpaper if its current wallpaper is a live * wallpaper component. Otherwise, if the wallpaper is a static image or is not set, or if the - * the caller doesn't have the appropriate permissions, this returns {@code null}. + * caller doesn't have the appropriate permissions, this returns {@code null}. * * <p> * In order to use this, apps should declare a {@code <queries>} tag |