Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
Updated description: The ability to use background threads to should help us prevent ANRs caused by AndroidX MediaRouter work.
Original description:
Component used: media router Version used: Master from Androidx Devices/Android versions reproduced on: Any
MediaRouter must be initialized in main thread, it will then create GlobalMediaRouter on main thread leading to RegisteredMediaRouteProviderWatcher having it's handler tied to main thread.
And then the issue starts since the scans use package manager that use binder and is slow and should not be called on main thread. The scans should be made in background that does not prevent the callbacks from then being called on main thread.
The ANR: