Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Add api compatibility file for Api 29 #22

Merged
merged 3 commits into from
Jul 29, 2019
Merged

Add api compatibility file for Api 29 #22

merged 3 commits into from
Jul 29, 2019

Conversation

gugavaro
Copy link
Contributor

No description provided.

@gugavaro gugavaro requested a review from jonpryor July 25, 2019 15:56
@jonpryor jonpryor merged commit 336eeda into master Jul 29, 2019
jonpryor pushed a commit that referenced this pull request Jul 29, 2019
Update assemblies for API-29, mono/mono@761220d9

Context: dotnet/android#3305

Commit xamarin/xamarin-android/master@0c9f83b7 included a bump to
mono/mono@761220d9, which [broke API compatibility][0],
removing `System.Diagnostics.Tracing.EventCounter.Dispose()`:

	<h3>Type Changed: System.Diagnostics.Tracing.EventCounter</h3>
	<p>Removed method:</p>
	<pre>
	  <span class='removed removed-method breaking' data-is-breaking>public virtual void Dispose ();</span>
	</pre>

This was introduced by [dotnet/standard@af001b83][1] and the
introduction of a new `System.Diagnostics.Tracing.DiagnosticCounter`
base class.  This is thus an API-compatible change.

Meanwhile, [xamarin-android PR 3305][2] adds support for
[Android 10.0 (API-29)][3], adding several new types & members.
API-29 requires a new `inter-api-extra-v9.0-v10.0.txt` file for
inter-API comparisons due to "compatible" changes which
`mono-api-html` reports as errors.  These include

  * Changing the base class of
    `Android.App.ActivityManager.RecentTaskInfo` and
    `Android.App.ActivityManager.RecentTaskInfo.RunningTaskInfo` to
    `Android.App.TaskInfo`, from `Java.Lang.Object`.

  * The base class of `Java.Util.Concurrent.Atomic.DoubleAccumulator`,
    `DoubleAdder`, `LongAccumulator`, and `LongAdder` was changed from
    `Java.Util.Concurrent.Atomic.Striped64` to `Java.Lang.Number`.
    
    This *is* a breaking change, but `Striped64` inherited from
    `Number`, so all method invocations were already "based on"
    `Number` method invocations.  This change should only alter
    compatibility when performing a reference conversion to
    `Striped64`:
    
        Java.Util.Concurrent.Atomic.Striped64 = new Java.Util.Concurrent.Atomic.DoubleAccumulator();
        // Previously valid, now a CS0029

    We believe that this change shouldn't actually impact anyone.

  * `Android.Text.SpannableStringInternal` methods were changed from
    non-`virtual` to `virtual`, because on the Java side the
    `android.text.SpannableStringInternal` class was removed, which
    resulted in a [runtime crash][4].  The chosen fix was to make
    these methods `virtual`, so that they could be appropriately
    overridden and dispatched to the correct Java-side type.

[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/668/API_20Compatibility_20Checks/
[1]: dotnet/standard@af001b8#diff-5d9a22f9ff5db529e1ea22efb9858d01
[2]: dotnet/android#3305
[3]: https://web.archive.org/web/20190726091025/https://developer.android.com/preview/features
[4]: dotnet/android#3305 (comment)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants