ANR: LightweightTheme.handleMessage can block the Gecko thread

RESOLVED FIXED in Firefox 25

Status

()

Firefox for Android
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jchen, Assigned: mfinkle)

Tracking

Trunk
Firefox 25
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [ANR])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Because LightweightTheme.handleMessage runs on the Gecko thread, when it calls BitmapUtils.decodeUrl, the Gecko thread can get blocked as well waiting for the resource. Blocking Gecko is bad and can result in unresponsiveness and ANRs.

I think we should do decodeUrl on the background thread.
Created attachment 770626 [details] [diff] [review]
patch

Uses a background thread. I thought about using UiAsyncTask, but this is the same and we already had mHandler in the code, so just manually making a post to the background thread seemed simpler.
Assignee: nobody → mark.finkle
Attachment #770626 - Flags: review?(sriram)
Attachment #770626 - Flags: review?(sriram) → review+
https://hg.mozilla.org/mozilla-central/rev/de42663c8b44
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
You need to log in before you can comment on or make changes to this bug.