From 2f43a89c03b2e2b2334c633eac1cca8d0b3b1b0a Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 21 Aug 2023 20:46:15 +0800 Subject: [PATCH] fix android 5 wallpaper --- .../main/java/cc/jerryxiao/easterscrsaver/EasterDream.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/cc/jerryxiao/easterscrsaver/EasterDream.java b/app/src/main/java/cc/jerryxiao/easterscrsaver/EasterDream.java index bf95c24..b4ec3fe 100644 --- a/app/src/main/java/cc/jerryxiao/easterscrsaver/EasterDream.java +++ b/app/src/main/java/cc/jerryxiao/easterscrsaver/EasterDream.java @@ -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(); } }