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
7 files changed