diff --git a/src/Mono.Android/Android.Content/Context.cs b/src/Mono.Android/Android.Content/Context.cs index d397c171207..62896ab8dd9 100644 --- a/src/Mono.Android/Android.Content/Context.cs +++ b/src/Mono.Android/Android.Content/Context.cs @@ -1,4 +1,5 @@ using System; +using Android.OS; using Android.Runtime; namespace Android.Content { @@ -16,5 +17,14 @@ public void StartActivity (Type type) [Obsolete ("This constant will be removed in the future version. Use Android.Content.ReceiverFlags enum directly instead of this field.")] public const int ReceiverVisibleToInstantApps = 1; #endif + +#if ANDROID_34 + // Add correctly enumified overloads + public Intent? RegisterReceiver (BroadcastReceiver? receiver, IntentFilter? filter, ReceiverFlags flags) + => RegisterReceiver (receiver, filter, (ActivityFlags)flags); + + public Intent? RegisterReceiver (BroadcastReceiver? receiver, IntentFilter? filter, string? broadcastPermission, Handler? scheduler, ReceiverFlags flags) + => RegisterReceiver (receiver, filter, broadcastPermission, scheduler, (ActivityFlags)flags); +#endif } } diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index b4444de2a54..71da67f2a0c 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -27,7 +27,12 @@ $(DefineConstants);ANDROID_UNSTABLE $(_MonoAndroidNETDefaultOutDir) + + false + + + $(WarningsAsErrors);RS0016,RS0017 diff --git a/src/Mono.Android/PublicAPI/API-34/PublicAPI.Unshipped.txt b/src/Mono.Android/PublicAPI/API-34/PublicAPI.Unshipped.txt index 4b0aea8a008..cdec2d9529d 100644 --- a/src/Mono.Android/PublicAPI/API-34/PublicAPI.Unshipped.txt +++ b/src/Mono.Android/PublicAPI/API-34/PublicAPI.Unshipped.txt @@ -8448,6 +8448,8 @@ Android.Content.Context.ObtainStyledAttributes(Android.Util.IAttributeSet? set, Android.Content.Context.ObtainStyledAttributes(Android.Util.IAttributeSet? set, int[]! attrs, int defStyleAttr, int defStyleRes) -> Android.Content.Res.TypedArray! Android.Content.Context.ObtainStyledAttributes(int resid, int[]! attrs) -> Android.Content.Res.TypedArray! Android.Content.Context.ObtainStyledAttributes(int[]! attrs) -> Android.Content.Res.TypedArray! +Android.Content.Context.RegisterReceiver(Android.Content.BroadcastReceiver? receiver, Android.Content.IntentFilter? filter, Android.Content.ReceiverFlags flags) -> Android.Content.Intent? +Android.Content.Context.RegisterReceiver(Android.Content.BroadcastReceiver? receiver, Android.Content.IntentFilter? filter, string? broadcastPermission, Android.OS.Handler? scheduler, Android.Content.ReceiverFlags flags) -> Android.Content.Intent? Android.Content.Context.StartActivity(System.Type! type) -> void Android.Content.ContextParams Android.Content.ContextParams.AttributionTag.get -> string? diff --git a/src/Mono.Android/metadata b/src/Mono.Android/metadata index 31c85dc9e61..0ca93013863 100644 --- a/src/Mono.Android/metadata +++ b/src/Mono.Android/metadata @@ -1809,6 +1809,14 @@ ModelDownloadErrorEventArgs + + + This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead. + This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead. + This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead. + This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead. + This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead. + This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.