Skip to content

Commit 15c0723

Browse files
committed
[Mono.Android] Generate default interface members for API-30+.
1 parent a20be39 commit 15c0723

File tree

5 files changed

+256
-2
lines changed

5 files changed

+256
-2
lines changed

src/Mono.Android/Android.Telephony.Mbms/IGroupCallCallback.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Android.Telephony.Mbms
77
{
8-
public interface IGroupCallCallback : IJavaObject
8+
public partial interface IGroupCallCallback : IJavaObject
99
{
1010
// This is not generated because all the methods in this
1111
// interface are default interface mthods, and the interface

src/Mono.Android/Mono.Android.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<SignAssembly>true</SignAssembly>
1212
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
1313
<NoWarn>0618;0809;0108;0114</NoWarn>
14+
<LangVersion>latest</LangVersion>
1415
</PropertyGroup>
1516
<Import Project="..\..\Configuration.props" />
1617
<PropertyGroup>

src/Mono.Android/Mono.Android.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@
9898
<_Api>$(IntermediateOutputPath)mcw\api.xml</_Api>
9999
<_Dirs>--enumdir=$(IntermediateOutputPath)mcw</_Dirs>
100100
<_FullIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)'))</_FullIntermediateOutputPath>
101+
<_LangFeatures Condition="$(AndroidApiLevel) &gt;= 30">--lang-features=default-interface-methods</_LangFeatures>
101102
</PropertyGroup>
102103
<Exec
103-
Command="$(ManagedRuntime) $(ManagedRuntimeArgs) $(Generator) $(_GenFlags) $(_ApiLevel) $(_Out) $(_Codegen) $(_Fixup) $(_Enums1) $(_Enums2) $(_Versions) $(_Annotations) $(_Assembly) $(_TypeMap) $(_Dirs) $(_Api)"
104+
Command="$(ManagedRuntime) $(ManagedRuntimeArgs) $(Generator) $(_GenFlags) $(_ApiLevel) $(_Out) $(_Codegen) $(_Fixup) $(_Enums1) $(_Enums2) $(_Versions) $(_Annotations) $(_Assembly) $(_TypeMap) $(_LangFeatures) $(_Dirs) $(_Api)"
104105
/>
105106
<ItemGroup>
106107
<Compile Include="$(_FullIntermediateOutputPath)\mcw\**\*.cs" KeepDuplicates="False" />

src/Mono.Android/metadata

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,4 +1551,10 @@
15511551
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=16]" />
15521552
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=18]" />
15531553
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=20]" />
1554+
1555+
<!-- Work around a generator bug where having multiple Listener methods with the same name cause multiple conflicting EventArgs classes to be created. -->
1556+
<!-- These are "default" method versions, so it's ok to remove them from an interface. -->
1557+
<remove-node api-since="30" path="/api/package[@name='android.animation']/interface[@name='Animator.AnimatorListener']/method[@name='onAnimationStart' and count(parameter)=2]" />
1558+
<remove-node api-since="30" path="/api/package[@name='android.animation']/interface[@name='Animator.AnimatorListener']/method[@name='onAnimationEnd' and count(parameter)=2]" />
1559+
15541560
</metadata>

0 commit comments

Comments
 (0)