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

Commit 6f9b8a78 authored by tyiu's avatar tyiu
Browse files

Unfocus wallpaper updated with permission

This commit is a refractoring of ag/20338859. The change gives apps
with android.permission.ALWAYS_UPDATE_WALLPAPER to update the wallpaper
even if the wallpaper is out of focus.

The permission is given to home role owners, and is intended to be used
by wear targets only.

Bug: 271132915
Test: run cts -m CtsWallpaperTestCases
Change-Id: I4471a7e13ce8f3c52e1f5e6288a5e0f2b290955b
parent aa093d0e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7599,7 +7599,7 @@ package android.app {
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_EXTERNAL_STORAGE, "android.permission.READ_WALLPAPER_INTERNAL"}) public android.graphics.drawable.Drawable peekFastDrawable();
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_EXTERNAL_STORAGE, "android.permission.READ_WALLPAPER_INTERNAL"}) public android.graphics.drawable.Drawable peekFastDrawable(int);
    method public void removeOnColorsChangedListener(@NonNull android.app.WallpaperManager.OnColorsChangedListener);
    method public void sendWallpaperCommand(android.os.IBinder, String, int, int, int, android.os.Bundle);
    method @RequiresPermission(value="android.permission.ALWAYS_UPDATE_WALLPAPER", conditional=true) public void sendWallpaperCommand(android.os.IBinder, String, int, int, int, android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean, int) throws java.io.IOException;
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ package android {
    field public static final String ALLOW_ANY_CODEC_FOR_PLAYBACK = "android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK";
    field public static final String ALLOW_PLACE_IN_MULTI_PANE_SETTINGS = "android.permission.ALLOW_PLACE_IN_MULTI_PANE_SETTINGS";
    field public static final String ALLOW_SLIPPERY_TOUCHES = "android.permission.ALLOW_SLIPPERY_TOUCHES";
    field public static final String ALWAYS_UPDATE_WALLPAPER = "android.permission.ALWAYS_UPDATE_WALLPAPER";
    field public static final String AMBIENT_WALLPAPER = "android.permission.AMBIENT_WALLPAPER";
    field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
    field public static final String ASSOCIATE_COMPANION_DEVICES = "android.permission.ASSOCIATE_COMPANION_DEVICES";
+2 −0
Original line number Diff line number Diff line
@@ -2615,6 +2615,8 @@ public class WallpaperManager {
     * @param z Arbitrary integer argument based on command.
     * @param extras Optional additional information for the command, or null.
     */
    @RequiresPermission(value = android.Manifest.permission.ALWAYS_UPDATE_WALLPAPER,
            conditional = true)
    public void sendWallpaperCommand(IBinder windowToken, String action,
            int x, int y, int z, Bundle extras) {
        try {
+7 −0
Original line number Diff line number Diff line
@@ -4029,6 +4029,13 @@
    <permission android:name="android.permission.READ_WALLPAPER_INTERNAL"
        android:protectionLevel="signature|privileged" />

    <!-- Allow apps to always update wallpaper by sending data.
        @SystemApi
        @hide
    -->
    <permission android:name="android.permission.ALWAYS_UPDATE_WALLPAPER"
        android:protectionLevel="internal|role" />

    <!-- ===================================================== -->
    <!-- Permissions for changing the system clock / time zone -->
    <!-- ===================================================== -->
+4 −0
Original line number Diff line number Diff line
@@ -843,11 +843,15 @@
    <!-- Permission required for GTS test - GtsCredentialsTestCases -->
    <uses-permission android:name="android.permission.LAUNCH_CREDENTIAL_SELECTOR" />

    <!-- Permission required for CTS test - CtsWallpaperTestCases -->
    <uses-permission android:name="android.permission.ALWAYS_UPDATE_WALLPAPER" />

    <application
        android:label="@string/app_label"
        android:theme="@android:style/Theme.DeviceDefault.DayNight"
        android:defaultToDeviceProtectedStorage="true"
        android:directBootAware="true">

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="com.android.shell"
Loading