Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a037a4ca authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Correct getWallpaperInfo javadoc

We forgot to mention that before android 14, the permission
QUERY_ALL_PACKAGES is required in order to use getWallpaperInfo.

Also mention that we return null if the caller doesn't have the
permission.

Bug: 285731765
Test: NA; javadoc change
Change-Id: Ibad0701412838965f387978cda4703e598ea4fa4
parent 041f21a8
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -1759,12 +1759,17 @@ 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, this
     * returns null.
     * 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}.
     *
     * <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>
@@ -1780,8 +1785,15 @@ 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, this
     * returns null.
     * 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}.
     *
     * <p>
     * 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>
     *
     * @param which Specifies wallpaper to request (home or lock).
     * @param userId Owner of the wallpaper.