Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/android
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c60635b
Choose a base ref
...
head repository: dotnet/android
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4182e1f
Choose a head ref
  • 10 commits
  • 21 files changed
  • 6 contributors

Commits on May 3, 2021

  1. [Mono.Android] Make protected constants interfaces public (#5897)

    Fixes: #5868
    
    Context: dotnet/java-interop#821
    Context: dotnet/java-interop@105d544
    
    Originally, C# `interface`s couldn't contain non-"method" members,
    nor did C# support interface default members.
    
    Java did not have these restrictions:
    
    	// Java; https://developer.android.com/reference/android/provider/CalendarContract.EventsColumns
    	package android.provider;
    	/* partial */ class CalendarContract {
    	    protected static interface EventsColumns {
    	        public static final int ACCESS_LEVEL = "accesslevel";
    	    }
    	}
    
    Before C# 8, we bound these Java types by emitting a "proxy" class
    which contained the constants (along with enumification):
    
    	// C# binding
    	namespace Android.Provider {
    	    public partial class CalendarContract {
    	        public abstract class EventsColumns {
    	            public const string AccessLevel = (string) "accessLevel";
    	        }
    	    }
    	}
    
    With the introduction of C# 8, which allowed `interfaces` to contain
    non-"method" members, along with interface default methods, we
    did two things:
    
     1. We started emitting the constants into the interface declaration,
     2. We `[Obsolete]`d the "proxy" class, referring developers to use
        the interface type instead.
    
    This resulted in:
    
    	// C# Binding
    	namespace Android.Provider {
    	    public sealed partial class CalendarContract {
    	        [Obsolete ("Use the 'Android.Provider.CalendarContract.IEventsColumns' type. This class will be removed in a future release.")]
    	        public abstract partial class EventsColumns : Java.Lang.Object {
    	            [Obsolete ("Use 'Android.Provider.CalendarContract.IEventsColumns.AccessLevel'. This class will be removed in a future release.")]
    	            public const string AccessLevel = (string) "accessLevel";
    	        }
    	        protected internal partial interface IEventsColumns {
    	            public const string AccessLevel = (string) "accessLevel";
    	        }
    	    }
    	}
    
    There was a minor problem with this, however: the semantics for
    nested types with `protected` visibility differs between Java & C#:
    Java allows
    `android.provider.CalendarContract.EventsColumns.ACCESS_LEVEL` to be
    accessed from anywhere.  C# *only* allows access to
    `Android.Provider.CalendarContract.IEventDaysColumns.AccessLevel`
    from subclasses of `CalendarContract`, and as `CalendarContract` is
    `sealed`, it thus cannot be used from *anywhere*.
    
    Fix this oversight by updating `src/Mono.Android/metadata` to change
    the visibility of `android.provider.*Contract.*Columns` nested types
    to be *public*.  This allows the constants to be used from everywhere:
    
    
    	namespace Android.Provider {
    	    public sealed partial class CalendarContract {
    	        public partial interface IEventsColumns {
    	            public const string AccessLevel = (string) "accessLevel";
    	        }
    	    }
    	}
    
    The following interface types are now `public`:
    
      * `Android.Provider.CalendarContract/IAttendeesColumns`
      * `Android.Provider.CalendarContract/ICalendarAlertsColumns`
      * `Android.Provider.CalendarContract/ICalendarCacheColumns`
      * `Android.Provider.CalendarContract/ICalendarColumns`
      * `Android.Provider.CalendarContract/ICalendarSyncColumns`
      * `Android.Provider.CalendarContract/IColorsColumns`
      * `Android.Provider.CalendarContract/IEventDaysColumns`
      * `Android.Provider.CalendarContract/IEventsColumns`
      * `Android.Provider.CalendarContract/IExtendedPropertiesColumns`
      * `Android.Provider.CalendarContract/IRemindersColumns`
      * `Android.Provider.CalendarContract/ISyncColumns`
      * `Android.Provider.ContactsContract/CommonDataKinds/ICommonColumns`
      * `Android.Provider.ContactsContract/IBaseSyncColumns`
      * `Android.Provider.ContactsContract/IContactNameColumns`
      * `Android.Provider.ContactsContract/IContactOptionsColumns`
      * `Android.Provider.ContactsContract/IContactStatusColumns`
      * `Android.Provider.ContactsContract/IDataColumns`
      * `Android.Provider.ContactsContract/IDataUsageStatColumns`
      * `Android.Provider.ContactsContract/IDeletedContactsColumns`
      * `Android.Provider.ContactsContract/IGroupsColumns`
      * `Android.Provider.ContactsContract/IPhoneLookupColumns`
      * `Android.Provider.ContactsContract/IPresenceColumns`
      * `Android.Provider.ContactsContract/IRawContactsColumns`
      * `Android.Provider.ContactsContract/ISettingsColumns`
      * `Android.Provider.ContactsContract/IStatusColumns`
      * `Android.Provider.ContactsContract/IStreamItemPhotosColumns`
      * `Android.Provider.ContactsContract/IStreamItemsColumns`
      * `Android.Provider.ContactsContract/ISyncColumns`
    jpobst authored May 3, 2021
    Configuration menu
    Copy the full SHA
    0e2321d View commit details
    Browse the repository at this point in the history

Commits on May 4, 2021

  1. Bump to dotnet/installer@eceded1 6.0.100-preview.5.21252.3 (#5902)

    * Update dependencies from https://github.com/dotnet/installer build 20210502.3
    
    Changes: dotnet/installer@0b60950...eceded1
    
    Microsoft.Dotnet.Sdk.Internal
     From Version 6.0.100-preview.5.21229.1 -> To Version 6.0.100-preview.5.21252.3
    
    Dependency coherency updates
    
    Changes: dotnet/linker@bf37b29...307f6b0
    
    Microsoft.NET.ILLink.Tasks
     From Version 6.0.100-preview.5.21227.1 -> To Version 6.0.100-preview.5.21229.1 (parent: Microsoft.Dotnet.Sdk.Internal
    
    * Bump apkdiff, bump and sort apkdesc files
    
    Co-authored-by: Peter Collins <[email protected]>
    dotnet-maestro[bot] and pjcollins authored May 4, 2021
    Configuration menu
    Copy the full SHA
    599c1e8 View commit details
    Browse the repository at this point in the history
  2. [ci] Uninstall apkdiff before installation (#5903)

    We've been running into issues trying to install an older version of
    apkdiff on various machines after bumping the version in a PR.  Avoid
    this by always attempting to uninstall apkdiff first.  The uninstall
    exit code is ignored as uninstall attempts will error if the tool is not
    already installed.
    pjcollins authored May 4, 2021
    Configuration menu
    Copy the full SHA
    95a9c28 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2021

  1. [ci] Remove obsolete QA repos. (#5908)

    CI is failing with:
    
        The pipeline is not valid. Could not get the latest source version
        for repository xamarin/xamarin-forms-samples hosted on
        https://github.com/ using ref refs/heads/master. GitHub reported
        the error, "No commit found for SHA: refs/heads/master"
    
    The `master` branch changed to `main` in xamarin/xamarin-forms-samples.
    
    Several repos we are cloning in `azure-pipelines.yaml` are not actually
    used anymore. We should just remove these to solve the issue.
    jpobst authored May 5, 2021
    Configuration menu
    Copy the full SHA
    3840ecc View commit details
    Browse the repository at this point in the history
  2. [One .NET] workload is now Microsoft.NET.Sdk.Android.Manifest-6.0.100 (

    …#5898)
    
    Context: https://github.com/dotnet/designs/pull/188/files#diff-8fcaa29d8e6f00b34b3cb1830d93f33e75f04424780a66a3c658c7021048e74fR125
    Context: https://github.com/NuGet/NuGet.Client/blob/c529bd75d247430ed19b1713041de0b5b240ef0d/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets#L220-L281
    
    The `$(PackageId)` of our workload `.nupkg` needs to be:
    
    	Microsoft.NET.Sdk.Android.Manifest-6.0.100
    
    While the `$(PackageVersion)` remains the same as before.
    
    The layout on disk will change to:
    
    	dotnet\sdk-manifests\6.0.100\Microsoft.NET.Sdk.Android\
    	    WorkloadManifest.json
    	    WorkloadManifest.targets
    
    Note that `.Manifest` and `-6.0.100` are not in the folder name
    on disk.
    
    The generated filename will be e.g.
    
    	Microsoft.NET.Sdk.Android.Manifest-6.0.100.11.0.200-ci.microsoft-net-sdk-android-manifest.255.nupkg
    
    We could find no way to "visually separate" the ".NET version band"
    of `6.0.100` from the Microsoft.NET.Sdk.Android version of `11.0.200`.
    
    Additionally, update `version` in `WorkloadManifest.json` so it
    contains the proper version for our workload.  This used to not be
    possible because `version` was a `long`, but it now is a `string`
    where we can put our version.
    jonathanpeppers authored May 5, 2021
    Configuration menu
    Copy the full SHA
    5400522 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    51bb876 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2021

  1. [xaprepare] cleanup past .NET 6 installs (#5918)

    Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4728381&view=ms.vss-test-web.build-test-results-tab&runId=21435278&resultId=100052&paneView=attachments
    
    CI on some of our release branches is failing with errors such as:
    
        UnnamedProject.csproj: warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. An item with the same key has already been added. Key: microsoft-android-sdk-full
        Microsoft.NET.Sdk.ImportWorkloads.props(14,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. An item with the same key has already been added. Key: microsoft-android-sdk-full
        Microsoft.NET.Sdk.ImportWorkloads.props(14,38): error MSB4236: The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found.
    
    This could happen if both directories exist:
    
        dotnet/sdk-manifest/6.0.100/Microsoft.NET.Workload.Android
        dotnet/sdk-manifest/6.0.100/Microsoft.NET.Sdk.Android
    
    Which would define the same Android workload twice.
    
    xaprepare was setup to clean certain folders in
    `$(AndroidToolchainDirectory)\dotnet`, but also needs to delete:
    
    * sdk-manifests/6.0.100/*Android*
    * template-packs/*Android*
    
    I also changed some of the string comparisons to use
    `StringComparison.OrdinalIgnoreCase`.
    jonathanpeppers authored May 6, 2021
    Configuration menu
    Copy the full SHA
    ac9a11f View commit details
    Browse the repository at this point in the history

Commits on May 7, 2021

  1. [java-runtime] Preload net6 OpenSsl on startup (#5913)

    Context: dotnet/runtime#51274
    
    In .NET 6, `libSystem.Security.Cryptography.Native.OpenSsl.so` needs
    to be loaded and initialized in order for `System.Security` to be
    usable.
    
    Previously, nothing ensured that the library was loaded, which would
    result in SIGSEGVs at runtime:
    
    	[monodroid-assembly] Caching p/invoke entry libSystem.Security.Cryptography.Native.OpenSsl @ AndroidCryptoNative_CipherCreate
    	[monodroid] MonodroidRuntime::monodroid_pinvoke_override ("libSystem.Security.Cryptography.Native.OpenSsl", "AndroidCryptoNative_CipherCreate")
    	[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 5002 (anyname.Android), pid 5002 (anyname.Android)
    
    Workaround this problem by updating `MonoPackageManager.java` so that
    `System.Security.Cryptography.Native.OpenSsl` is always loaded from
    Java as part of process startup.
    
    This is not a desirable solution, as we want to keep *required*
    process startup overheads as small as possible.  Thus, we wish to
    remove this workaround in the future, once a proper solution is found.
    grendello authored May 7, 2021
    Configuration menu
    Copy the full SHA
    925ffad View commit details
    Browse the repository at this point in the history
  2. [One .NET] $(AndroidEnablePreloadAssemblies)=False by default (#5790) (

    …#5914)
    
    Fixes: #5838
    Context: e0da1f1
    
    Partially reverts 522d7fb which, reverted d13d0f9.
    
    The [`$(AndroidEnablePreloadAssemblies)`][0] property controls whether
    or not *all* `.dll` files contained within a `.apk` are loaded during
    process startup.  *Not* doing so reduces process startup times, which
    is desirable, but this also caused certain Xamarin.Forms apps to fail
    to run as they previously had, as not loading all assemblies during
    startup broke their Dependency Injection infrastructure.
    
    For .NET 6, we feel we have *some* "wiggle-room" to change default
    semantics, so for .NET 6 projects set the default value of
    `$(AndroidEnablePreloadAssemblies)` to False, so that assemblies are
    *not* pre-loaded during process startup.
    
    `$(AndroidEnablePreloadAssemblies)` can be set to True within the
    app's `.csproj` file to return to "legacy" semantics.  This will cause
    all assemblies to be loaded during startup, with a commensurate
    increase in app startup overheads.
    
    [0]: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidenablepreloadassemblies
    grendello authored May 7, 2021
    Configuration menu
    Copy the full SHA
    4ed6a22 View commit details
    Browse the repository at this point in the history
  3. Bump to dotnet/installer@8e4d77c 6.0.100-preview.5.21255.8 (#5915)

    Changes: dotnet/installer@eceded1...8e4d77c
    Changes: dotnet/linker@307f6b0...4afa105
    
    * Update dependencies from https://github.com/dotnet/installer build 20210505.8
    
    Microsoft.Dotnet.Sdk.Internal
     From Version 6.0.100-preview.5.21252.3 -> To Version 6.0.100-preview.5.21255.8
    
    Dependency coherency updates
    
    Microsoft.NET.ILLink.Tasks
     From Version 6.0.100-preview.5.21229.1 -> To Version 6.0.100-preview.5.21254.1 (parent: Microsoft.Dotnet.Sdk.Internal
    
    * Update .apkdesc files
    
    Co-authored-by: Jonathan Peppers <[email protected]>
    dotnet-maestro[bot] and jonathanpeppers authored May 7, 2021
    Configuration menu
    Copy the full SHA
    4182e1f View commit details
    Browse the repository at this point in the history
Loading