File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
common/src/aws/smithy/kotlin/runtime/util
native/src/aws/smithy/kotlin/runtime/util Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 66package aws.smithy.kotlin.runtime.util
77
88import aws.smithy.kotlin.runtime.InternalApi
9+ import kotlinx.coroutines.awaitAll
910
1011public interface PlatformEnvironProvider :
1112 EnvironmentProvider ,
@@ -58,6 +59,9 @@ public enum class OsFamily {
5859 Windows ,
5960 Android ,
6061 Ios ,
62+ IpadOs ,
63+ TvOs ,
64+ WatchOs ,
6165 Unknown ,
6266 ;
6367
@@ -67,6 +71,9 @@ public enum class OsFamily {
6771 Windows -> " windows"
6872 Android -> " android"
6973 Ios -> " ios"
74+ IpadOs -> " ipados"
75+ TvOs -> " tvos"
76+ WatchOs -> " watchos"
7077 Unknown -> " unknown"
7178 }
7279}
Original file line number Diff line number Diff line change @@ -74,14 +74,17 @@ internal actual object SystemDefaultProvider : PlatformProvider {
7474
7575 val sysName = utsname.sysname.toKString().lowercase()
7676 val version = utsname.release.toKString()
77- val machine = utsname.machine.toKString() // Helps differentiate iOS/macOS
77+ val machine = utsname.machine.toKString().lowercase() // Helps differentiate Apple platforms
7878
7979 val family = when {
8080 sysName.contains(" darwin" ) -> {
81- if (machine.startsWith(" iPhone" ) || machine.startsWith(" iPad" )) {
82- OsFamily .Ios
83- } else {
84- OsFamily .MacOs
81+ when {
82+ machine.startsWith(" iphone" ) -> OsFamily .Ios
83+ // TODO Validate that iPadOS/tvOS/watchOS resolves correctly on each of these devices
84+ machine.startsWith(" ipad" ) -> OsFamily .IpadOs
85+ machine.startsWith(" tv" ) -> OsFamily .TvOs
86+ machine.startsWith(" watch" ) -> OsFamily .WatchOs
87+ else -> OsFamily .MacOs
8588 }
8689 }
8790 sysName.contains(" linux" ) -> OsFamily .Linux
You can’t perform that action at this time.
0 commit comments