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

Commit 4b7b5a6c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add privileged permission for reading the current wallpaper image" into oc-mr1-dev

parents 6ba12876 8a71c48d
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);