-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix connectivity broadcast receiver never triggered on android 14.0/34+ #19968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix connectivity broadcast receiver never triggered on android 14.0/34+ #19968
Conversation
Hey there @pierre-galaup! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Hi - will this be soon merged so that we can test on nightly build? many thanks |
Interesting - I didn't have an android 14 device to test on, though I think @mattleibow did test and it seemed that export didn't make a difference in testing? We were trying to be conservative in exporting this, but it would make sense that it is needed - the docs aren't super clear unfortunately from Google. |
/rebase |
…er where the ConnectivityChanged event was never triggered.
c97a7c6
to
1d8ecb0
Compare
Tested this on a physical device with Android 14.0 and can confirm without exporting the receiver, the updates are never received. This change does fix this case for me in testing as well. Thanks for the PR! |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
…targeting API 34 on Android 14 phones' Fix for xamarin#2130 based on the fix dotnet/maui#19968 for Maui for the similar issue dotnet/maui#19949.
…targeting API 34 on Android 14 phones' Fix for xamarin#2130 based on the fix dotnet/maui#19968 for Maui for the similar issue dotnet/maui#19949. (cherry picked from commit 12a8465)
Description of Change
For connectivity, we need to set the broadcastreceiver parameter to
EXPORTED
.As you can see, the
EXPORTED
parameter is required for broadcasts sent from the system: https://developer.android.com/develop/background-work/background-tasks/broadcasts#context-registered-receiversWithout the parameter, the
ConnectivityChanged
event is never triggered.I've tested the fix on a Google Pixel 8 Pro in ANDROID 14 and it works.
Issues Fixed
Fix issue #19949