Skip to content

Implement onTrimMemory in MusicService to release widget bitmap caches#1937

Merged
theovilardo merged 1 commit into
masterfrom
fix/memory-trim-crash
May 8, 2026
Merged

Implement onTrimMemory in MusicService to release widget bitmap caches#1937
theovilardo merged 1 commit into
masterfrom
fix/memory-trim-crash

Conversation

@theovilardo

Copy link
Copy Markdown
Collaborator

Overrides onTrimMemory to invalidate cached widget artwork and clear lastWidgetPlayerInfo when the system signals memory pressure (TRIM_MEMORY_RUNNING_LOW or higher). This helps reduce the memory footprint of the service by freeing up bitmap data that can be reloaded during the next widget update cycle.

Overrides `onTrimMemory` to invalidate cached widget artwork and clear `lastWidgetPlayerInfo` when the system signals memory pressure (`TRIM_MEMORY_RUNNING_LOW` or higher). This helps reduce the memory footprint of the service by freeing up bitmap data that can be reloaded during the next widget update cycle.
@theovilardo theovilardo merged commit 22a3173 into master May 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant