Reload live wallpapers when the same component is set again - #73
Merged
Merged
Conversation
When the plugin's live wallpaper is already active and the user sets it again, Android 11+ keeps the running engine and sends it the "android.wallpaper.reapply" command instead of rebinding. Neither the video nor the OpenGL engine handled that command, so the home screen kept playing the previous video or shader even though the preview had shown the new one. The video engine now replaces its player, and the OpenGL render thread swaps in the saved configuration, when the command arrives. Android 10 and older never send it; the docs say so. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
When the plugin's video wallpaper was already active, setting a new video (prepare, preview, Set wallpaper) showed the new video in the preview, but the home screen kept playing the old one. Android 11+ does not rebind the same component. It sends the running engine
android.wallpaper.reapply, and neither engine handled that command. The OpenGL engine had the same gap for a new shader configuration.sequenceDiagram participant User participant WMS as WallpaperManagerService participant Home as Running home engine User->>WMS: Set wallpaper (same component) WMS-->>Home: onCommand("android.wallpaper.reapply") Note over Home: before: ignored, old video keeps playing Home->>Home: after: replace player / swap OpenGL configurationBefore: the preview shows video B, but home still plays A.
After: home with A, then the B preview, then home with B.
Limitation: Android 10 and older never send the command, so there the new content appears once the surface is recreated. The Android guide says so.
Verification
🤖 Generated with Claude Code