mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Add macOS as an OS type
PiperOrigin-RevId: 561959449
This commit is contained in:
committed by
Copybara-Service
parent
b7628b098b
commit
aa0c06257f
@@ -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__",
|
||||
],
|
||||
|
||||
@@ -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<std::u16string> DeviceInfo::GetFullName() const { return std::nullopt; }
|
||||
std::optional<std::u16string> DeviceInfo::GetGivenName() const { return std::nullopt; }
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user