Skip to content

Fix ANR in VideoPlaybackService by removing blocking loadBitmap - #7

Merged
Ludevv merged 1 commit into
ds-custom-forkfrom
anr-video-notification-blocking-bitmap
Apr 3, 2026
Merged

Fix ANR in VideoPlaybackService by removing blocking loadBitmap#7
Ludevv merged 1 commit into
ds-custom-forkfrom
anr-video-notification-blocking-bitmap

Conversation

@Ludevv

@Ludevv Ludevv commented Mar 26, 2026

Copy link
Copy Markdown

Sentry issues REACT-NATIVE-MY (64 events, 15 users) and REACT-NATIVE-HE (37 events, 9 users) show the main thread blocked at:

VideoPlaybackService in buildNotification at line 205 
FluentFuture$TrustedFuture in get 
AbstractFuture in get 
LockSupport in park 
Unsafe in the park 

buildNotification() calls loadBitmap(uri).get() to set the large artwork icon on the media notification. This
blocks the main thread while waiting for the bitmap to load from disk or network. If it takes too long, Android calls ANR.

The fix removes the blocking .get() call. The notification still shows title, description, playback controls, and the
small icon in the status bar — just without the large artwork image visible when the notification is expanded. He Android
13+ this code path was never used anyway, since artwork is handled automatically via MediaStyle.

@mobily mobily left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@Ludevv
Ludevv merged commit 5758dca into ds-custom-fork Apr 3, 2026
0 of 3 checks passed
@Ludevv
Ludevv deleted the anr-video-notification-blocking-bitmap branch April 3, 2026 06:22
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.

2 participants