You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NetworkTypeObserver doesn't update it's initial value after creation #10970
Can't find a real auto-quality dash-vp9 video in demo app - it always asks to choose quality before playback start.
The issue is in adaptive quality selection - due to initially low bandwidth, player choose low quality at the start of playback.
Expected result
Video starts with good quality, accordingly to actual network bandwidth.
Actual result
Video starts with bad quality, because of low initial bandwidth
I investigated the issue, and it seems like NetworkTypeObserver#Receiver#onReceive method doesn't get called after registering broadcast receiver (even later, 'asynchronously').
Seems like NetworkTypeObservers' internal impl expects sticky behavior from BroadcastReceiver (so it would receive last network type after receiver registering) - but actually it doesn't work this way.
It looks like this is caused by the newly added REGISTER_NOT_EXPORTED flag when registering the receiver. Up to Android 12, it works just fine and if I mark the registration with REGISTER_EXPORTED on Android 13, it also starts working again.
However, as far as I can see, this shouldn't be needed because callbacks from the system never require REGISTER_EXPORTED. There is a public Android bug reporting this as well at https://issuetracker.google.com/260336345. I'll follow up with the relevant team internally to figure out if this is a system bug or intended behavior .
Activity
tonihei commentedon Feb 10, 2023
Thanks for reporting!
It looks like this is caused by the newly added
REGISTER_NOT_EXPORTEDflag when registering the receiver. Up to Android 12, it works just fine and if I mark the registration withREGISTER_EXPORTEDon Android 13, it also starts working again.However, as far as I can see, this shouldn't be needed because callbacks from the system never require
REGISTER_EXPORTED. There is a public Android bug reporting this as well at https://issuetracker.google.com/260336345. I'll follow up with the relevant team internally to figure out if this is a system bug or intended behavior .Do not specify export flags for protected system broadcasts.
Do not specify export flags for protected system broadcasts.
Do not specify export flags for protected system broadcasts.
Do not specify export flags for protected system broadcasts.