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

am: 4b7b5a6c59

Change-Id: I6d8bb5b15b7c9b13edbb6d8b4e3a69af1d9ca17f
This commit is contained in:
Christopher Tate
2017-08-15 23:50:11 +00:00
committed by android-build-merger
3 changed files with 16 additions and 2 deletions

View File

@@ -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";

View File

@@ -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 -->
<!-- ============================================ -->

View File

@@ -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) {
enforceCallingOrSelfPermissionAndAppOp(android.Manifest.permission.READ_EXTERNAL_STORAGE,
callingPkg, Binder.getCallingUid(), "read wallpaper");
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);