Skip to content

Missing SupportedOSPlatformAttribute for enum members, const members #1037

@rgroenewoudt

Description

@rgroenewoudt

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

VS 2022 17.3.3

Description

In .NET 6 Android the consts are missing SupportedOSPlatformAttribute.

Examples:

  • Manifest.Permission.PostNotifications:
  • Vibrator.VibrationEffectSupportNo
  • TelecomManager.ActionPostCall

APILevel is already present in RegisterAttribute.ApiSince.

[Register("ACTION_POST_CALL", ApiSince=30)]
public const string ActionPostCall = "android.telecom.action.POST_CALL";

I would also expect that the new enum VibrationEffectSupport also has the SupportedOSPlatformAttribute as the values are only available since API 30.

public enum VibrationEffectSupport
{
  [IntDefinition("Android.OS.Vibrator.VibrationEffectSupportUnknown", JniField="android/os/Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN")]
  Unknown = 0,
  [IntDefinition("Android.OS.Vibrator.VibrationEffectSupportYes", JniField="android/os/Vibrator.VIBRATION_EFFECT_SUPPORT_YES")]
  Yes = 1,
  [IntDefinition("Android.OS.Vibrator.VibrationEffectSupportNo", JniField="android/os/Vibrator.VIBRATION_EFFECT_SUPPORT_NO")]
  No = 2
}

Steps to Reproduce

Create new .NET 6 Android project and use Android consts/enums.

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

enhancementProposed change to current functionalitygeneratorIssues binding a Java library (generator, class-parse, etc.)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions