diff --git a/Configuration.Override.props.in b/Configuration.Override.props.in index f7575b085a2..f25a5738995 100644 --- a/Configuration.Override.props.in +++ b/Configuration.Override.props.in @@ -6,11 +6,11 @@ kept consistent with each other, lest Bad Things Happen™ --> - 31 + 32 - v12.0 + v12.1 - 31 + 32 + 31 21 $(AndroidFirstApiLevel) - 31 + 32 $(AndroidLatestStableApiLevel) - v12.0 + v12.1 32 - Sv2 - v12.0.99 + 32 + v12.1 $(AndroidLatestStableApiLevel) $(AndroidLatestStablePlatformId) @@ -118,16 +120,24 @@ arm64-v8a;x86_64 $(AllSupported32BitTargetAndroidAbis);$(AllSupported64BitTargetAndroidAbis) - f6d24b187cc6bd534c6c37604205171784ac5621. - 91936d4ee3ccc839f0addd53c9ebf087b1e39251. + 5219cc671e844de73762e969ace287c29d2e14cd. + 210b77e4bc623bd4cdda4dae790048f227972bd2. $(XABuildToolsPackagePrefixMacOS) $(XABuildToolsPackagePrefixWindows) - 30.0.3 - 30.0.3 + 32 + 32.0.0 + + f6d24b187cc6bd534c6c37604205171784ac5621. + 91936d4ee3ccc839f0addd53c9ebf087b1e39251. + + $(XABuildTools30PackagePrefixMacOS) + $(XABuildTools30PackagePrefixWindows) + 30.0.3 + 30.0.3 e8b2b4cbe47c728c1e54c5f524440b52d4e1a33c. 31.0.3 False diff --git a/Documentation/workflow/HowToAddNewApiLevel.md b/Documentation/workflow/HowToAddNewApiLevel.md index d8fdd239207..07665812f19 100644 --- a/Documentation/workflow/HowToAddNewApiLevel.md +++ b/Documentation/workflow/HowToAddNewApiLevel.md @@ -54,13 +54,174 @@ acceptable "breaks": When Google announces that the APIs are frozen, additional work such as enumification is needed. ----- Somewhat outdated docs below, update when we do this year's stabilization ---- +There have been many, many attempts to "automate" the enumification process in the past, to varying +degrees of success. The main problem is that no automated process is going to be perfect, so +they all rely on a human verifying and modifying the results. + +However this verification process is long and tedious. Doing it correctly requires almost as much +effort as doing the full process manually. Thus it generally isn't done correctly and many errors +slip in, leaving our users with bad bindings that are hard to fix in the future without breaking API. + +Currently we have taken the opposite approach and do the process completely manually, but we +have invested in tooling to make the process as easy as possible. + +This tooling is BindingStudio: +https://github.com/jpobst/BindingStudio + +It's a Winforms app, so it only runs on Windows. It's ugly as sin, and has very poor UX. However, +it prompts you with the exact decisions you need to make, and handles as much dirty work as possible, +allowing enumification to be done in a few days. + +### Extract constants from API + +Using BindingStudio: + +- Update `CURRENT_API_LEVEL` in MainForm.cs +- Choose `Tools` -> `Add API Level Constants` + - Fill in existing `map.csv`: `xamarin-android/src/Mono.Android/map.csv` + - Fill in new `api.xml`: ex: `xamarin-android/src/Mono.Android/obj/Debug/net6.0/android-32/mcw/api.xml` +- Choose `File` -> `Save` + +This adds all the new possible constants from the API level to `map.csv`. They will be +marked with a `?` indicating no determination has been made if they should be enumified or not. + +Example: +``` +?,32,android/media/Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL,1,,,, +?,32,android/media/Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE,0,,,, +?,32,android/media/Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_OTHER,-1,,,, +``` + +### Creating enums + +Using BindingStudio: + +- Choose `File` -> `Open Constant Map` +- Choose existing `map.csv`: `xamarin-android/src/Mono.Android/map.csv` + +The left tree view will be populated with every type that has possible constants that require +a decision. Clicking a tree node will show the grid of all constants in the type. The ones +that need to be handled are the ones with `Action` = `None`. (The others are shown because +sometimes the correct action is to add a new constant to an existing enum.) + +Select the row(s) containing the constants you want to act on. (Use Control and Shift to select +multiple rows.) There are 3 possible options for constants: + +1) Ignore + +If the constant(s) should not be part of an enum (like `Math.PI`), click the `Ignore` toolbar +button to leave them as constants. + +2) Add to existing enum + +If the constant(s) should be added to an existing enum: +- Click the `Add to existing enum` toolbar button. +- The dialog will show all other enums in this type +- Choose the existing enum to add the new constant(s) to +- After accepting the dialog, you may need to click the grid to cause it to refresh +- The constant(s) will be marked as `Enumify` with the `EnumFullType` you specified +- The enum member names may need to be tweaked by changing the `EnumMember` column + +3) Create a new enum + +If the constant(s) should be added to a brand new enum: +- Click the `Create Enum` toolbar button +- In the dialog, a suggested enum namespace and name will be pre-populated. This may need to be + tweaked as needed. + - Mark `Is Flags` if this should be a `[Flags]` enum type. +- After accepting the dialog, you may need to click the grid to cause it to refresh +- The constant(s) will be marked as `Enumify` with the `EnumFullType` you specified +- The enum member names may need to be tweaked by changing the `EnumMember` column + +Once decisions have been made for all new constants in a type, use the left tree view to move +to the next type. You should periodically save your progress with `File` -> `Save` in case +BindingStudio crashes. + +The left tree view can be updated by saving and reopening the `map.csv` file. + +### Extract methods that possibly need enums -5) enumification +Using BindingStudio: -See `build-tools/enumification-helpers/README`. Usually it takes many days to complete... +- Update the file paths in `MainForm.FindAPILevelMethodsToolStripMenuItem_Click` +- Run BindingStudio and choose `Tools` -> `Find API Level Methods` -Enumification work can be delayed and only the final API has to be enumified. +This will create a file of every method in the new API level that takes an `int` as a parameter +or returns an `int` as a return value. Each method will be marked with a `?` in the file +to indicate a decision needs to be made to ignore it or map it to an enum. + +Example: +``` +?,32,android/media,AudioAttributes,getSpatializationBehavior,return, +?,32,android/media,AudioAttributes$Builder,setSpatializationBehavior,sb, +``` + +### Mapping methods + +Using BindingStudio: + +- Choose `File` -> `Open Constant Map` + - Choose existing `map.csv`: `xamarin-android/src/Mono.Android/map.csv` +- Choose `File` -> `Open Method Map` + - Choose the new `.csv` created in the previous step + +The left tree will populate with every method that possibly should be enumified and +needs a decision to be made. Clicking a method shows the Android documentation for +the method to help make the decision, as well as an area to input the decision. + +Note a method may show up multiple times, once for each parameter or return type +(Parameter Name = "return") that is an int. Each one may require a different action. + +There are 3 possible options for a method parameter/return type: + +1) Unknown + +You don't how to handle this method currently, so leaving it in the initial state +of "Unknown" will leave it alone until a decision can be made. + +2) Ignore + +The method parameter/return type should remain an `int` and not be converted to an enum. + +Ex: +``` +int Add (int value1, int value2) { ... } +``` + +Click the "Ignore" radio button and then the "Save" button. + +3) Enumify + +The method parameter/return type should be changed to an enum. + +Ex: +``` +void AudioAttributesBuilder.SetSpatializationBehavior (int sb) { ... } +``` + +- Choose the "Enumify" radio option +- Use the DropDown in the middle to select the enum to use + - When selected, the members of that enum will be shown in the box below the enum +- Alternatively, search for a enum by enum member name using the Search box in the right + - If desired enum is found, clicking it will populate dropdown +- Click "Save" + +Use `File` -> `Save` to save your work often! + +### Finishing the method map + +The official `methodmap.csv` uses a slightly different format than the one used for enumification. + +Using BindingStudio: +- Ensure the "new api level method map" CSV file is loaded. +- Choose `Tools` -> `Export Final Method Map` +- Choose a temporary file name +- Open the temporary file, copy the contents to the bottom of the official: + - xamarin-android/src/Mono.Android/methodmap.csv + +Congrats! Enumification is complete! + +---- Somewhat outdated docs below, update when we do this year's stabilization ---- 6) new AndroidManifest.xml elements and attributes diff --git a/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs b/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs index 263f6ba221f..8f8fc19b3b6 100644 --- a/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs +++ b/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs @@ -29,7 +29,7 @@ public sealed class CheckApiCompatibility : Task { "v10.0", "v9.0" }, { "v11.0", "v10.0" }, { "v12.0", "v11.0" }, - { "v12.0.99", "v12.0" }, + { "v12.1", "v12.0" }, }; static readonly string assemblyToValidate = "Mono.Android.dll"; diff --git a/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/GenerateSupportedPlatforms.cs b/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/GenerateSupportedPlatforms.cs index f6a91bfd706..9d3d6d0e0ae 100644 --- a/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/GenerateSupportedPlatforms.cs +++ b/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/GenerateSupportedPlatforms.cs @@ -31,9 +31,15 @@ public class GenerateSupportedPlatforms : Task [Required] public int MinimumApiLevel { get; set; } + /// + /// Default value for $(TargetPlatformVersion), defaults to MaxStableVersion.ApiLevel + /// + public int TargetApiLevel { get; set; } + public override bool Execute () { var versions = new AndroidVersions (AndroidApiInfo.Select (ToVersion)); + int targetApiLevel = TargetApiLevel > 0 ? TargetApiLevel : versions.MaxStableVersion.ApiLevel; var settings = new XmlWriterSettings { OmitXmlDeclaration = true, Indent = true, @@ -56,7 +62,7 @@ public override bool Execute () writer.WriteEndElement (); // writer.WriteStartElement ("TargetPlatformVersion"); writer.WriteAttributeString ("Condition", " '$(TargetPlatformVersion)' == '' "); - writer.WriteString (versions.MaxStableVersion.ApiLevel.ToString ("0.0", CultureInfo.InvariantCulture)); + writer.WriteString (targetApiLevel.ToString ("0.0", CultureInfo.InvariantCulture)); writer.WriteEndElement (); // writer.WriteStartElement ("AndroidMinimumSupportedApiLevel"); writer.WriteAttributeString ("Condition", " '$(AndroidMinimumSupportedApiLevel)' == '' "); diff --git a/build-tools/api-merge/merge-configuration.xml b/build-tools/api-merge/merge-configuration.xml index d79b02c90cb..6cc9ce1595d 100644 --- a/build-tools/api-merge/merge-configuration.xml +++ b/build-tools/api-merge/merge-configuration.xml @@ -20,7 +20,7 @@ - + @@ -36,6 +36,6 @@ - + \ No newline at end of file diff --git a/build-tools/api-xml-adjuster/Makefile b/build-tools/api-xml-adjuster/Makefile index d319d763dad..9a75ef399c1 100644 --- a/build-tools/api-xml-adjuster/Makefile +++ b/build-tools/api-xml-adjuster/Makefile @@ -17,7 +17,7 @@ API_XML_TOOL = $(BUILDBIN)/api-xml-adjuster.exe RUNTIME = mono --debug RUN_CLASS_PARSE = $(RUNTIME) $(CLASS_PARSE) RUN_API_XML_TOOL = $(RUNTIME) $(API_XML_TOOL) -API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Sv2 +API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 XML_OUTPUT_DIR = . diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets index c3e1d2bf301..8d2afd0f773 100644 --- a/build-tools/create-packs/Directory.Build.targets +++ b/build-tools/create-packs/Directory.Build.targets @@ -120,6 +120,8 @@ <_NuGetSources Include="$(OutputPath.TrimEnd('\'))" /> <_PreviewPacks Condition=" '$(AndroidLatestStableApiLevel)' != '$(AndroidLatestUnstableApiLevel)' " Include="$(XamarinAndroidSourcePath)bin\Build$(Configuration)\nuget-unsigned\Microsoft.Android.Ref.$(AndroidLatestUnstableApiLevel).*.nupkg" /> <_InstallArguments Include="android-aot" /> + + <_InstallArguments Include="android-32" /> <_InstallArguments Include="android-$(AndroidLatestUnstableApiLevel)" Condition=" '@(_PreviewPacks->Count())' != '0' " /> <_InstallArguments Include="--skip-manifest-update" /> <_InstallArguments Include="--verbosity diag" /> diff --git a/build-tools/create-packs/Microsoft.Android.Sdk.proj b/build-tools/create-packs/Microsoft.Android.Sdk.proj index a0d84046fc7..4cb65c7ca39 100644 --- a/build-tools/create-packs/Microsoft.Android.Sdk.proj +++ b/build-tools/create-packs/Microsoft.Android.Sdk.proj @@ -118,18 +118,23 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and $(AndroidPackVersionLong) $(AndroidPackVersionLong) - <_AndroidRuntimePackId Condition=" '%24(TargetPlatformVersion)' != '$(AndroidLatestUnstableApiLevel).0' ">$(AndroidLatestStableApiLevel) - <_AndroidRuntimePackId Condition=" '%24(TargetPlatformVersion)' == '$(AndroidLatestUnstableApiLevel).0' ">$(AndroidLatestUnstableApiLevel) + + + <_AndroidRuntimePackId>31 + <_AndroidRuntimePackVersion>31.0.101-preview.11.117 + + + <_AndroidRuntimePackId Condition=" '%24(_AndroidRuntimePackId)' == '' ">$(AndroidLatestStableApiLevel) + <_AndroidRuntimePackVersion Condition=" '%24(_AndroidRuntimePackVersion)' == '' ">**FromWorkload** ArchAPILevels = new Dictionary (StringComparer.Ordinal) { diff --git a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs index 71fa97df191..4cdce72dd67 100644 --- a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs +++ b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs @@ -5,6 +5,7 @@ static class KnownProperties public const string AndroidCmakeUrlPrefix = "AndroidCmakeUrlPrefix"; public const string AndroidCmakeVersion = "AndroidCmakeVersion"; public const string AndroidCmakeVersionPath = "AndroidCmakeVersionPath"; + public const string AndroidDefaultTargetDotnetApiLevel = "AndroidDefaultTargetDotnetApiLevel"; public const string AndroidLatestStableApiLevel = "AndroidLatestStableApiLevel"; public const string AndroidLatestStableFrameworkVersion = "AndroidLatestStableFrameworkVersion"; public const string AndroidMxeFullPath = "AndroidMxeFullPath"; @@ -56,6 +57,12 @@ static class KnownProperties public const string XABuildToolsPackagePrefixWindows = "XABuildToolsPackagePrefixWindows"; public const string XABuildToolsPackagePrefixLinux = "XABuildToolsPackagePrefixLinux"; public const string XABuildToolsPackagePrefix = "XABuildToolsPackagePrefix"; + public const string XABuildTools30Folder = "XABuildTools30Folder"; + public const string XABuildTools30Version = "XABuildTools30Version"; + public const string XABuildTools30PackagePrefixMacOS = "XABuildTools30PackagePrefixMacOS"; + public const string XABuildTools30PackagePrefixWindows = "XABuildTools30PackagePrefixWindows"; + public const string XABuildTools30PackagePrefixLinux = "XABuildTools30PackagePrefixLinux"; + public const string XABuildTools30PackagePrefix = "XABuildTools30PackagePrefix"; public const string XABinRelativeInstallPrefix = "XABinRelativeInstallPrefix"; public const string XAInstallPrefix = "XAInstallPrefix"; public const string XAPlatformToolsVersion = "XAPlatformToolsVersion"; diff --git a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in index f00e282ea4a..1da4657579d 100644 --- a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in +++ b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in @@ -9,6 +9,7 @@ namespace Xamarin.Android.Prepare properties.Add (KnownProperties.AndroidCmakeUrlPrefix, StripQuotes ("@AndroidCmakeUrlPrefix@")); properties.Add (KnownProperties.AndroidCmakeVersion, StripQuotes ("@AndroidCmakeVersion@")); properties.Add (KnownProperties.AndroidCmakeVersionPath, StripQuotes (@"@AndroidCmakeVersionPath@")); + properties.Add (KnownProperties.AndroidDefaultTargetDotnetApiLevel, StripQuotes ("@AndroidDefaultTargetDotnetApiLevel@")); properties.Add (KnownProperties.AndroidLatestStableApiLevel, StripQuotes ("@AndroidLatestStableApiLevel@")); properties.Add (KnownProperties.AndroidLatestStableFrameworkVersion, StripQuotes ("@AndroidLatestStableFrameworkVersion@")); properties.Add (KnownProperties.AndroidMxeFullPath, StripQuotes (@"@AndroidMxeFullPath@")); @@ -60,6 +61,12 @@ namespace Xamarin.Android.Prepare properties.Add (KnownProperties.XABuildToolsPackagePrefixWindows, StripQuotes ("@XABuildToolsPackagePrefixWindows@")); properties.Add (KnownProperties.XABuildToolsPackagePrefixLinux, StripQuotes ("@XABuildToolsPackagePrefixLinux@")); properties.Add (KnownProperties.XABuildToolsPackagePrefix, StripQuotes ("@XABuildToolsPackagePrefix@")); + properties.Add (KnownProperties.XABuildTools30Folder, StripQuotes (@"@XABuildTools30Folder@")); + properties.Add (KnownProperties.XABuildTools30Version, StripQuotes ("@XABuildTools30Version@")); + properties.Add (KnownProperties.XABuildTools30PackagePrefixMacOS, StripQuotes ("@XABuildTools30PackagePrefixMacOS@")); + properties.Add (KnownProperties.XABuildTools30PackagePrefixWindows, StripQuotes ("@XABuildTools30PackagePrefixWindows@")); + properties.Add (KnownProperties.XABuildTools30PackagePrefixLinux, StripQuotes ("@XABuildTools30PackagePrefixLinux@")); + properties.Add (KnownProperties.XABuildTools30PackagePrefix, StripQuotes ("@XABuildTools30PackagePrefix@")); properties.Add (KnownProperties.XABinRelativeInstallPrefix, StripQuotes (@"@XABinRelativeInstallPrefix@")); properties.Add (KnownProperties.XAInstallPrefix, StripQuotes (@"@XAInstallPrefix@")); properties.Add (KnownProperties.XAPlatformToolsVersion, StripQuotes ("@XAPlatformToolsVersion@")); diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs index 47a8edf7276..b388d81e2ed 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs @@ -40,7 +40,7 @@ class BuildAndroidPlatforms new AndroidPlatform (apiName: "Q", apiLevel: 29, platformID: "29", include: "v10.0", framework: "v10.0"), new AndroidPlatform (apiName: "R", apiLevel: 30, platformID: "30", include: "v11.0", framework: "v11.0"), new AndroidPlatform (apiName: "S", apiLevel: 31, platformID: "31", include: "v12.0", framework: "v12.0"), - new AndroidPlatform (apiName: "Sv2", apiLevel: 32, platformID: "Sv2", include: "v12.0.99",framework: "v12.0.99", stable: false), + new AndroidPlatform (apiName: "Sv2", apiLevel: 32, platformID: "32", include: "v12.1", framework: "v12.1"), }; // These are here until we can drop "legacy" targets and use only .NET6+ diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs index 31b2a3eded5..66293dd0e01 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs @@ -23,8 +23,11 @@ public AndroidToolchain () string EmulatorVersion = GetRequiredProperty (KnownProperties.EmulatorVersion); string EmulatorPkgRevision = GetRequiredProperty (KnownProperties.EmulatorPkgRevision); string XABuildToolsFolder = GetRequiredProperty (KnownProperties.XABuildToolsFolder); - string XABuildToolsVersion = GetRequiredProperty (KnownProperties.XABuildToolsVersion); - string XABuildToolsPackagePrefix = Context.Instance.Properties [KnownProperties.XABuildToolsPackagePrefix] ?? String.Empty; + string XABuildToolsVersion = GetRequiredProperty (KnownProperties.XABuildToolsVersion); + string XABuildToolsPackagePrefix = Context.Instance.Properties [KnownProperties.XABuildToolsPackagePrefix] ?? String.Empty; + string XABuildTools30Folder = GetRequiredProperty (KnownProperties.XABuildTools30Folder); + string XABuildTools30Version = GetRequiredProperty (KnownProperties.XABuildTools30Version); + string XABuildTools30PackagePrefix = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefix] ?? String.Empty; string XAPlatformToolsVersion = GetRequiredProperty (KnownProperties.XAPlatformToolsVersion); string XAPlatformToolsPackagePrefix = Context.Instance.Properties [KnownProperties.XAPlatformToolsPackagePrefix] ?? String.Empty; @@ -63,7 +66,7 @@ public AndroidToolchain () new AndroidPlatformComponent ("platform-29_r01", apiLevel: "29", pkgRevision: "1"), new AndroidPlatformComponent ("platform-30_r01", apiLevel: "30", pkgRevision: "1"), new AndroidPlatformComponent ("platform-31_r01", apiLevel: "31", pkgRevision: "1"), - new AndroidPlatformComponent ("platform-Sv2_r01", apiLevel: "Sv2", pkgRevision: "1"), + new AndroidPlatformComponent ("platform-32_r01", apiLevel: "32", pkgRevision: "1"), new AndroidToolchainComponent ("sources-31_r01", destDir: Path.Combine ("platforms", $"android-31", "src"), pkgRevision: "1", dependencyType: AndroidToolchainComponentType.BuildDependency), @@ -72,6 +75,7 @@ public AndroidToolchain () new AndroidToolchainComponent ($"x86_64-29_r07-{osTag}", destDir: Path.Combine ("system-images", "android-29", "default", "x86_64"), relativeUrl: new Uri ("sys-img/android/", UriKind.Relative), pkgRevision: "7", dependencyType: AndroidToolchainComponentType.EmulatorDependency), new AndroidToolchainComponent ($"android-ndk-r{AndroidNdkVersion}-{osTag}", destDir: AndroidNdkDirectory, pkgRevision: AndroidPkgRevision), new AndroidToolchainComponent ($"{XABuildToolsPackagePrefix}build-tools_r{XABuildToolsVersion}-{altOsTag}", destDir: Path.Combine ("build-tools", XABuildToolsFolder), isMultiVersion: true), + new AndroidToolchainComponent ($"{XABuildTools30PackagePrefix}build-tools_r{XABuildTools30Version}-{altOsTag}", destDir: Path.Combine ("build-tools", XABuildTools30Folder), isMultiVersion: true), new AndroidToolchainComponent ($"commandlinetools-{cltOsTag}-{CommandLineToolsVersion}", destDir: Path.Combine ("cmdline-tools", CommandLineToolsFolder), isMultiVersion: true), new AndroidToolchainComponent ($"{XAPlatformToolsPackagePrefix}platform-tools_r{XAPlatformToolsVersion}-{osTag}", destDir: "platform-tools", pkgRevision: XAPlatformToolsVersion), diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index c27d610e1f2..88d629fa225 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -166,6 +166,7 @@ GeneratedFile Get_XABuildConfig_cs (Context context) { "@NDK_X86_API@", BuildAndroidPlatforms.NdkMinimumAPI [AbiNames.TargetJit.AndroidX86].ToString () }, { "@NDK_X86_64_API@", BuildAndroidPlatforms.NdkMinimumAPI [AbiNames.TargetJit.AndroidX86_64].ToString () }, { "@XA_SUPPORTED_ABIS@", context.Properties.GetRequiredValue (KnownProperties.AndroidSupportedTargetJitAbis).Replace (':', ';') }, + { "@ANDROID_DEFAULT_TARGET_DOTNET_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidDefaultTargetDotnetApiLevel) }, { "@ANDROID_LATEST_STABLE_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidLatestStableApiLevel) }, }; diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs b/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs index ee0cff61fb5..ffebbf4e2cb 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs @@ -21,6 +21,17 @@ public Step_Get_Android_BuildTools () packages.Add ((package: $"build-tools_r{XABuildToolsVersion}-macosx.zip", prefix: XABuildToolsPackagePrefixMacOS)); packages.Add ((package: $"build-tools_r{XABuildToolsVersion}-windows.zip", prefix: XABuildToolsPackagePrefixWindows)); packages.Add ((package: $"build-tools_r{XABuildToolsVersion}-linux.zip", prefix: XABuildToolsPackagePrefixLinux)); + + // build-tools 30, for DX tests + string XABuildTools30Version = Context.Instance.Properties [KnownProperties.XABuildTools30Version] ?? String.Empty; + string XABuildTools30PackagePrefixMacOS = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefixMacOS] ?? string.Empty; + string XABuildTools30PackagePrefixWindows = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefixWindows] ?? string.Empty; + string XABuildTools30PackagePrefixLinux = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefixLinux] ?? string.Empty; + if (!string.IsNullOrEmpty (XABuildTools30Version)) { + packages.Add ((package: $"build-tools_r{XABuildTools30Version}-macosx.zip", prefix: XABuildTools30PackagePrefixMacOS)); + packages.Add ((package: $"build-tools_r{XABuildTools30Version}-windows.zip", prefix: XABuildTools30PackagePrefixWindows)); + packages.Add ((package: $"build-tools_r{XABuildTools30Version}-linux.zip", prefix: XABuildTools30PackagePrefixLinux)); + } } protected override async Task Execute (Context context) diff --git a/build-tools/xaprepare/xaprepare/xaprepare.targets b/build-tools/xaprepare/xaprepare/xaprepare.targets index 1921c976a9f..60d7bcae915 100644 --- a/build-tools/xaprepare/xaprepare/xaprepare.targets +++ b/build-tools/xaprepare/xaprepare/xaprepare.targets @@ -43,6 +43,7 @@ + @@ -93,6 +94,12 @@ + + + + + + diff --git a/src/Mono.Android/Profiles/api-Sv2.params.txt b/src/Mono.Android/Profiles/api-32.params.txt similarity index 99% rename from src/Mono.Android/Profiles/api-Sv2.params.txt rename to src/Mono.Android/Profiles/api-32.params.txt index 02708bec630..725b0bf661d 100644 --- a/src/Mono.Android/Profiles/api-Sv2.params.txt +++ b/src/Mono.Android/Profiles/api-32.params.txt @@ -6856,6 +6856,9 @@ package android.hardware.camera2.params copyElements(int[] destination, int offset) equals(java.lang.Object obj) getElement(int column, int row) + class DeviceStateSensorOrientationMap + equals(java.lang.Object obj) + getSensorOrientation(long deviceState) class ExtensionSessionConfiguration #ctor(int extension, java.util.List outputs, java.util.concurrent.Executor executor, android.hardware.camera2.CameraExtensionSession.StateCallback listener) class InputConfiguration @@ -18985,12 +18988,12 @@ package android.view interface ActionProvider.VisibilityListener onActionProviderVisibilityChanged(boolean isVisible) interface AttachedSurfaceControl - addOnSurfaceTransformHintChangedListener(android.view.AttachedSurfaceControl.OnSurfaceTransformHintChangedListener listener) + addOnBufferTransformHintChangedListener(android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener listener) applyTransactionOnDraw(android.view.SurfaceControl.Transaction t) buildReparentTransaction(android.view.SurfaceControl child) - removeOnSurfaceTransformHintChangedListener(android.view.AttachedSurfaceControl.OnSurfaceTransformHintChangedListener listener) - interface AttachedSurfaceControl.OnSurfaceTransformHintChangedListener - onSurfaceTransformHintChanged(int hint) + removeOnBufferTransformHintChangedListener(android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener listener) + interface AttachedSurfaceControl.OnBufferTransformHintChangedListener + onBufferTransformHintChanged(int hint) class Choreographer postFrameCallback(android.view.Choreographer.FrameCallback callback) postFrameCallbackDelayed(android.view.Choreographer.FrameCallback callback, long delayMillis) diff --git a/src/Mono.Android/map.csv b/src/Mono.Android/map.csv index cb80905c0b0..33872554b8f 100644 --- a/src/Mono.Android/map.csv +++ b/src/Mono.Android/map.csv @@ -3418,6 +3418,8 @@ A,0,,0,Android.Media.AudioFlags,None,, E,21,android/media/AudioAttributes.FLAG_AUDIBILITY_ENFORCED,1,Android.Media.AudioFlags,AudibilityEnforced,keep, E,21,android/media/AudioAttributes.FLAG_HW_AV_SYNC,16,Android.Media.AudioFlags,HwAvSync,keep, E,24,android/media/AudioAttributes.FLAG_LOW_LATENCY,256,Android.Media.AudioFlags,LowLatency,keep, +E,32,android/media/AudioAttributes.SPATIALIZATION_BEHAVIOR_AUTO,0,Android.Media.AudioSpatializationBehavior,Auto,remove, +E,32,android/media/AudioAttributes.SPATIALIZATION_BEHAVIOR_NEVER,1,Android.Media.AudioSpatializationBehavior,Never,remove, E,21,android/media/AudioAttributes.USAGE_ALARM,4,Android.Media.AudioUsageKind,Alarm,keep, E,21,android/media/AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY,11,Android.Media.AudioUsageKind,AssistanceAccessibility,keep, E,21,android/media/AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE,12,Android.Media.AudioUsageKind,AssistanceNavigationGuidance,keep, @@ -3490,24 +3492,45 @@ E,10,android/media/AudioFormat.CHANNEL_IN_Z_AXIS,8192,Android.Media.ChannelIn,ZA I,0,android/media/AudioFormat.CHANNEL_INVALID,0,,,, A,0,,0,Android.Media.ChannelOut,None,, E,10,android/media/AudioFormat.CHANNEL_OUT_5POINT1,252,Android.Media.ChannelOut,FivePointOne,keep, -E,10,android/media/AudioFormat.CHANNEL_OUT_7POINT1,1020,Android.Media.ChannelOut,SevenPointOne,keep, +E,32,android/media/AudioFormat.CHANNEL_OUT_5POINT1POINT2,3145980,Android.Media.ChannelOut,FivePointOnePointTwo,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_5POINT1POINT4,737532,Android.Media.ChannelOut,FivePointOnePointFour,remove, +E,10,android/media/AudioFormat.CHANNEL_OUT_7POINT1,1020,Android.Media.ChannelOut,SevenPointOne,remove, E,23,android/media/AudioFormat.CHANNEL_OUT_7POINT1_SURROUND,6396,Android.Media.ChannelOut,C7point1Surround,keep, +E,32,android/media/AudioFormat.CHANNEL_OUT_7POINT1POINT2,3152124,Android.Media.ChannelOut,SevenPointOnePointTwo,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_7POINT1POINT4,743676,Android.Media.ChannelOut,SevenPointOnePointFour,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_9POINT1POINT4,202070268,Android.Media.ChannelOut,NinePointOnePointFour,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_9POINT1POINT6,205215996,Android.Media.ChannelOut,NinePointOnePointSix,remove, E,10,android/media/AudioFormat.CHANNEL_OUT_BACK_CENTER,1024,Android.Media.ChannelOut,BackCenter,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_BACK_LEFT,64,Android.Media.ChannelOut,BackLeft,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_BACK_RIGHT,128,Android.Media.ChannelOut,BackRight,keep, +E,32,android/media/AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_CENTER,8388608,Android.Media.ChannelOut,BottomFrontCenter,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_LEFT,4194304,Android.Media.ChannelOut,BottomFrontLeft,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_RIGHT,16777216,Android.Media.ChannelOut,BottomFrontRight,remove, E,10,android/media/AudioFormat.CHANNEL_OUT_DEFAULT,1,Android.Media.ChannelOut,Default,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_FRONT_CENTER,16,Android.Media.ChannelOut,FrontCenter,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_FRONT_LEFT,4,Android.Media.ChannelOut,FrontLeft,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_FRONT_LEFT_OF_CENTER,256,Android.Media.ChannelOut,FrontLeftOfCenter,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_FRONT_RIGHT,8,Android.Media.ChannelOut,FrontRight,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_FRONT_RIGHT_OF_CENTER,512,Android.Media.ChannelOut,FrontRightOfCenter,keep, +E,32,android/media/AudioFormat.CHANNEL_OUT_FRONT_WIDE_LEFT,67108864,Android.Media.ChannelOut,FrontWideLeft,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_FRONT_WIDE_RIGHT,134217728,Android.Media.ChannelOut,FrontWideRight,remove, E,10,android/media/AudioFormat.CHANNEL_OUT_LOW_FREQUENCY,32,Android.Media.ChannelOut,LowFrequency,keep, +E,32,android/media/AudioFormat.CHANNEL_OUT_LOW_FREQUENCY_2,33554432,Android.Media.ChannelOut,LowFrequency2,remove, E,10,android/media/AudioFormat.CHANNEL_OUT_MONO,4,Android.Media.ChannelOut,Mono,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_QUAD,204,Android.Media.ChannelOut,Quad,keep, E,21,android/media/AudioFormat.CHANNEL_OUT_SIDE_LEFT,2048,Android.Media.ChannelOut,SideLeft,keep, E,21,android/media/AudioFormat.CHANNEL_OUT_SIDE_RIGHT,4096,Android.Media.ChannelOut,SideRight,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_STEREO,12,Android.Media.ChannelOut,Stereo,keep, E,10,android/media/AudioFormat.CHANNEL_OUT_SURROUND,1052,Android.Media.ChannelOut,Surround,keep, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_BACK_CENTER,262144,Android.Media.ChannelOut,OutTopBackCenter,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_BACK_LEFT,131072,Android.Media.ChannelOut,OutTopBackLeft,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_BACK_RIGHT,524288,Android.Media.ChannelOut,OutTopBackRight,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_CENTER,8192,Android.Media.ChannelOut,OutTopCenter,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_FRONT_CENTER,32768,Android.Media.ChannelOut,OutTopFrontCenter,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_FRONT_LEFT,16384,Android.Media.ChannelOut,OutTopFrontLeft,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_FRONT_RIGHT,65536,Android.Media.ChannelOut,OutTopFrontRight,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_SIDE_LEFT,1048576,Android.Media.ChannelOut,OutTopSideLeft,remove, +E,32,android/media/AudioFormat.CHANNEL_OUT_TOP_SIDE_RIGHT,2097152,Android.Media.ChannelOut,OutTopSideRight,remove, E,28,android/media/AudioFormat.ENCODING_AAC_ELD,15,Android.Media.Encoding,AacEld,keep, E,28,android/media/AudioFormat.ENCODING_AAC_HE_V1,11,Android.Media.Encoding,AacHeV1,keep, E,28,android/media/AudioFormat.ENCODING_AAC_HE_V2,12,Android.Media.Encoding,AacHeV2,keep, @@ -4545,6 +4568,9 @@ I,29,android/media/Session2Command$Result.RESULT_INFO_SKIPPED,1,,,, I,29,android/media/Session2Command$Result.RESULT_SUCCESS,0,,,, E,29,android/media/Session2Token.TYPE_SESSION,0,Android.Media.MediaSessionType,Session,remove, E,29,android/media/Session2Token.TYPE_SESSION_SERVICE,1,Android.Media.MediaSessionType,SessionService,remove, +E,32,android/media/Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL,1,Android.Media.SpatializerImmersiveLevel,Multichannel,remove, +E,32,android/media/Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE,0,Android.Media.SpatializerImmersiveLevel,None,remove, +E,32,android/media/Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_OTHER,-1,Android.Media.SpatializerImmersiveLevel,Other,remove, E,23,android/media/SyncParams.AUDIO_ADJUST_MODE_DEFAULT,0,Android.Media.AudioAdjustMode,Default,keep, E,23,android/media/SyncParams.AUDIO_ADJUST_MODE_RESAMPLE,2,Android.Media.AudioAdjustMode,Resample,keep, E,23,android/media/SyncParams.AUDIO_ADJUST_MODE_STRETCH,1,Android.Media.AudioAdjustMode,Stretch,keep, @@ -7310,6 +7336,7 @@ E,28,android/os/Build$VERSION_CODES.P,28,Android.OS.BuildVersionCodes,P,remove, E,29,android/os/Build$VERSION_CODES.Q,29,Android.OS.BuildVersionCodes,Q,remove, E,30,android/os/Build$VERSION_CODES.R,30,Android.OS.BuildVersionCodes,R,remove, E,31,android/os/Build$VERSION_CODES.S,31,Android.OS.BuildVersionCodes,S,remove, +E,32,android/os/Build$VERSION_CODES.S_V2,32,Android.OS.BuildVersionCodes,SV2,remove, A,0,,0,Android.OS.DebugShow,Default,remove, E,10,android/os/Debug.SHOW_CLASSLOADER,2,Android.OS.DebugShow,Classloader,remove, E,10,android/os/Debug.SHOW_FULL_DETAIL,1,Android.OS.DebugShow,FullDetail,remove, @@ -8907,6 +8934,7 @@ I,25,android/R$attr.shortcutId,16844072,,,, I,25,android/R$attr.shortcutLongLabel,16844074,,,, I,25,android/R$attr.shortcutShortLabel,16844073,,,, I,0,android/R$attr.shouldDisableView,16843246,,,, +I,32,android/R$attr.shouldUseDefaultUnfoldTransition,16844364,,,, I,15,android/R$attr.showAsAction,16843481,,,, I,0,android/R$attr.showDefault,16843258,,,, I,15,android/R$attr.showDividers,16843561,,,, @@ -9598,6 +9626,9 @@ I,0,android/R$drawable.title_bar_tall,17301670,,,, I,0,android/R$drawable.toast_frame,17301654,,,, I,0,android/R$drawable.zoom_plate,17301655,,,, I,23,android/R$id.accessibilityActionContextClick,16908348,,,, +I,32,android/R$id.accessibilityActionDragCancel,16908375,,,, +I,32,android/R$id.accessibilityActionDragDrop,16908374,,,, +I,32,android/R$id.accessibilityActionDragStart,16908373,,,, I,28,android/R$id.accessibilityActionHideTooltip,16908357,,,, I,30,android/R$id.accessibilityActionImeEnter,16908372,,,, I,26,android/R$id.accessibilityActionMoveWindow,16908354,,,, @@ -12577,6 +12608,9 @@ E,10,android/util/TypedValue.TYPE_NULL,0,Android.Util.DataType,Null,keep, E,10,android/util/TypedValue.TYPE_REFERENCE,1,Android.Util.DataType,Reference,keep, E,10,android/util/TypedValue.TYPE_STRING,3,Android.Util.DataType,String,keep, E,19,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION,4,Android.Views.Accessibility.ContentChangeTypes,ContentDescription,remove, +E,32,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_DRAG_CANCELLED,512,Android.Views.Accessibility.ContentChangeTypes,DragCancelled,remove, +E,32,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_DRAG_DROPPED,256,Android.Views.Accessibility.ContentChangeTypes,DragDropped,remove, +E,32,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_DRAG_STARTED,128,Android.Views.Accessibility.ContentChangeTypes,DragStarted,remove, E,28,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_APPEARED,16,Android.Views.Accessibility.ContentChangeTypes,PaneAppeared,remove, E,28,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED,32,Android.Views.Accessibility.ContentChangeTypes,PaneDisappeared,remove, E,28,android/view/accessibility/AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_TITLE,8,Android.Views.Accessibility.ContentChangeTypes,PaneTitle,remove, @@ -13371,6 +13405,12 @@ I,0,android/view/Surface.SURFACE_BLUR_FREEZE,16,,,, I,0,android/view/Surface.SURFACE_DITHER,4,,,, I,0,android/view/Surface.SURFACE_FROZEN,2,,,, I,0,android/view/Surface.SURFACE_HIDDEN,1,,,, +E,32,android/view/SurfaceControl.BUFFER_TRANSFORM_IDENTITY,0,Android.Views.BufferTransform,Identity,remove, +E,32,android/view/SurfaceControl.BUFFER_TRANSFORM_MIRROR_HORIZONTAL,1,Android.Views.BufferTransform,MirrorHorizontal,remove, +E,32,android/view/SurfaceControl.BUFFER_TRANSFORM_MIRROR_VERTICAL,2,Android.Views.BufferTransform,MirrorVertical,remove, +E,32,android/view/SurfaceControl.BUFFER_TRANSFORM_ROTATE_180,3,Android.Views.BufferTransform,Rotate180,remove, +E,32,android/view/SurfaceControl.BUFFER_TRANSFORM_ROTATE_270,7,Android.Views.BufferTransform,Rotate270,remove, +E,32,android/view/SurfaceControl.BUFFER_TRANSFORM_ROTATE_90,4,Android.Views.BufferTransform,Rotate90,remove, E,28,android/view/textclassifier/SelectionEvent.ACTION_ABANDON,107,Android.Views.TextClassifiers.SelectionAction,Abandon,remove, E,28,android/view/textclassifier/SelectionEvent.ACTION_COPY,101,Android.Views.TextClassifiers.SelectionAction,Copy,remove, E,28,android/view/textclassifier/SelectionEvent.ACTION_CUT,103,Android.Views.TextClassifiers.SelectionAction,Cut,remove, @@ -13459,6 +13499,7 @@ E,26,android/view/View.AUTOFILL_TYPE_LIST,3,Android.Views.AutofillType,List,remo E,26,android/view/View.AUTOFILL_TYPE_NONE,0,Android.Views.AutofillType,None,remove, E,26,android/view/View.AUTOFILL_TYPE_TEXT,1,Android.Views.AutofillType,Text,remove, E,26,android/view/View.AUTOFILL_TYPE_TOGGLE,2,Android.Views.AutofillType,Toggle,remove, +E,32,android/view/View.DRAG_FLAG_ACCESSIBILITY_ACTION,1024,Android.Views.DragFlags,AccessibilityAction,remove, E,24,android/view/View.DRAG_FLAG_GLOBAL,256,Android.Views.DragFlags,Global,remove, E,24,android/view/View.DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION,64,Android.Views.DragFlags,GlobalPersistableUriPermission,remove, E,24,android/view/View.DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION,128,Android.Views.DragFlags,GlobalPrefixUriPermission,remove, diff --git a/src/Mono.Android/methodmap.csv b/src/Mono.Android/methodmap.csv index dfd16940d0a..ae018e72ec8 100644 --- a/src/Mono.Android/methodmap.csv +++ b/src/Mono.Android/methodmap.csv @@ -3237,3 +3237,10 @@ 31,android/widget,RemoteViews,setViewLayoutWidth,units,Android.Util.ComplexUnitType 31,android/widget,RemoteViews,setViewOutlinePreferredRadius,units,Android.Util.ComplexUnitType 31,android/widget,RemoteViews$RemoteCollectionItems,writeToParcel,flags,Android.OS.ParcelableWriteFlags + +32,android/media,AudioAttributes,getSpatializationBehavior,return,Android.Media.AudioSpatializationBehavior +32,android/media,AudioAttributes$Builder,setSpatializationBehavior,sb,Android.Media.AudioSpatializationBehavior +32,android/media,Spatializer,getImmersiveAudioLevel,return,Android.Media.SpatializerImmersiveLevel +32,android/service/voice,VisibleActivityInfo,writeToParcel,flags,Android.OS.ParcelableWriteFlags +32,android/view,I:AttachedSurfaceControl,getBufferTransformHint,return,Android.Views.BufferTransform +32,android/view,I:AttachedSurfaceControl$OnBufferTransformHintChangedListener,onBufferTransformHintChanged,p0,Android.Views.BufferTransform diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets index d0e154d6c20..f914dba459a 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets @@ -22,8 +22,8 @@ /> - + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 6df0aa36022..638dda446ef 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -16,7 +16,7 @@ "extends" : [ "microsoft-net-runtime-android" ] }, "android-32": { - "description": "Preview support for Android API-32.", + "description": "Support for Android API-32.", "packs": [ "Microsoft.Android.Ref.32", "Microsoft.Android.Runtime.32.android-arm", @@ -47,23 +47,23 @@ }, "Microsoft.Android.Ref.31": { "kind": "framework", - "version": "@WORKLOAD_VERSION@" + "version": "31.0.101-preview.11.117" }, "Microsoft.Android.Runtime.31.android-arm": { "kind": "framework", - "version": "@WORKLOAD_VERSION@" + "version": "31.0.101-preview.11.117" }, "Microsoft.Android.Runtime.31.android-arm64": { "kind": "framework", - "version": "@WORKLOAD_VERSION@" + "version": "31.0.101-preview.11.117" }, "Microsoft.Android.Runtime.31.android-x86": { "kind": "framework", - "version": "@WORKLOAD_VERSION@" + "version": "31.0.101-preview.11.117" }, "Microsoft.Android.Runtime.31.android-x64": { "kind": "framework", - "version": "@WORKLOAD_VERSION@" + "version": "31.0.101-preview.11.117" }, "Microsoft.Android.Ref.32": { "kind": "framework", diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs index 90080bcaad5..86e7b78d6e4 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Xml.Linq; using NUnit.Framework; +using Xamarin.Android.Tools; using Xamarin.ProjectTools; namespace Xamarin.Android.Build.Tests @@ -95,7 +96,7 @@ public void GetDependencyWhenBuildToolsAreMissingTest () builder.Target = "GetAndroidDependencies"; Assert.True (builder.Build (proj, parameters: parameters), string.Format ("First Build should have succeeded")); - int apiLevel = Builder.UseDotNet ? AndroidSdkResolver.GetMaxInstalledPlatform () : 26; + int apiLevel = Builder.UseDotNet ? XABuildConfig.AndroidDefaultTargetDotnetApiLevel : 26; StringAssertEx.Contains ($"platforms/android-{apiLevel}", builder.LastBuildOutput, $"platforms/android-{apiLevel} should be a dependency."); StringAssertEx.Contains ($"build-tools/{buildToolsVersion}", builder.LastBuildOutput, $"build-tools/{buildToolsVersion} should be a dependency."); StringAssertEx.Contains ("platform-tools", builder.LastBuildOutput, "platform-tools should be a dependency."); @@ -131,7 +132,7 @@ public void GetDependencyWhenSDKIsMissingTest ([Values (true, false)] bool creat builder.Target = "GetAndroidDependencies"; Assert.True (builder.Build (proj, parameters: parameters), string.Format ("First Build should have succeeded")); - int apiLevel = Builder.UseDotNet ? AndroidSdkResolver.GetMaxInstalledPlatform () : 26; + int apiLevel = Builder.UseDotNet ? XABuildConfig.AndroidDefaultTargetDotnetApiLevel : 26; StringAssertEx.Contains ($"platforms/android-{apiLevel}", builder.LastBuildOutput, $"platforms/android-{apiLevel} should be a dependency."); StringAssertEx.Contains ($"build-tools/{buildToolsVersion}", builder.LastBuildOutput, $"build-tools/{buildToolsVersion} should be a dependency."); StringAssertEx.Contains ("platform-tools", builder.LastBuildOutput, "platform-tools should be a dependency."); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs index 1d7903f0054..4e6b636f5d5 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs @@ -6,6 +6,7 @@ using Mono.Cecil; using NUnit.Framework; using Xamarin.Android.Tasks; +using Xamarin.Android.Tools; using Xamarin.ProjectTools; using Xamarin.Tools.Zip; using Microsoft.Android.Build.Tasks; @@ -614,7 +615,8 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo XNamespace ns = "http://schemas.android.com/apk/res/android"; var uses_sdk = manifest.Root.Element ("uses-sdk"); Assert.AreEqual ("21", uses_sdk.Attribute (ns + "minSdkVersion").Value); - Assert.AreEqual ("31", uses_sdk.Attribute (ns + "targetSdkVersion").Value); + Assert.AreEqual (XABuildConfig.AndroidDefaultTargetDotnetApiLevel.ToString(), + uses_sdk.Attribute (ns + "targetSdkVersion").Value); bool expectEmbeddedAssembies = !(CommercialBuildAvailable && !isRelease); var apkPath = Path.Combine (outputPath, $"{proj.PackageName}-Signed.apk"); @@ -636,12 +638,11 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo } - /// - /// NOTE: we cannot use SupportedOSPlatformVersion=31 yet, due to d8 2.2.64 emitting a warning for `--min-api 31`: - /// D8 An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier - /// + // TODO: + // Causes warning: D8 : warning : An API level of 32 is not supported by this compiler. Please use an API level of 31 or earlier + // Add a 32 parameter here when we get a newer version of r8. [Test] - public void SupportedOSPlatformVersion ([Values (21, 30)] int minSdkVersion) + public void SupportedOSPlatformVersion ([Values (21, 31)] int minSdkVersion) { var proj = new XASdkProject { SupportedOSPlatformVersion = minSdkVersion.ToString (), @@ -756,8 +757,8 @@ public void XamarinLegacySdk () }; using var b = new Builder (); - var dotnetTargetFramework = "net6.0-android31.0"; - var legacyTargetFrameworkVersion = "11.0"; + var dotnetTargetFramework = "net6.0-android32.0"; + var legacyTargetFrameworkVersion = "12.1"; var legacyTargetFramework = $"monoandroid{legacyTargetFrameworkVersion}"; proj.SetProperty ("TargetFramework", value: ""); proj.SetProperty ("TargetFrameworks", value: $"{dotnetTargetFramework};{legacyTargetFramework}"); @@ -778,7 +779,9 @@ public void MauiTargetFramework ([Values ("net6.0-android", "net6.0-android31", var library = new XASdkProject (outputType: "Library") { TargetFramework = targetFramework, }; - bool preview = targetFramework.Contains("32"); + // Re-enable when we have unstable API 33 + // bool preview = targetFramework.Contains("33"); + bool preview = false; if (preview) { library.SetProperty ("EnablePreviewFeatures", "true"); } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/Versions.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/Versions.cs index e0e8cfbc961..22195069e83 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/Versions.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/Versions.cs @@ -4,6 +4,7 @@ namespace Xamarin.ProjectTools { public static class Versions { + public const string Android12L = "v12.1"; public const string Android12 = "v12.0"; public const string Android11 = "v11.0"; /// diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs index 2d1be00bb30..2ec7157ca1f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs @@ -2,10 +2,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Xml; using Microsoft.Build.Construction; -using System.Runtime.CompilerServices; +using Xamarin.Android.Tools; namespace Xamarin.ProjectTools { @@ -68,7 +69,11 @@ public XamarinAndroidApplicationProject (string debugConfigurationName = "Debug" } AndroidManifest = default_android_manifest; - TargetSdkVersion = AndroidSdkResolver.GetMaxInstalledPlatform ().ToString (); + if (Builder.UseDotNet) { + TargetSdkVersion = XABuildConfig.AndroidDefaultTargetDotnetApiLevel.ToString (); + } else { + TargetSdkVersion = AndroidSdkResolver.GetMaxInstalledPlatform ().ToString (); + } LayoutMain = default_layout_main; StringsXml = default_strings_xml; PackageName = $"com.xamarin.{(packageName ?? ProjectName).ToLower ()}"; diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index 064581382d5..a0fb7f51a6e 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -223,6 +223,7 @@ Outputs="Microsoft.Android.Sdk\targets\Microsoft.Android.Sdk.SupportedPlatforms.targets"> diff --git a/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.csproj b/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.csproj index a3e6744d4b0..84fbd2ae182 100644 --- a/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.csproj +++ b/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.csproj @@ -15,12 +15,14 @@ 512 Resources\Resource.designer.cs Off - v12.0 true true ..\..\..\product.snk + + $(AndroidLatestStableFrameworkVersion) + $(AndroidFrameworkVersion) true diff --git a/tests/Mono.Android-Tests/Mono.Android-Test.Library/Mono.Android-Test.Library.csproj b/tests/Mono.Android-Tests/Mono.Android-Test.Library/Mono.Android-Test.Library.csproj index f99d663076a..67b615ee266 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Test.Library/Mono.Android-Test.Library.csproj +++ b/tests/Mono.Android-Tests/Mono.Android-Test.Library/Mono.Android-Test.Library.csproj @@ -15,9 +15,11 @@ 512 Resources\Resource.designer.cs Off - v12.0 + + $(AndroidLatestStableFrameworkVersion) + true portable diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests.csproj b/tests/Mono.Android-Tests/Mono.Android-Tests.csproj index ae5db0b6864..fa98bee26a7 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests.csproj +++ b/tests/Mono.Android-Tests/Mono.Android-Tests.csproj @@ -21,7 +21,6 @@ All true ..\..\product.snk - v12.0 d8 <_SkipJniAddNativeMethodRegistrationAttributeScan>True true @@ -33,6 +32,9 @@ + + $(AndroidLatestStableFrameworkVersion) + true false diff --git a/tests/api-compatibility/acceptable-breakages-v12.0.99.txt b/tests/api-compatibility/acceptable-breakages-v12.1.txt similarity index 100% rename from tests/api-compatibility/acceptable-breakages-v12.0.99.txt rename to tests/api-compatibility/acceptable-breakages-v12.1.txt diff --git a/tests/api-compatibility/acceptable-breakages-vReference-net6.0.txt b/tests/api-compatibility/acceptable-breakages-vReference-net6.0.txt index 180e4840083..c934a8264b2 100644 --- a/tests/api-compatibility/acceptable-breakages-vReference-net6.0.txt +++ b/tests/api-compatibility/acceptable-breakages-vReference-net6.0.txt @@ -1,10 +1,4 @@ Compat issues with assembly Mono.Android: -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.BluetoothDevice.ConnectGatt(Android.Content.Context, System.Boolean, Android.Bluetooth.BluetoothGattCallback, Android.Bluetooth.BluetoothTransports, Android.Bluetooth.LE.ScanSettingsPhy)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.BluetoothDevice.ConnectGatt(Android.Content.Context, System.Boolean, Android.Bluetooth.BluetoothGattCallback, Android.Bluetooth.BluetoothTransports, Android.Bluetooth.LE.ScanSettingsPhy, Android.OS.Handler)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.LE.AdvertisingSetParameters.Builder.SetPrimaryPhy(Android.Bluetooth.LE.ScanSettingsPhy)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.LE.AdvertisingSetParameters.Builder.SetSecondaryPhy(Android.Bluetooth.LE.ScanSettingsPhy)' in the contract but not the implementation. -CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'Android.Runtime.IntDefAttribute' changed from '[AttributeUsageAttribute(2272, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(2528, AllowMultiple=true)]' in the implementation. -CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'Android.Runtime.StringDefAttribute' changed from '[AttributeUsageAttribute(2272, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(2528, AllowMultiple=true)]' in the implementation. CannotSealType : Type 'Java.Interop.JavaTypeParametersAttribute' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. MembersMustExist : Member 'public void Java.Interop.JavaTypeParametersAttribute.TypeParameters.set(System.String[])' does not exist in the implementation but it does exist in the contract. CannotChangeAttribute : Attribute 'Android.Runtime.RegisterAttribute' on 'Android.Graphics.Paint.Color.set(Android.Graphics.Color)' changed from '[RegisterAttribute("setColor", "(I)V", "GetSetColor_IHandler", ApiSince=29)]' in the contract to '[RegisterAttribute("setColor", "(I)V", "GetSetColor_IHandler")]' in the implementation. diff --git a/tests/api-compatibility/acceptable-breakages-vReference.txt b/tests/api-compatibility/acceptable-breakages-vReference.txt index a019f3f9e69..0dfe0f0033c 100644 --- a/tests/api-compatibility/acceptable-breakages-vReference.txt +++ b/tests/api-compatibility/acceptable-breakages-vReference.txt @@ -1,8 +1,2 @@ Compat issues with assembly Mono.Android: -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.BluetoothDevice.ConnectGatt(Android.Content.Context, System.Boolean, Android.Bluetooth.BluetoothGattCallback, Android.Bluetooth.BluetoothTransports, Android.Bluetooth.LE.ScanSettingsPhy)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.BluetoothDevice.ConnectGatt(Android.Content.Context, System.Boolean, Android.Bluetooth.BluetoothGattCallback, Android.Bluetooth.BluetoothTransports, Android.Bluetooth.LE.ScanSettingsPhy, Android.OS.Handler)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.LE.AdvertisingSetParameters.Builder.SetPrimaryPhy(Android.Bluetooth.LE.ScanSettingsPhy)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'Android.Runtime.RegisterAttribute' exists on 'Android.Bluetooth.LE.AdvertisingSetParameters.Builder.SetSecondaryPhy(Android.Bluetooth.LE.ScanSettingsPhy)' in the contract but not the implementation. -CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'Android.Runtime.IntDefAttribute' changed from '[AttributeUsageAttribute(2272, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(2528, AllowMultiple=true)]' in the implementation. -CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'Android.Runtime.StringDefAttribute' changed from '[AttributeUsageAttribute(2272, AllowMultiple=true)]' in the contract to '[AttributeUsageAttribute(2528, AllowMultiple=true)]' in the implementation. CannotChangeAttribute : Attribute 'Android.Runtime.RegisterAttribute' on 'Android.Graphics.Paint.Color.set(Android.Graphics.Color)' changed from '[RegisterAttribute("setColor", "(I)V", "GetSetColor_IHandler", ApiSince=29)]' in the contract to '[RegisterAttribute("setColor", "(I)V", "GetSetColor_IHandler")]' in the implementation. diff --git a/tests/api-compatibility/reference/Mono.Android.zip b/tests/api-compatibility/reference/Mono.Android.zip index 358bc70590a..5f0d4077764 100644 Binary files a/tests/api-compatibility/reference/Mono.Android.zip and b/tests/api-compatibility/reference/Mono.Android.zip differ