Skip to content

Commit 6f2229b

Browse files
committed
Merge branch 'main' into dev/grendel/clr-host
* main: [ci] Remove references to sdk-insertions (#9731) `$(AndroidPackVersionSuffix)`=preview.2 (#9733) [Mono.Android] Java.Lang.Object.GetObject<T>() implementation (#9728)
2 parents e080c70 + c2b456b commit 6f2229b

File tree

19 files changed

+41
-77
lines changed

19 files changed

+41
-77
lines changed

.github/workflows/sdk-insertion-bump.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* Bump first digit of the patch version for feature releases (and reset the first two digits to 0)
3737
-->
3838
<AndroidPackVersion>35.99.0</AndroidPackVersion>
39-
<AndroidPackVersionSuffix>preview.1</AndroidPackVersionSuffix>
39+
<AndroidPackVersionSuffix>preview.2</AndroidPackVersionSuffix>
4040
<!-- Final value set by GetXAVersionInfo target -->
4141
<IsStableBuild>false</IsStableBuild>
4242
</PropertyGroup>

build-tools/automation/azure-pipelines.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ resources:
2020
name: xamarin/yaml-templates
2121
ref: refs/heads/main
2222
endpoint: xamarin
23-
- repository: sdk-insertions
24-
type: github
25-
name: xamarin/sdk-insertions
26-
ref: refs/heads/main
27-
endpoint: xamarin
2823
- repository: android-platform-support
2924
type: git
3025
name: DevDiv/android-platform-support
@@ -46,7 +41,6 @@ parameters:
4641
# Global variables
4742
variables:
4843
- template: /build-tools/automation/yaml-templates/variables.yaml@self
49-
- template: templates/common/vs-release-vars.yml@sdk-insertions
5044
- ${{ if eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}:
5145
- group: AzureDevOps-Artifact-Feeds-Pats
5246
- group: DotNet-MSRC-Storage

src/Mono.Android/Android.App/Activity.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ namespace Android.App {
66

77
partial class Activity {
88

9-
internal const DynamicallyAccessedMemberTypes Constructors = DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors;
10-
119
public T? FindViewById<
1210
[DynamicallyAccessedMembers (Constructors)]
1311
T

src/Mono.Android/Android.App/Dialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ protected Dialog (Android.Content.Context context, bool cancelable, EventHandler
1010
: this (context, cancelable, new Android.Content.IDialogInterfaceOnCancelListenerImplementor () { Handler = cancelHandler }) {}
1111

1212
public T? FindViewById<
13-
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
13+
[DynamicallyAccessedMembers (Constructors)]
1414
T
1515
> (int id)
1616
where T : Android.Views.View

src/Mono.Android/Android.App/FragmentManager.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#if ANDROID_11
66
namespace Android.App {
77
public partial class FragmentManager {
8-
const DynamicallyAccessedMemberTypes Constructors = DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors;
9-
108
public T? FindFragmentById<
119
[DynamicallyAccessedMembers (Constructors)]
1210
T

src/Mono.Android/Android.OS/AsyncTask.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public abstract class AsyncTask<
1818
TResult
1919
> : AsyncTask {
2020

21-
const DynamicallyAccessedMemberTypes Constructors = DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors;
22-
2321
static IntPtr java_class_handle;
2422
internal static IntPtr class_ref {
2523
get {

src/Mono.Android/Android.Runtime/JNIEnv.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,13 @@ public static void CopyArray (IntPtr src, string[] dest)
662662
AssertIsJavaObject (type);
663663

664664
IntPtr elem = GetObjectArrayElement (source, index);
665-
return Java.Lang.Object.GetObject (elem, JniHandleOwnership.TransferLocalRef, type);
665+
return GetObject (elem, type);
666+
667+
// FIXME: Since a Dictionary<Type, Func> is used here, the trimmer will not be able to properly analyze `Type t`
668+
// error IL2111: Method 'lambda expression' with parameters or return value with `DynamicallyAccessedMembersAttribute` is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method.
669+
[UnconditionalSuppressMessage ("Trimming", "IL2067", Justification = "FIXME: https://github.com/xamarin/xamarin-android/issues/8724")]
670+
static object? GetObject (IntPtr e, Type t) =>
671+
Java.Lang.Object.GetObject (e, JniHandleOwnership.TransferLocalRef, t);
666672
} },
667673
{ typeof (Array), (type, source, index) => {
668674
IntPtr elem = GetObjectArrayElement (source, index);

src/Mono.Android/Android.Runtime/JavaArray.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4-
4+
using System.Diagnostics.CodeAnalysis;
55

66
namespace Android.Runtime {
77

88
[Register ("mono/android/runtime/JavaArray", DoNotGenerateAcw=true)]
9-
public sealed class JavaArray<T> : Java.Lang.Object, IList<T> {
9+
public sealed class JavaArray<
10+
[DynamicallyAccessedMembers (Constructors)]
11+
T
12+
> : Java.Lang.Object, IList<T> {
1013

1114
public JavaArray (IntPtr handle, JniHandleOwnership transfer)
1215
: base (handle, transfer)

src/Mono.Android/Android.Runtime/JavaCollection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ namespace Android.Runtime {
1414
// java.util.Collection allows null values
1515
public class JavaCollection : Java.Lang.Object, System.Collections.ICollection {
1616

17-
internal const DynamicallyAccessedMemberTypes Constructors = DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors;
18-
1917
internal static IntPtr collection_class = JNIEnv.FindClass ("java/util/Collection");
2018

2119
internal static IntPtr id_add;

0 commit comments

Comments
 (0)