Skip to content

Invokers should emit [SupportedOSPlatformAttribute] #863

@jpobst

Description

@jpobst

We began emitting [SupportedOSPlatformAttribute] for net6.0 Mono.Android.dll public API:

[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android23.0")]
[global::Android.Runtime.Register ("android/telecom/InCallService", DoNotGenerateAcw=true, ApiSince = 23)]
public abstract partial class InCallService : Android.App.Service { ... }

However our internal machinery uses this API without having the same guards:

[global::Android.Runtime.Register ("android/telecom/InCallService", DoNotGenerateAcw=true, ApiSince = 23)]
internal partial class InCallServiceInvoker : InCallService { ... }

This results in warnings:

…/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-30/mcw/Android.Telecom.InCallService.cs(1287,76):
warning CA1416: This call site is reachable on all platforms. 'InCallService' is only supported on: 'android' 23.0 and later.

We need to emit the same [SupportedOSPlatformAttribute] for these methods as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugComponent does not function as intendedgeneratorIssues binding a Java library (generator, class-parse, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions