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

Commit 8a71c48d authored by Christopher Tate's avatar Christopher Tate
Browse files

Add privileged permission for reading the current wallpaper image

OEMs can therefore arrange factory-default access to have access prior
to setup or user interaction.

Bug: 30770233
Bug: 64029450
Test: manual

Change-Id: I2cb30721f2a64ef50275b711ca10ca571248504a
parent fe97799d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ package android {
    field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS";
    field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS";
    field public static final java.lang.String READ_VOICEMAIL = "com.android.voicemail.permission.READ_VOICEMAIL";
    field public static final java.lang.String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL";
    field public static final java.lang.String READ_WIFI_CREDENTIAL = "android.permission.READ_WIFI_CREDENTIAL";
    field public static final java.lang.String REAL_GET_TASKS = "android.permission.REAL_GET_TASKS";
    field public static final java.lang.String REBOOT = "android.permission.REBOOT";
+9 −0
Original line number Diff line number Diff line
@@ -1984,6 +1984,15 @@
        android:description="@string/permdesc_setWallpaperHints"
        android:protectionLevel="normal" />

    <!-- Allow the app to read the system wallpaper image without
        holding the READ_EXTERNAL_STORAGE permission.
        <p>Not for use by third-party applications.
        @hide
        @SystemApi
    -->
    <permission android:name="android.permission.READ_WALLPAPER_INTERNAL"
        android:protectionLevel="signature|privileged" />

    <!-- ============================================ -->
    <!-- Permissions for changing the system clock -->
    <!-- ============================================ -->
+6 −2
Original line number Diff line number Diff line
@@ -1606,8 +1606,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
    @Override
    public ParcelFileDescriptor getWallpaper(String callingPkg, IWallpaperManagerCallback cb,
            final int which, Bundle outParams, int wallpaperUserId) {
        final int hasPrivilege = mContext.checkCallingOrSelfPermission(
                android.Manifest.permission.READ_WALLPAPER_INTERNAL);
        if (hasPrivilege != PackageManager.PERMISSION_GRANTED) {
            enforceCallingOrSelfPermissionAndAppOp(android.Manifest.permission.READ_EXTERNAL_STORAGE,
                    callingPkg, Binder.getCallingUid(), "read wallpaper");
        }

        wallpaperUserId = ActivityManager.handleIncomingUser(Binder.getCallingPid(),
                Binder.getCallingUid(), wallpaperUserId, false, true, "getWallpaper", null);