-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android] Bind API-UpsideDownCake Beta 2 (#8044)
Context: https://developer.android.com/about/versions/14 Context: https://android-developers.googleblog.com/2023/04/android-14-beta-1.html Context: e9f3143 Android 14 [Beta 2][0] was released on 2023-May-10: * [API-UpsideDownCake Beta 2 vs. API-33][1] * [API-UpsideDownCake Beta 2 vs. Beta 1][2] The Android 14 Preview [Timeline, milestones, and updates][3] section provides the following timeline, unchanged from e9f3143: * April: Beta 1 * May: Beta 2 * June: Beta 3 with "First [Platform Stability][4] milestone including final APIs and behaviors. Play publishing also opens." * July: Beta 4+ * ???: Final release This update adds several new interfaces to existing classes in `Java.Lang.*`. Ensuring our classes implemented these interfaces without changing the existing class methods took some creative solutions. Each instance should be reasonably documented with inline comments. [0]: https://android-developers.googleblog.com/2023/05/android-14-beta-2.html [1]: https://developer.android.com/sdk/api_diff/u-beta2/changes [2]: https://developer.android.com/sdk/api_diff/u-beta2-incr/changes [5]: https://web.archive.org/web/20230518231033/https://developer.android.com/about/versions/14/overview [6]: https://web.archive.org/web/20230518231033/https://developer.android.com/about/versions/14/overview#platform_stability
- Loading branch information
Showing
5 changed files
with
45 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
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,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<Java.Lang.Class>?)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<Java.Lang.Class> ().ToArray ()); | ||
} | ||
#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