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

[AVFoundation] Adjust availability attributes according to conditional compilation directives. #17311

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions src/AVFoundation/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,12 @@ InternalAVAudioSessionDelegate EnsureEventDelegate ()
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
#endif
Expand All @@ -380,11 +381,12 @@ public event EventHandler BeginInterruption {
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
#endif
Expand All @@ -399,11 +401,12 @@ public event EventHandler EndInterruption {
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#endif
Expand All @@ -418,11 +421,12 @@ public event EventHandler<AVCategoryEventArgs> CategoryChanged {
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#endif
Expand All @@ -437,11 +441,12 @@ public event EventHandler<AVStatusEventArgs> InputAvailabilityChanged {
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#endif
Expand All @@ -457,11 +462,12 @@ public event EventHandler<AVSampleRateEventArgs> SampleRateChanged {
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#endif
Expand All @@ -477,11 +483,12 @@ public event EventHandler<AVChannelsEventArgs> InputChannelsChanged {
}

#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("macos")]
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("ios6.0", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
[ObsoletedOSPlatform ("maccatalyst13.1", "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#else
[Deprecated (PlatformName.iOS, 6, 0, message: "Use 'AVAudioSession.Notification.ObserveAudioRouteChange' instead.")]
#endif
Expand Down
7 changes: 0 additions & 7 deletions tests/cecil-tests/ApiAvailabilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,6 @@ public void FindMissingObsoleteAttributes ()
"System.Boolean Security.SecRecord::UseNoAuthenticationUI()",
"System.Double Speech.SFTranscription::AveragePauseDuration()",
"System.Double Speech.SFTranscription::SpeakingRate()",
"System.EventHandler AVFoundation.AVAudioSession::BeginInterruption (event)",
"System.EventHandler AVFoundation.AVAudioSession::EndInterruption (event)",
"System.EventHandler`1<AVFoundation.AVCategoryEventArgs> AVFoundation.AVAudioSession::CategoryChanged (event)",
"System.EventHandler`1<AVFoundation.AVChannelsEventArgs> AVFoundation.AVAudioSession::InputChannelsChanged (event)",
"System.EventHandler`1<AVFoundation.AVChannelsEventArgs> AVFoundation.AVAudioSession::OutputChannelsChanged (event)",
"System.EventHandler`1<AVFoundation.AVSampleRateEventArgs> AVFoundation.AVAudioSession::SampleRateChanged (event)",
"System.EventHandler`1<AVFoundation.AVStatusEventArgs> AVFoundation.AVAudioSession::InputAvailabilityChanged (event)",
"System.String PassKit.PKAddShareablePassConfiguration::ProvisioningPolicyIdentifier()",
"System.String PassKit.PKShareablePassMetadata::LocalizedDescription()",
"System.String PassKit.PKShareablePassMetadata::OwnerDisplayName()",
Expand Down