Repository navigation
feat(android): show different OpenGL live content on Home and Lock - #89
Merged
Merged
Conversation
Android 16 lets one live wallpaper service draw different content on each screen, but an app cannot set one screen itself: the description setter needs SET_WALLPAPER_COMPONENT, and the stock AOSP live picker never calls Engine.onApplyWallpaper. Each running engine now reads its screen from getWallpaperFlags() and that screen's wallpaper id. A new id means the user just set the screen, so the engine takes the staged content; a known id means a restart, so it keeps its own. Engines record their content per screen, which also protects their textures from cleanup. A WallpaperDescription this plugin wrote, for pickers that do call onApplyWallpaper, wins. Add WallpaperCapabilities.supportsPerScreenLiveWallpaper, OpenGlLiveWallpaperRequest.contentTag, WallpaperOperationResult.effectiveTarget and AsyncWallpaper.getLiveWallpaperScreens(). Android 15 and older keep the 3.6.0 behaviour and report effectiveTarget both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A picker that calls onApplyWallpaper gets a description before the new engine starts. If the process died in between and the app staged other content, cleanup could delete the described textures. Record the chosen screens with a placeholder id at apply time. Android never issues wallpaper id 0, so the record cannot pass for a restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine callbacks only run on the API level that added them, and the screens query reads getWallpaperInfo(int) only on API 36. Say so with @RequiresApi and an SDK check so NewApi lint passes at minSdk 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Android 16 lets one live wallpaper service show different content on the Home and Lock screens. Apps cannot set one screen themselves:
setWallpaperComponentWithDescriptionneeds the system-onlySET_WALLPAPER_COMPONENT, and the stock AOSP live picker never callsEngine.onApplyWallpaper. So each OpenGL engine now keeps its own content per screen.What changed
getWallpaperFlags) and that screen's wallpaper id. A new id means the user just set that screen, so it takes the staged content. A known id means a restart, so it keeps its own. Records per screen also keep their textures safe from cleanup.onApplyWallpapergets aWallpaperDescriptionwith the shader, frame rate, texture folder and tag; that screen's engine then draws it.WallpaperCapabilities.supportsPerScreenLiveWallpaper,OpenGlLiveWallpaperRequest.contentTag,WallpaperOperationResult.effectiveTarget,AsyncWallpaper.getLiveWallpaperScreens(). Version 3.7.0.Scope
effectiveTarget: both. Video live wallpapers are unchanged. iOS reports no support.Blast Radius
Only the OpenGL wallpaper service and its store change behaviour, and only on API 36. Two engines can hold textures at once, so memory can double while both screens use this wallpaper; each draws only while visible. The schedule branch also touches
pigeons/messages.dart, the CHANGELOG and the version; whichever PR merges second rebases and regenerates.Verification
getLiveWallpaperScreens()reportedHome: warm, Lock: cool, and both screens showed it at once (below)../gradlew :async_wallpaper:testDebugUnitTest: 217 passed.flutter test: 71 passed; exampleflutter test: 10 passed.flutter analyzeclean, Pigeon bindings current, example debug APK builds.🤖 Generated with Claude Code