-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android] Android.Telecom.InCallService.SetAudioRoute() + enum (#…
…7711) Fixes: #2472 Context: xamarin/monodroid@ebb6d5d Enumification of API-23 in xamarin/monodroid@ebb6d5df incorrectly enumified [`android.telecom.InCallService.setAudioRoute(int)`][0], enumifying the `int` parameter as `Android.Telecom.VideoQuality` instead of `Android.Telecom.CallAudioRoute`. Fix this by changing `src/Mono.Android/methodmap.csv` to use `Android.Telecom.CallAudioRoute`, which results in the binding: namespace Android.Telecom { partial class InCallServices { [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android23.0")] [Register ("setAudioRoute", "(I)V", "", ApiSince = 23)] public unsafe void SetAudioRoute ([global::Android.Runtime.GeneratedEnum] Android.Telecom.CallAudioRoute route) => … } } For backwards compatibility, we need to add an `[Obsolete]` overload containing the incorrect enumification: namespace Android.Telecom { partial class InCallServices { [Obsolete ("Incorrect enum parameter, use the overload that takes a CallAudioRoute paramter instead.")] [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android23.0")] public void SetAudioRoute ([global::Android.Runtime.GeneratedEnum] Android.Telecom.VideoQuality route) => SetAudioRoute ((CallAudioRoute) route); } } The change to `acceptable-breakages*.txt` is due to the `[Register]` attribute being moved from the old overload to the corrected overload. [0]: https://developer.android.com/reference/android/telecom/InCallService#setAudioRoute(int)
- Loading branch information
Showing
5 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using Android.Content; | ||
|
||
namespace Android.Telecom | ||
{ | ||
public abstract partial class InCallService : Android.App.Service | ||
{ | ||
#if ANDROID_23 | ||
[Obsolete ("Incorrect enum parameter, use the overload that takes a CallAudioRoute paramter instead.")] | ||
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android23.0")] | ||
public void SetAudioRoute ([global::Android.Runtime.GeneratedEnum] Android.Telecom.VideoQuality route) | ||
{ | ||
SetAudioRoute ((CallAudioRoute) route); | ||
} | ||
#endif | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Compat issues with assembly Mono.Android: | ||
CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Telecom.InCallService.SetAudioRoute(Android.Telecom.VideoQuality)' in the contract but not the implementation. |