commit | 5249d71249af1034c583ce64cf7a886b38fd9fc7 | [log] [tgz] |
---|---|---|
author | Sebastiano Barezzi <seba@sebaubuntu.dev> | Mon Feb 05 13:51:20 2024 +0100 |
committer | Sebastiano Barezzi <seba@sebaubuntu.dev> | Thu Feb 08 13:53:38 2024 +0100 |
tree | a9861065a72cf6e94f0a13b7e280eaddd6700835 | |
parent | e9d143ca8accac9e360c0c7082764552707db1ff [diff] |
Glimpse: SetWallpaperActivity: Prefer system cropper Change-Id: I437213df159f013091caa6d4151e79958a7f4196
diff --git a/app/src/main/java/org/lineageos/glimpse/SetWallpaperActivity.kt b/app/src/main/java/org/lineageos/glimpse/SetWallpaperActivity.kt index bf77238..bb8b218 100644 --- a/app/src/main/java/org/lineageos/glimpse/SetWallpaperActivity.kt +++ b/app/src/main/java/org/lineageos/glimpse/SetWallpaperActivity.kt
@@ -54,6 +54,15 @@ return } + // Try to offload this task to styles and wallpaper + runCatching { + startActivity(wallpaperManager.getCropAndSetWallpaperIntent(wallpaperUri)) + finish() + return + } + + // If we reached this point, we have to do stuff on our own + // Check if the wallpaper can be changed if (!wallpaperManager.isWallpaperSupported || !wallpaperManager.isSetWallpaperAllowed) { Toast.makeText(