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
[Mono.Android] Generate default interface members for API-30+ (#4353)
Context: dotnet/java-interop#509
Use `generator --lang-features=default-interface-methods` so that we
start binding [Java interface default methods][0] within `android.jar`
and `Mono.Android.dll`, for API-R.
*Note*: `Microsoft.DotNet.ApiCompat.exe` does not currently understand
C#8 [default interface members][1], which we use to bind Java interface
default methods. As such, it reports an error for *every added*
default interface member, e.g.
InterfacesShouldHaveSameMembers : Interface member 'Android.App.Application.IActivityLifecycleCallbacks.OnActivityPostCreated(Android.App.Activity, Android.OS.Bundle)' is present in the implementation but not in the contract.
We are investigating improving `Microsoft.DotNet.ApiCompat.exe` so
that it doesn't report such changes as incompatible.
[0]: https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html
[1]: https://github.com/dotnet/csharplang/blob/f7952cdddf85316a4beec493a0ecc14fcb3241c8/proposals/csharp-8.0/default-interface-methods.md
<!-- Until API Level 26, android.graphics.Color was static. In API Level 26,
@@ -1551,4 +1554,10 @@
1551
1554
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=16]" />
1552
1555
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=18]" />
1553
1556
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=20]" />
1557
+
1558
+
<!-- Work around a generator bug where having multiple Listener methods with the same name cause multiple conflicting EventArgs classes to be created. -->
1559
+
<!-- These are "default" method versions, so it's ok to remove them from an interface. -->
1560
+
<remove-node api-since="30" path="/api/package[@name='android.animation']/interface[@name='Animator.AnimatorListener']/method[@name='onAnimationStart' and count(parameter)=2]" />
1561
+
<remove-node api-since="30" path="/api/package[@name='android.animation']/interface[@name='Animator.AnimatorListener']/method[@name='onAnimationEnd' and count(parameter)=2]" />
0 commit comments