Update read wallpaper methods (U and above)
The following methods in WallpaperManager:
- getDrawable()
- getDrawable(int which)
- peekDrawable()
- peekDrawable(int which)
- getFastDrawable()
- getFastDrawable(int which)
- peekFastDrawable()
- peekFastDrawable(int which)
- getWallpaperFile(int which)
Have been changed in T to return the default system wallpaper data unless the caller has the internal permission READ_WALLPAPER_INTERNAL (or MANAGE_EXTERNAL_STORAGE).
The READ_WALLPAPER_INTERNAL permission has been added in the SystemUI and shell AndroidManifest.
This CL also stops returning the cached wallpaper if an app doesn't hold
the READ_WALLPAPER_INTERNAL permission.
Test: treehugger
Test: atest CtsScopedStorageDeviceOnlyTest
Test: atest ScopedStorageHostTest
Test: atest CtsAppOpsTestCases
Test: atest CtsWallpaperTestCases
Test: atest NoWallpaperPermissionsTest
Test: atest LauncherIronwoodIntegrationTests (see
HomescreenCustomizationTests#testChangeWallpaper)
Bug: 261906287
Bug: 239784307
Change-Id: I8f90fbe78668e4e1d09188196180ca39c6b760b1
diff --git a/data/etc/com.android.systemui.xml b/data/etc/com.android.systemui.xml
index 116aa489..0e28043 100644
--- a/data/etc/com.android.systemui.xml
+++ b/data/etc/com.android.systemui.xml
@@ -51,6 +51,7 @@
<permission name="android.permission.READ_NETWORK_USAGE_HISTORY"/>
<permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
<permission name="android.permission.READ_PRECISE_PHONE_STATE"/>
+ <permission name="android.permission.READ_WALLPAPER_INTERNAL"/>
<permission name="android.permission.REAL_GET_TASKS"/>
<permission name="android.permission.REQUEST_NETWORK_SCORES"/>
<permission name="android.permission.RECEIVE_MEDIA_RESOURCE_USAGE"/>