Skip to content

Commit e89f3a0

Browse files
Drop formatting/gate/array-API changes; keep managers minimal
Revert Color.cs/JavaProxyThrowable.cs formatting, RuntimeFeature feature-gates (suppressions cover it), and the ITypeMap array-proxy rename (deferred to array PR). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5325902 commit e89f3a0

8 files changed

Lines changed: 11 additions & 21 deletions

File tree

src/Mono.Android/Android.Graphics/Color.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,7 @@ public override Type MarshalType {
440440
get { return typeof (int); }
441441
}
442442

443-
public override Color CreateGenericValue (
444-
ref JniObjectReference reference,
445-
JniObjectReferenceOptions options,
446-
Type targetType)
443+
public override Color CreateGenericValue (ref JniObjectReference reference, JniObjectReferenceOptions options, Type targetType)
447444
{
448445
throw new NotImplementedException ();
449446
}

src/Mono.Android/Android.Runtime/JavaProxyThrowable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Android.Runtime {
1111

1212
sealed class JavaProxyThrowable : Java.Lang.Error {
13+
1314
public readonly Exception InnerException;
1415

1516
JavaProxyThrowable (string message, Exception innerException)

src/Mono.Android/ApiCompatLinesToAdd.txt

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

src/Mono.Android/Microsoft.Android.Runtime/AggregateTypeMap.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public bool TryGetProxyType (Type managedType, [NotNullWhen (true)] out Type? pr
4242
return false;
4343
}
4444

45-
public bool TryGetArrayProxyType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? proxyType)
45+
public bool TryGetArrayType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? arrayType)
4646
{
4747
foreach (var universe in _universes) {
48-
if (universe.TryGetArrayProxyType (jniName, rankIndex, out proxyType)) {
48+
if (universe.TryGetArrayType (jniName, rankIndex, out arrayType)) {
4949
return true;
5050
}
5151
}
5252

53-
proxyType = null;
53+
arrayType = null;
5454
return false;
5555
}
5656
}

src/Mono.Android/Microsoft.Android.Runtime/ITypeMap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface ITypeMap
2626
bool TryGetProxyType (Type managedType, [NotNullWhen (true)] out Type? proxyType);
2727

2828
/// <summary>
29-
/// Resolves a JNI leaf name and 0-based array rank index to a generated array proxy type.
29+
/// Resolves a JNI leaf name and 0-based array rank index to a managed array type.
3030
/// </summary>
31-
bool TryGetArrayProxyType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? proxyType);
31+
bool TryGetArrayType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? arrayType);
3232
}

src/Mono.Android/Microsoft.Android.Runtime/RuntimeFeature.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@ static class RuntimeFeature
1818
const string StartupHookProviderSwitch = "System.StartupHookProvider.IsSupported";
1919

2020
[FeatureSwitchDefinition ($"{FeatureSwitchPrefix}{nameof (ManagedTypeMap)}")]
21-
[FeatureGuard (typeof (RequiresDynamicCodeAttribute))]
22-
[FeatureGuard (typeof (RequiresUnreferencedCodeAttribute))]
2321
internal static bool ManagedTypeMap { get; } =
2422
AppContext.TryGetSwitch ($"{FeatureSwitchPrefix}{nameof (ManagedTypeMap)}", out bool isEnabled) ? isEnabled : ManagedTypeMapEnabledByDefault;
2523

2624
[FeatureSwitchDefinition ($"{FeatureSwitchPrefix}{nameof (IsMonoRuntime)}")]
27-
[FeatureGuard (typeof (RequiresDynamicCodeAttribute))]
28-
[FeatureGuard (typeof (RequiresUnreferencedCodeAttribute))]
2925
internal static bool IsMonoRuntime { get; } =
3026
AppContext.TryGetSwitch ($"{FeatureSwitchPrefix}{nameof (IsMonoRuntime)}", out bool isEnabled) ? isEnabled : IsMonoRuntimeEnabledByDefault;
3127

3228
[FeatureSwitchDefinition ($"{FeatureSwitchPrefix}{nameof (IsCoreClrRuntime)}")]
33-
[FeatureGuard (typeof (RequiresDynamicCodeAttribute))]
34-
[FeatureGuard (typeof (RequiresUnreferencedCodeAttribute))]
3529
internal static bool IsCoreClrRuntime { get; } =
3630
AppContext.TryGetSwitch ($"{FeatureSwitchPrefix}{nameof (IsCoreClrRuntime)}", out bool isEnabled) ? isEnabled : IsCoreClrRuntimeEnabledByDefault;
3731

src/Mono.Android/Microsoft.Android.Runtime/SingleUniverseTypeMap.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,17 @@ public bool TryGetProxyType (Type managedType, [NotNullWhen (true)] out Type? pr
102102
return false;
103103
}
104104

105-
public bool TryGetArrayProxyType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? proxyType)
105+
public bool TryGetArrayType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? arrayType)
106106
{
107107
foreach (var arrayMapsByRank in _arrayMapsByUniverseAndRank) {
108108
if ((uint)rankIndex < (uint)arrayMapsByRank.Length &&
109109
arrayMapsByRank [rankIndex] is { } dict &&
110-
dict.TryGetValue (jniName, out proxyType)) {
110+
dict.TryGetValue (jniName, out arrayType)) {
111111
return true;
112112
}
113113
}
114114

115-
proxyType = null;
115+
arrayType = null;
116116
return false;
117117
}
118118
}

src/Mono.Android/Microsoft.Android.Runtime/TrimmableTypeMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ internal bool TryGetArrayProxy (Type elementType, int additionalRank, [NotNullWh
517517
signature = signature.AddArrayRank (additionalRank);
518518
var elementJniName = signature.SimpleReference ?? throw new InvalidOperationException ();
519519

520-
if (_typeMap.TryGetArrayProxyType (elementJniName, signature.ArrayRank - 1, out var proxyType)) {
520+
if (_typeMap.TryGetArrayType (elementJniName, signature.ArrayRank - 1, out var proxyType)) {
521521
var proxy = _arrayProxyCache.GetOrAdd (proxyType, static type =>
522522
type.GetCustomAttribute<JavaArrayProxy> (inherit: false) ?? s_noArrayProxySentinel);
523523
if (!ReferenceEquals (proxy, s_noArrayProxySentinel)) {

0 commit comments

Comments
 (0)