diff --git a/internal/platform/implementation/BUILD b/internal/platform/implementation/BUILD index 1eeb0b58..d1743993 100644 --- a/internal/platform/implementation/BUILD +++ b/internal/platform/implementation/BUILD @@ -120,6 +120,7 @@ cc_library( "//internal/network:__subpackages__", "//internal/platform:__pkg__", "//internal/platform/implementation:__subpackages__", + "//location/nearby/analytics/cpp:__subpackages__", "//location/nearby/cpp/sharing:__subpackages__", "//third_party/nearby/sharing:__subpackages__", ], diff --git a/internal/platform/implementation/apple/device_info.mm b/internal/platform/implementation/apple/device_info.mm index ee0104dd..6a8d09ee 100644 --- a/internal/platform/implementation/apple/device_info.mm +++ b/internal/platform/implementation/apple/device_info.mm @@ -68,7 +68,15 @@ api::DeviceInfo::DeviceType DeviceInfo::GetDeviceType() const { #endif } -api::DeviceInfo::OsType DeviceInfo::GetOsType() const { return api::DeviceInfo::OsType::kIos; } +api::DeviceInfo::OsType DeviceInfo::GetOsType() const { +#if TARGET_OS_OSX + return api::DeviceInfo::OsType::kMacOS; +#elif TARGET_OS_IPHONE + return api::DeviceInfo::OsType::kIos; +#else + return api::DeviceInfo::OsType::kUnknown; +#endif +} std::optional DeviceInfo::GetFullName() const { return std::nullopt; } std::optional DeviceInfo::GetGivenName() const { return std::nullopt; } diff --git a/internal/platform/implementation/device_info.h b/internal/platform/implementation/device_info.h index b4a0ba4b..7b48c608 100644 --- a/internal/platform/implementation/device_info.h +++ b/internal/platform/implementation/device_info.h @@ -29,7 +29,14 @@ class DeviceInfo { public: enum class ScreenStatus { kUndetermined = 0, kLocked, kUnlocked }; enum class DeviceType { kUnknown = 0, kPhone, kTablet, kLaptop }; - enum class OsType { kUnknown = 0, kAndroid, kChromeOs, kIos, kWindows }; + enum class OsType { + kUnknown = 0, + kAndroid, + kChromeOs, + kIos, + kWindows, + kMacOS + }; virtual ~DeviceInfo() = default;