Skip to content

fix: AOD wallpaper overlay stuck on screen after wake on One UI - #1528

Merged
sameerasw merged 8 commits into
sameerasw:developfrom
spaina93:fix/aod-wallpaper-stuck-overlay
Oct 24, 2026
Merged

sameerasw merged 8 commits into
sameerasw:developfrom
spaina93:fix/aod-wallpaper-stuck-overlay

Conversation

@spaina93

Copy link
Copy Markdown
Contributor

Description

Should fix #951. On Samsung the AOD wallpaper sometimes stays on screen, half transparent, after waking the device (reproduced on a Z Fold 5 waking with double tap). Picking another custom image also has no effect on the overlay.

Cause

  1. One UI stops animators of processes it considers in background; logcat shows Choreographer: CoreRune.SYSPERF_ACTIVE_APP_BBA_ENABLE : stop animation in background states. The overlay window was only removed in the fade-out onAnimationEnd, so with the animator paused the window stayed attached until the accessibility service restarted. dumpsys window confirmed the ACCESSIBILITY_OVERLAY window still attached while the device was awake.
  2. One UI also skips drawing app windows while the AOD is showing (performDraw() was skipped by AOD_SHOW_STATE). Only the first frame reaches the screen, and with the 2 s fade-in that frame has alpha ≈ 0, so the wallpaper was basically invisible on AOD.
  3. Picking a new custom image rewrites custom_aod_wallpaper.png and sets aod_wallpaper_custom_image to true. When it is already true no change listener fires, so the cached bitmap is never invalidated.

Fix

  • Handler fallbacks put the overlay in its final state if the animators have not finished shortly after their duration: remove the window after the fade-out, apply the target bitmap and opacity after the crossfade, set the final alpha after the fade-in. When animators run normally nothing changes. A pending removal is also completed before showing again and in removeOverlay().
  • Skip the fade-in on Samsung so the first drawn frame already shows the wallpaper.
  • Track the custom image file's last modified time when loading the wallpaper and drop the cached bitmap when it changes.

Type of change

  • Bug fix
  • New feature
  • UI / visual update
  • Performance improvement
  • Refactoring / cleanup
  • Translations
  • Build / CI tooling

UI changes

None.

Checklist

  • The base branch is set to develop (not main).
  • The app builds cleanly locally with ./gradlew assembleDebug.
  • Unit tests pass with ./gradlew testDebugUnitTest.
  • You tested the changes on a device or emulator (including Shizuku or Root if applicable).
  • New preferences use SettingsRepository for keys and getter/setter methods. (no new preferences)
  • New user-facing settings are registered in FeatureRegistry.kt for search indexing. (no new settings)
  • New UI follows the design system in ui/core/ (RoundedCardContainer, IconToggleItem, etc.). (no UI changes)
  • Strings are added to res/values/strings.xml and drawables use rounded variants (R.drawable.rounded_*). (no new strings)

Tested on a Galaxy Z Fold 5 (One UI 8.5, Android 16), cover and inner display, waking with double tap, power button and fingerprint: the overlay is removed ~0.5 s after every wake and the wallpaper now shows on AOD. The custom image refresh (last commit) was built and installed but has had less testing so far.

🤖 Generated with Claude Code

sameerasw and others added 5 commits October 22, 2026 22:00
One UI stops animators of processes it considers in background
("CoreRune.SYSPERF_ACTIVE_APP_BBA_ENABLE : stop animation in background
states"). The overlay window was only removed from the fade-out
onAnimationEnd, so when the animator was paused the window stayed on
screen, half transparent, until the accessibility service restarted.
The same pause kept a newly picked image from being applied, since the
bitmap is swapped at the end of the crossfade.

- Remove the window from a Handler fallback if the fade-out has not
  finished shortly after its duration, and finish any pending removal
  before showing again or tearing down.
- Apply the target bitmap and opacity from a fallback if the crossfade
  stalls, and set the final alpha if the fade-in stalls.
- Skip the fade-in on Samsung: One UI skips drawing app windows while
  the AOD is showing, so only the first frame (alpha ~0) reached the
  screen and the wallpaper was invisible on AOD.

Tested on Galaxy Z Fold 5 (One UI 8.5, Android 16), cover and inner
display, waking with double tap, power button and fingerprint.

Refs sameerasw#951

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picking a new custom image rewrites custom_aod_wallpaper.png and sets
aod_wallpaper_custom_image to true. When a custom image was already
set the pref does not change, so no change listener fires, the cache is
never invalidated and the overlay keeps showing the old image until the
service restarts. Track the file's last modified time when loading the
wallpaper and drop the cached bitmap when it changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sameerasw sameerasw added the bug Something isn't working label Oct 24, 2026

@sameerasw sameerasw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions <3

@sameerasw
sameerasw merged commit f06de5d into sameerasw:develop Oct 24, 2026
1 of 2 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Essentials Progress Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants