Closed Bug 2021077 Opened 9 months ago Closed 6 months ago

Use TestLooperManager instead of reflection in UiThreadUtils

Categories

(GeckoView :: General, task)

All
Android
task

Tracking

(firefox153 fixed)

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: mcarare, Assigned: m_kato)

References

Details

(Whiteboard: [fxdroid][group6] )

Attachments

(1 external file)

Since after targeting Android 17 we should avoid using runtime reflection to inspect MessageQueue, we should remove reflection used in a static initializer to access the private MessageQueue.next() method.

Component: Tooling → General
Product: Firefox for Android → GeckoView

TestLooperManager.next might block until next message (internal message of TestLooperManager) is processed on old Android (inc Android 14) when calling TestLooperManager with current thread's looper. Android 16 has a lot of improvements for TestLooperManager and its issue has been fixed.

Thank you for the info!
That is why I was looking for an alternative to TestLooperManager since we are stuck on Android 14 for these tests (are we?)

See Also: → 2018171

Mihai, are you still working on this? I would like to test gv-junit on newer Android, so I have a WIP for this. If you don't work this yet, can I take this?

Flags: needinfo?(mcarare)

Yes, you can take it; I am not actively working on it! It would be good if we could move to Android 16. Thank you!

Flags: needinfo?(mcarare)
Assignee: mcarare → m_kato

Although TestLooperManager is available from Android 8, we cannot replace
reflections with it since TestLooperManager.next causes a deadlock when
using current thread's looper.

This issue has been fixed at Android 16, so let's use it on Android 16+.

Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: