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

[Essentials] Fix maciOS version checks #4908

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Feb 25, 2022

Fixes: #461

Commit 158ffbd accidentially introduced what was likely a breaking
change in Platform.ios.tvos.watchos.HasOSVersion. The call to
UIDevice.CurrentDevice.CheckSystemVersion was replaced by
OperatingSystem.IsIOSVersionAtLeast, however HasOSVersion was used
on platforms other than iOS.

Fix this oversight by removing HasOSVersion entirely, and use the
correct Is$(Platform)VersionAtLeast variant at all call sites instead.

OperatingSystem.IsIOSVersionAtLeast will work on iOS and MacCatalyst,
but not on tvOS. Additional tvOS checks have been added as needed.

Instances of DeviceInfo.Version have also been replaced by
Is$(Platform)VersionAtLeast where applicable.

Commit 158ffbd accidentially introduced what was likely a breaking
change in `Platform.ios.tvos.watchos.HasOSVersion`.  The call to
`UIDevice.CurrentDevice.CheckSystemVersion` was replaced by
`OperatingSystem.IsIOSVersionAtLeast`, however `HasOSVersion` was used
on platforms other than iOS.

Fix this oversight by removing `HasOSVersion` entirely, and use the
correct `Is$(Platform)VersionAtLeast` variant at all call sites instead.

`OperatingSystem.IsIOSVersionAtLeast` will work on iOS and MacCatalyst,
but not on tvOS. Additional tvOS checks have been added as needed.

Instances of `DeviceInfo.Version` have also been replaced by
`Is$(Platform)VersionAtLeast` where applicable.
@pjcollins pjcollins marked this pull request as ready for review February 25, 2022 17:23
@Eilon Eilon added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Feb 25, 2022
@Redth Redth merged commit 15f1120 into dotnet:main Feb 25, 2022
@pjcollins pjcollins deleted the essentials-macios-version-fix branch February 28, 2022 22:01
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2023
@samhouts samhouts added the fixed-in-6.0.200-preview.14.2 Look for this fix in 6.0.200-preview.14.2! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info fixed-in-6.0.200-preview.14.2 Look for this fix in 6.0.200-preview.14.2! platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore using System.OperatingSystem for API checks
4 participants