fix android 5 wallpaper

This commit is contained in:
JerryXiao 2023-08-21 20:46:15 +08:00
parent 183f98ac47
commit 2f43a89c03
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

View file

@ -119,8 +119,8 @@ public class EasterDream extends DreamService {
enabled = true;
WallpaperManager wallPaperManager = WallpaperManager.getInstance(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && wallPaperManager.isWallpaperSupported()) {
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || wallPaperManager.isWallpaperSupported()) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
wallPaperDrawable = wallPaperManager.getDrawable();
}
}