diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs index 77b044216aa..a4b1f11e31c 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs @@ -73,7 +73,7 @@ public AndroidToolchain () new AndroidPlatformComponent ("platform-31_r01", apiLevel: "31", pkgRevision: "1"), new AndroidPlatformComponent ("platform-32_r01", apiLevel: "32", pkgRevision: "1"), new AndroidPlatformComponent ("platform-33_r02", apiLevel: "33", pkgRevision: "2"), - new AndroidPlatformComponent ("platform-UpsideDownCake_r03", apiLevel: "UpsideDownCake", pkgRevision: "3"), + new AndroidPlatformComponent ("platform-UpsideDownCake_r04", apiLevel: "UpsideDownCake", pkgRevision: "4"), new AndroidToolchainComponent ("sources-33_r01", destDir: Path.Combine ("sources", "android-33"), diff --git a/src/Mono.Android/Java.Lang.Invoke/MethodType.cs b/src/Mono.Android/Java.Lang.Invoke/MethodType.cs new file mode 100644 index 00000000000..b64d6c4c835 --- /dev/null +++ b/src/Mono.Android/Java.Lang.Invoke/MethodType.cs @@ -0,0 +1,24 @@ +using System.Linq; + +namespace Java.Lang.Invoke +{ +#if ANDROID_34 + // A new interface (Java.Lang.Invoke.ITypeDescriptor.IOfMethod) was added to the MethodType class in API-34. + // The existing methods have covariant return types so they cannot fulfill the interface contract, + // and we cannot change them without breaking API. Create new versions of these interface + // methods that can fulfill the contract. + public sealed partial class MethodType + { + Java.Lang.Object[]? ITypeDescriptor.IOfMethod.ParameterArray () + => ParameterArray (); + + System.Collections.IList? ITypeDescriptor.IOfMethod.ParameterList () + => (Android.Runtime.JavaList?)ParameterList (); + + // Helper method needed to cast Object to Class for an explicitly implemented method: + // Java.Lang.Invoke.ITypeDescriptor.IOfMethod.InsertParameterTypes (int p0, params Java.Lang.Object[]? p1) + Java.Lang.Invoke.MethodType? InsertParameterTypes (int num, params Java.Lang.Object []? ptypesToInsert) + => InsertParameterTypes (num, ptypesToInsert?.Cast ().ToArray ()); + } +#endif +} diff --git a/src/Mono.Android/Java.Lang/Class.cs b/src/Mono.Android/Java.Lang/Class.cs index da7cd26c30b..ef6d59e9a55 100644 --- a/src/Mono.Android/Java.Lang/Class.cs +++ b/src/Mono.Android/Java.Lang/Class.cs @@ -1,6 +1,7 @@ using System; using Android.Runtime; using Java.Interop; +using Java.Lang.Invoke; namespace Java.Lang { @@ -28,5 +29,14 @@ public static Class FromType (System.Type type) return Java.Lang.Object.GetObject (JNIEnv.FindClass (type), JniHandleOwnership.TransferGlobalRef)!; } + +#if ANDROID_34 + // A new interface (Java.Lang.Invoke.ITypeDescriptor.IOfField) was added to this class in API-34. + // The new required ComponentType () method conflicts with our ComponentType property created from + // the existing getComponentType method. Explicitly implement this method, which Android has documented + // as equivalent to the existing getComponentType method. + Java.Lang.Object? ITypeDescriptor.IOfField.ComponentType () + => ComponentType; +#endif } } diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index da4e0f992fa..e21eeca86d4 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -78,6 +78,7 @@ + diff --git a/src/Mono.Android/metadata b/src/Mono.Android/metadata index 09272e2b250..20751c52707 100644 --- a/src/Mono.Android/metadata +++ b/src/Mono.Android/metadata @@ -1779,6 +1779,14 @@ PixelCopyRequest + + Java.Lang.Object + + + false + override + override + Android.AdServices.AdIds Android.AdServices.AdSelection @@ -1795,6 +1803,7 @@ Android.Health.Connect.DataTypes Android.Health.Connect.DataTypes.Units Android.Locations.Altitude + Java.Lang.Runtimes