Use TestLooperManager instead of reflection in UiThreadUtils
Categories
(GeckoView :: General, task)
Tracking
(firefox153 fixed)
| 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.
Updated•9 months ago
|
| Reporter | ||
Updated•9 months ago
|
| Assignee | ||
Comment 1•8 months ago
|
||
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.
| Reporter | ||
Comment 2•8 months ago
|
||
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?)
| Assignee | ||
Comment 3•6 months ago
|
||
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?
| Reporter | ||
Comment 4•6 months ago
|
||
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!
| Reporter | ||
Updated•6 months ago
|
| Assignee | ||
Comment 5•6 months ago
|
||
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+.
Comment 7•6 months ago
|
||
| bugherder | ||
Description
•