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

[Mono.Android] Bind AccessibilityNodeInfo.AddAction (AccessibilityAction action) #5391

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Dec 8, 2020

Fixes: #5368

The class AccessibilityNodeInfo has the following methods:

// Added in API-14, deprecated in API-21
public void addAction (int action)

// Added in API-21
public void addAction (AccessibilityNodeInfo.AccessibilityAction action)

We are converting the int action to an enum using methodmap.csv:

0, android.view.accessibility, AccessibilityNodeInfo, addAction, action, Android.Views.Accessibility.Action

However this mechanism does not specify parameter types, so both methods are getting their parameter enum-ified:

public void AddAction (Android.Views.Accessibility.Action action)
public void AddAction (Android.Views.Accessibility.Action action)

This isn't allowed, so we disabled binding the new overload to allow Mono.Android to build.

In order to properly bind the new overload, this commit removes the line from methodmap.csv and adds the specification directly to metadata, where the path can be made more specific to only affect a single method, allowing the new method to be bound with its original parameter type.

public void AddAction (Android.Views.Accessibility.Action action)
public void AddAction (AccessibilityNodeInfo.AccessibilityAction action)

@jpobst jpobst marked this pull request as ready for review December 9, 2020 15:15
@jpobst jpobst requested a review from jonpryor as a code owner December 9, 2020 15:15
@jonpryor jonpryor merged commit d9825d5 into master Dec 9, 2020
@jonpryor jonpryor deleted the add-action-fix branch December 9, 2020 15:48
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 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.

Missing AccessibilityNodeInfo.AddAction overload
2 participants