Bug 56666 - Constant Intent.ActionProviderChanged has wrong value
Summary: Constant Intent.ActionProviderChanged has wrong value
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 7.3 (15.2)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2017-05-19 12:24 UTC by diegoxleon
Modified: 2017-06-23 19:50 UTC (History)
2 users (show)

Tags: bb
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description diegoxleon 2017-05-19 12:24:29 UTC
The current value of Intent.ActionProviderChanged is "android.intent.action.PROVIDER_CHANGED"

That won´t work with an intent filter. For instance:

[BroadcastReceiver(Exported = false)]
[IntentFilter(new[] { Intent.ActionProviderChanged })]
public class ProviderChangeReceiver : BroadcastReceiver {}

The OnReceive method will never fire.

However it works when setting the correct value:

[IntentFilter(new[] { "android.location.PROVIDERS_CHANGED" })]
Comment 1 Jon Douglas [MSFT] 2017-06-23 17:50:54 UTC
This value looks correct to me at first glance:

https://developer.android.com/reference/android/content/Intent.html#ACTION_PROVIDER_CHANGED

Constant Value: "android.intent.action.PROVIDER_CHANGED"

Xamarin.Android Value: public const string ActionProviderChanged = "android.intent.action.PROVIDER_CHANGED";

I believe you are confusing this value with the LocationManager's PROVIDERS_CHANGED_ACTION which is similarly worded, but in a completely different package.

https://developer.android.com/reference/android/location/LocationManager.html#PROVIDERS_CHANGED_ACTION

Thus I am marking this as RESOLVED ANSWERED as these are two different constants. You should be using the LocationManager constant instead. This is found here when using Android.Locations:

LocationManager.ProvidersChangedAction
Comment 2 diegoxleon 2017-06-23 19:47:28 UTC
You are correct about "android.intent.action.PROVIDER_CHANGED". I thought that was wrong. However, "android.location.PROVIDERS_CHANGED" is working fine. I didn´t try LocationManager.ProvidersChangedAction yet.

Thanks
Comment 3 Jon Douglas [MSFT] 2017-06-23 19:50:19 UTC
They should be the same constant string. Whichever way you decide to get that string to your intent filter whether you type it in manually or via the constant provided.