Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

Invokers should emit [SupportedOSPlatformAttribute] #863

Closed

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.

Activity

  1. added
    enhancement
    generator
    bug
    and removed
    enhancement
    on Jul 28, 2021
  2. locked and limited conversation to collaborators on Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggenerator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions