Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #51664 - change GlobalAction to Action where appropriate. #859

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

atsushieno
Copy link
Contributor

The fixes are twofolds:

  • add GetAction/SetAction to alter Action property and add [Obsolete] on
    Action property.
  • Add PerformAccessibilityAction() / PerformAction() overloads that use
    Action instead.

In the future we remove [Obsolete]d members so that we can bring back
sanitized API.

The fixes are twofolds:

- add GetAction/SetAction to alter Action property and add [Obsolete] on
  Action property.
- Add PerformAccessibilityAction() / PerformAction() overloads that use
  Action instead.

In the future we remove [Obsolete]d members so that we can bring back
sanitized API.
namespace Android.Views.Accessibility {

partial class AccessibilityEvent {

#if ANDROID_16
[Obsolete ("This maps to incorrect type. Use GetAction() and SetAction() until we fix the API")]
public GlobalAction Action {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How lucky are we that Action is non-virtual!

@jonpryor jonpryor merged commit 47f370f into dotnet:master Sep 14, 2017
jonpryor pushed a commit that referenced this pull request Sep 26, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=51664

The fixes are twofolds:

  - Add `GetAction()`/`SetAction()` to alter `Action` property and
    add `[Obsolete]` on the `Action` property.
  - Add `PerformAccessibilityAction()`/`PerformAction()` overloads
    that use Action instead.

In the future we may remove `[Obsolete]`d members so that we can
bring back a sanitized API.
jonpryor pushed a commit that referenced this pull request Jul 21, 2021
Fixes: dotnet/java-interop#854

Changes: dotnet/installer@e8b3b6b...9c46371

    % git diff --shortstat e8b3b6be...9c463710
     103 files changed, 2301 insertions(+), 2757 deletions(-)

Changes: dotnet/linker@a07cab7...460dd6d

    % git diff --shortstat a07cab7b...460dd6dd
     84 files changed, 2403 insertions(+), 258 deletions(-)

Changes: dotnet/runtime@02f70d0...96ce6b3

    % git diff --shortstat 02f70d0b90...96ce6b3535
     2586 files changed, 123677 insertions(+), 34433 deletions(-)

Changes: dotnet/java-interop@a5ed891...4fb7c14

  * dotnet/java-interop@4fb7c147: [build] set $(DisableImplicitNamespaceImports) by default (#859)
  * dotnet/java-interop@855ecfa3: [generator] Don't generate unexpected NRT types like `void?` (#856)
  * dotnet/java-interop@4a02bc32: Revert "[Xamarin.Android.Tools.Bytecode] hide nested types (#827)" (#855)
  * dotnet/java-interop@95c9b79d: [generator] Avoid 'error (…):' construct in diagnostic messages (#851)
  * dotnet/java-interop@7c4f7db0: [build] Bump to Mono with MSBuild 16.10 (#848)
  * dotnet/java-interop@0227cdae: [generator] Gracefully handle BindingGeneratorException. (#845)
  * dotnet/java-interop@ce1750fd: Add SECURITY.md (#846)

Context: dotnet/runtime#55384
Context: dotnet/sdk#18639

Updates:

  * Microsoft.Dotnet.Sdk.Internal: from 6.0.100-preview.7.21327.2 to 6.0.100-rc.1.21369.3
  * Microsoft.NET.ILLink.Tasks: from 6.0.100-preview.6.21322.1 to 6.0.100-preview.6.21366.2
  * Microsoft.NETCore.App.Ref: from 6.0.0-preview.7.21326.8 to 6.0.0-rc.1.21368.1

dotnet/runtime#55384 broke how .NET 6 interacts with
`AndroidClientHandler`.  Fix this by introducing a new
`Xamarin.Android.Net.AndroidMessageHandler` type for use on .NET 6,
and update the .NET 6 `AndroidClientHandler` to delegate to
`AndroidMessageHandler`.

`AndroidMessageHandler` doesn't exist on Legacy.

Update `.apkdesc` files:

  * `BuildReleaseArm64SimpleDotNet` is ~37KB smaller
  * `BuildReleaseArm64XFormsDotNet` is ~62KB larger.

Update `tests/api-compatibility/api-compat-exclude-attributes.txt`
so that `T:System.Runtime.CompilerServices.CompilerGeneratedAttribute`
is ignored.  `[CompilerGeneratedAttribute]` is emitted as part of
C# 3 "auto-props":

	public T Property { get; set; }

Converting this into a "real" property:

	T value;
	public T Property {
	    get => value;
	    set => this.value = value;
	}

results in the `_CheckApiCompatibility` target complaining about an
API break.  We don't care; ignore `[CompilerGeneratedAttribute]`.

Remove `$(SelfContained)` property: early on in .NET 5 (yes 5)
development, the Xamarin.Android SDK needed to specify
`$(SelfContained)` by default in order to produce `.apk` files.

After we became a proper workload, setting the value became
unnecessary.  It also didn't actually do anything because
dotnet/sdk overwrote the value.

Starting in dotnet/sdk#18639,
`Microsoft.NET.RuntimeIdentifierInference.targets` is now being
imported *after* a workload, which meant that dotnet/sdk no longer
overwrote our `$(SelfContained)` value, which broke things:

	error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false.

We can simply remove `$(SelfContained)` now, and rely on
dotnet/sdk to set this value.

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
jonpryor pushed a commit that referenced this pull request Jul 21, 2021
Fixes: dotnet/java-interop#854

Changes: dotnet/installer@e8b3b6b...808795c

    % git diff --shortstat e8b3b6be...808795cc
     102 files changed, 2218 insertions(+), 2674 deletions(-)

Changes: dotnet/linker@a07cab7...9ecf5bd

    % git diff --shortstat a07cab7b...9ecf5bd2
     81 files changed, 2122 insertions(+), 246 deletions(-)


Changes: dotnet/runtime@02f70d0...8d3afa3

    % git diff --shortstat 02f70d0b...8d3afa3a
     2518 files changed, 122843 insertions(+), 33676 deletions(-)

Changes: dotnet/java-interop@a5ed891...4fb7c14

  * dotnet/java-interop@4fb7c147: [build] set $(DisableImplicitNamespaceImports) by default (#859)
  * dotnet/java-interop@855ecfa3: [generator] Don't generate unexpected NRT types like `void?` (#856)
  * dotnet/java-interop@4a02bc32: Revert "[Xamarin.Android.Tools.Bytecode] hide nested types (#827)" (#855)
  * dotnet/java-interop@95c9b79d: [generator] Avoid 'error (…):' construct in diagnostic messages (#851)
  * dotnet/java-interop@7c4f7db0: [build] Bump to Mono with MSBuild 16.10 (#848)
  * dotnet/java-interop@0227cdae: [generator] Gracefully handle BindingGeneratorException. (#845)
  * dotnet/java-interop@ce1750fd: Add SECURITY.md (#846)

Context: dotnet/runtime#55384
Context: dotnet/sdk#18639

Updates:

  * Microsoft.Dotnet.Sdk.Internal: from 6.0.100-preview.7.21327.2 to 6.0.100-preview.7.21369.5
  * Microsoft.NET.ILLink.Tasks: from 6.0.100-preview.6.21322.1 to 6.0.100-preview.6.21365.1
  * Microsoft.NETCore.App.Ref: from 6.0.0-preview.7.21326.8 to 6.0.0-preview.7.21368.2

dotnet/runtime#55384 broke how .NET 6 interacts with
`AndroidClientHandler`.  Fix this by introducing a new
`Xamarin.Android.Net.AndroidMessageHandler` type for use on .NET 6,
and update the .NET 6 `AndroidClientHandler` to delegate to
`AndroidMessageHandler`.

`AndroidMessageHandler` doesn't exist on Legacy.

Update `.apkdesc` files:

  * `BuildReleaseArm64SimpleDotNet` is ~37KB smaller
  * `BuildReleaseArm64XFormsDotNet` is ~62KB larger.

Update `tests/api-compatibility/api-compat-exclude-attributes.txt`
so that `T:System.Runtime.CompilerServices.CompilerGeneratedAttribute`
is ignored.  `[CompilerGeneratedAttribute]` is emitted as part of
C# 3 "auto-props":

	public T Property { get; set; }

Converting this into a "real" property:

	T value;
	public T Property {
	    get => value;
	    set => this.value = value;
	}

results in the `_CheckApiCompatibility` target complaining about an
API break.  We don't care; ignore `[CompilerGeneratedAttribute]`.

Remove `$(SelfContained)` property: early on in .NET 5 (yes 5)
development, the Xamarin.Android SDK needed to specify
`$(SelfContained)` by default in order to produce `.apk` files.

After we became a proper workload, setting the value became
unnecessary.  It also didn't actually do anything because
dotnet/sdk overwrote the value.

Starting in dotnet/sdk#18639,
`Microsoft.NET.RuntimeIdentifierInference.targets` is now being
imported *after* a workload, which meant that dotnet/sdk no longer
overwrote our `$(SelfContained)` value, which broke things:

	error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false.

We can simply remove `$(SelfContained)` now, and rely on
dotnet/sdk to set this value.

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
jonpryor pushed a commit that referenced this pull request Aug 25, 2021
Context: #6234
Context: 1e5bfa3
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5132407&view=logs&jobId=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=65256bb7-a34c-5353-bc4d-c02ee25dc133

Changes: dotnet/java-interop@48766c0...476bb5b

  * dotnet/java-interop@476bb5b7: [build] .NET 6 P7 Support (#869)
  * dotnet/java-interop@0028e32c: [build] set $(DisableImplicitNamespaceImports) by default (#859)

We don't actually *care* about dotnet/installer@9c463710 bump.
We care that the attempt to build PR #6234 fails to build:

	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : CompatApi command: /Users/builder/.nuget/packages/microsoft.dotnet.apicompat/5.0.0-beta.20181.7/tools/net472/Microsoft.DotNet.ApiCompat.exe "/Users/builder/azdo/_work/2/s/xamarin-android/tests/api-compatibility/reference/Mono.Android.dll" -i "/Users/builder/azdo/_work/2/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/net6.0" --allow-default-interface-methods --baseline "/Users/builder/azdo/_work/2/s/xamarin-android/tests/api-compatibility/acceptable-breakages-vReference.txt" --validate-baseline --exclude-attributes "/Users/builder/azdo/_work/2/s/xamarin-android/tests/api-compatibility/api-compat-exclude-attributes.txt"
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : CheckApiCompatibility found nonacceptable Api breakages for ApiLevel: v12.0.
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : Compat issues with assembly Mono.Android:
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : TypesMustExist : Type 'Xamarin.Android.Net.AndroidMessageHandler' does not exist in the implementation but it does exist in the contract.
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : Total Issues: 1

It fails to build because we `CheckApiCompatibility` expects the
`Xamarin.Android.Net.AndroidMessageHandler` type to exist, and it
doesn't exist, because it was added until… 1e5bfa3.
That's the primary thing we're after.  Everything else is fluff, and
the dotnet/runtime-related changes are not otherwise needed -- or
cared about -- on d16-11.

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
jonpryor pushed a commit that referenced this pull request Aug 26, 2021
Context: #6234
Context: 1e5bfa3
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5132407&view=logs&jobId=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=65256bb7-a34c-5353-bc4d-c02ee25dc133

Changes: dotnet/java-interop@48766c0...476bb5b

  * dotnet/java-interop@476bb5b7: [build] .NET 6 P7 Support (#869)
  * dotnet/java-interop@0028e32c: [build] set $(DisableImplicitNamespaceImports) by default (#859)

We don't actually *care* about dotnet/installer@9c463710 bump.
We care that the attempt to build PR #6234 fails to build:

	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : CompatApi command: /Users/builder/.nuget/packages/microsoft.dotnet.apicompat/5.0.0-beta.20181.7/tools/net472/Microsoft.DotNet.ApiCompat.exe "/Users/builder/azdo/_work/2/s/xamarin-android/tests/api-compatibility/reference/Mono.Android.dll" -i "/Users/builder/azdo/_work/2/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/net6.0" --allow-default-interface-methods --baseline "/Users/builder/azdo/_work/2/s/xamarin-android/tests/api-compatibility/acceptable-breakages-vReference.txt" --validate-baseline --exclude-attributes "/Users/builder/azdo/_work/2/s/xamarin-android/tests/api-compatibility/api-compat-exclude-attributes.txt"
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : CheckApiCompatibility found nonacceptable Api breakages for ApiLevel: v12.0.
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : Compat issues with assembly Mono.Android:
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : TypesMustExist : Type 'Xamarin.Android.Net.AndroidMessageHandler' does not exist in the implementation but it does exist in the contract.
	…/xamarin-android/src/Mono.Android/Mono.Android.targets(247,5): error : Total Issues: 1

It fails to build because we `CheckApiCompatibility` expects the
`Xamarin.Android.Net.AndroidMessageHandler` type to exist, and it
doesn't exist, because it was added until… 1e5bfa3.
That's the primary thing we're after.  Everything else is fluff, and
the dotnet/runtime-related changes are not otherwise needed -- or
cared about -- on d16-11.

Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
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.

3 participants