cvzi / darkmodewallpaper

🌓 A live wallpaper for Android that respects dark theme mode 🌇
https://f-droid.org/packages/com.github.cvzi.darkmodewallpaper/
GNU General Public License v3.0
154 stars 11 forks source link

Import wallpaper failes on Android 13 (Tiramisu) #75

Closed cvzi closed 1 week ago

cvzi commented 1 year ago

Cannot import wallpaper on Android 13 (Tiramisu) Beta

The permission Manifest.permission.READ_EXTERNAL_STORAGE is required to import the wallpaper with WallpaperManager.getDrawable(). On Android 13 with targetSdkVersion set to 33 this permission cannot be requested anymore (if it was requested in an earlier version it does persist though). Instead of the permission dialog, the user sees nothing and the permission request is automatically denied. So the getDrawable() call would fail with java.lang.SecurityException: Permission android.permission.READ_EXTERNAL_STORAGE denied for package

https://github.com/cvzi/darkmodewallpaper/blob/9527ba9cdd8b4f81e5befdcdf2f6c237bb1de1d0/app/src/main/AndroidManifest.xml#L27

https://github.com/cvzi/darkmodewallpaper/blob/9527ba9cdd8b4f81e5befdcdf2f6c237bb1de1d0/app/src/main/java/com/github/cvzi/darkmodewallpaper/activity/MainActivity.kt#L1167-L1173

https://github.com/cvzi/darkmodewallpaper/blob/9527ba9cdd8b4f81e5befdcdf2f6c237bb1de1d0/app/src/main/java/com/github/cvzi/darkmodewallpaper/activity/MainActivity.kt#L156-L168

Upstream report: https://issuetracker.google.com/issues/237124750

cvzi commented 1 week ago

This won't be solved. There is a separate app for this feature now: https://github.com/cvzi/WallpaperExport