Skip to content

Commit 737183e

Browse files
committed
Merge branch 'main' into tune-runtime-cpp
* main: [Mono.Android] nullability for AndroidMessageHandler.RequestNeedsAuthorization (dotnet#7454) [Xamarin.Android.Build.Tasks] Fix up `ToJniName` to use `cache`. (dotnet#7460) Bump to xamarin/android-api-docs@52d85154 (dotnet#7459) Bump to xamarin/xamarin-android-tools/main@9f56dec (dotnet#7456)
2 parents e0deaa7 + 91669a4 commit 737183e

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

external/android-api-docs

Submodule android-api-docs updated 1024 files

external/xamarin-android-tools

src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics.CodeAnalysis;
34
using System.IO;
45
using System.IO.Compression;
56
using System.Linq;
@@ -233,6 +234,9 @@ public int MaxAutomaticRedirections
233234
/// If <c>true</c> then the server requested authorization and the application must use information
234235
/// found in <see cref="RequestedAuthentication"/> to set the value of <see cref="PreAuthenticationData"/>
235236
/// </summary>
237+
#if NETCOREAPP
238+
[MemberNotNullWhen(true, nameof(RequestedAuthentication))]
239+
#endif
236240
public bool RequestNeedsAuthorization {
237241
get { return RequestedAuthentication?.Count > 0; }
238242
}

src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public IList<string> Merge (TaskLoggingHelper log, TypeDefinitionCache cache, Li
336336
if (PackageName == null)
337337
PackageName = t.Namespace;
338338

339-
var name = JavaNativeTypeManager.ToJniName (t).Replace ('/', '.');
339+
var name = JavaNativeTypeManager.ToJniName (t, cache).Replace ('/', '.');
340340
var compatName = JavaNativeTypeManager.ToCompatJniName (t, cache).Replace ('/', '.');
341341
if (((string) app.Attribute (attName)) == compatName) {
342342
app.SetAttributeValue (attName, name);
@@ -927,7 +927,7 @@ void AddInstrumentations (XElement manifest, IList<TypeDefinition> subclasses, i
927927

928928
foreach (var type in subclasses)
929929
if (type.IsSubclassOf ("Android.App.Instrumentation", cache)) {
930-
var xe = InstrumentationFromTypeDefinition (type, JavaNativeTypeManager.ToJniName (type).Replace ('/', '.'), targetSdkVersion);
930+
var xe = InstrumentationFromTypeDefinition (type, JavaNativeTypeManager.ToJniName (type, cache).Replace ('/', '.'), targetSdkVersion);
931931
if (xe != null)
932932
manifest.Add (xe);
933933
}

src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public bool Generate (bool debugBuild, bool skipJniAddNativeMethodRegistrationAt
142142
return GenerateDebug (skipJniAddNativeMethodRegistrationAttributeScan, javaTypes, cache, typemapsOutputDirectory, generateNativeAssembly, appConfState);
143143
}
144144

145-
return GenerateRelease (skipJniAddNativeMethodRegistrationAttributeScan, javaTypes, typemapsOutputDirectory, appConfState);
145+
return GenerateRelease (skipJniAddNativeMethodRegistrationAttributeScan, javaTypes, cache, typemapsOutputDirectory, appConfState);
146146
}
147147

148148
bool GenerateDebug (bool skipJniAddNativeMethodRegistrationAttributeScan, List<TypeDefinition> javaTypes, TypeDefinitionCache cache, string outputDirectory, bool generateNativeAssembly, ApplicationConfigTaskState appConfState)
@@ -186,7 +186,7 @@ bool GenerateDebugFiles (bool skipJniAddNativeMethodRegistrationAttributeScan, L
186186
modules.Add (moduleName, module);
187187
}
188188

189-
TypeMapDebugEntry entry = GetDebugEntry (td);
189+
TypeMapDebugEntry entry = GetDebugEntry (td, cache);
190190
HandleDebugDuplicates (javaDuplicates, entry, td, cache);
191191
if (entry.JavaName.Length > module.JavaNameWidth)
192192
module.JavaNameWidth = (uint)entry.JavaName.Length + 1;
@@ -227,7 +227,7 @@ bool GenerateDebugNativeAssembly (bool skipJniAddNativeMethodRegistrationAttribu
227227
foreach (TypeDefinition td in javaTypes) {
228228
UpdateApplicationConfig (td, appConfState);
229229

230-
TypeMapDebugEntry entry = GetDebugEntry (td);
230+
TypeMapDebugEntry entry = GetDebugEntry (td, cache);
231231
HandleDebugDuplicates (javaDuplicates, entry, td, cache);
232232

233233
javaToManaged.Add (entry);
@@ -300,10 +300,10 @@ void PrepareDebugMaps (ModuleDebugData module)
300300
}
301301
}
302302

303-
TypeMapDebugEntry GetDebugEntry (TypeDefinition td)
303+
TypeMapDebugEntry GetDebugEntry (TypeDefinition td, TypeDefinitionCache cache)
304304
{
305305
return new TypeMapDebugEntry {
306-
JavaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td),
306+
JavaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td, cache),
307307
ManagedName = GetManagedTypeName (td),
308308
TypeDefinition = td,
309309
SkipInJavaToManaged = ShouldSkipInJavaToManaged (td),
@@ -330,7 +330,7 @@ string GetManagedTypeName (TypeDefinition td)
330330
return $"{managedTypeName}, {td.Module.Assembly.Name.Name}";
331331
}
332332

333-
bool GenerateRelease (bool skipJniAddNativeMethodRegistrationAttributeScan, List<TypeDefinition> javaTypes, string outputDirectory, ApplicationConfigTaskState appConfState)
333+
bool GenerateRelease (bool skipJniAddNativeMethodRegistrationAttributeScan, List<TypeDefinition> javaTypes, TypeDefinitionCache cache, string outputDirectory, ApplicationConfigTaskState appConfState)
334334
{
335335
int assemblyId = 0;
336336
var knownAssemblies = new Dictionary<string, int> (StringComparer.Ordinal);
@@ -373,7 +373,7 @@ bool GenerateRelease (bool skipJniAddNativeMethodRegistrationAttributeScan, List
373373
tempModules.Add (moduleUUID, moduleData);
374374
}
375375

376-
string javaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td);
376+
string javaName = Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName (td, cache);
377377
// We will ignore generic types and interfaces when generating the Java to Managed map, but we must not
378378
// omit them from the table we output - we need the same number of entries in both java-to-managed and
379379
// managed-to-java tables. `SkipInJavaToManaged` set to `true` will cause the native assembly generator

0 commit comments

Comments
 (0)