Merge "Add privileged permission for reading the current wallpaper image" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4b7b5a6c59
@@ -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";
|
||||
|
||||
@@ -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 -->
|
||||
<!-- ============================================ -->
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user