Skip to content
Open
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
14 changes: 14 additions & 0 deletions base/system/sys_info_starboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ std::string SbSysInfo::Brand() {
__system_property_get("ro.product.brand", brand_str);
return std::string(brand_str);
}

std::string SbSysInfo::OSFriendlyName() {
return "AOSP";
}

#elif BUILDFLAG(IS_STARBOARD)
std::string SbSysInfo::OriginalDesignManufacturer() {
return GetSystemPropertyString(kSbSystemPropertySystemIntegratorName);
Expand All @@ -95,6 +100,10 @@ std::string SbSysInfo::Brand() {
return GetSystemPropertyString(kSbSystemPropertyBrandName);
}

std::string SbSysInfo::OSFriendlyName() {
return GetSystemPropertyString(kSbSystemPropertyFriendlyName);
}

#elif BUILDFLAG(IS_IOS_TVOS)
std::string SbSysInfo::OriginalDesignManufacturer() {
// Cobalt 25: https://github.com/youtube/cobalt/blob/62c2380b7eb0da5889a387c4b9be283656a8575d/starboard/shared/uikit/system_get_property.mm#L126
Expand Down Expand Up @@ -152,6 +161,11 @@ std::string SbSysInfo::Brand() {
return "Apple";
}

std::string SbSysInfo::OSFriendlyName() {
NOTIMPLEMENTED();
return ""
}

#endif // BUILDFLAG(IS_ANDROID)

} // namespace starboard
Expand Down
4 changes: 3 additions & 1 deletion base/system/sys_info_starboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class BASE_EXPORT SbSysInfo {
static std::string ModelYear();

static std::string Brand();

static std::string OSFriendlyName();
};

} // namespace starboard
} // namespace base

#endif // BASE_SYSTEM_SYS_INFO_STARBOARD_H_
#endif // BASE_SYSTEM_SYS_INFO_STARBOARD_H_
6 changes: 5 additions & 1 deletion base/system/sys_info_starboard_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace base {
namespace starboard {

#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS_TVOS)
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS_TVOS) || BUILDFLAG(IS_STARBOARD)

using SbSysInfoTest = PlatformTest;

Expand All @@ -46,6 +46,10 @@ TEST_F(SbSysInfoTest, Brand) {
EXPECT_NE(brand_str, "");
}

TEST_F(SbSysInfoTest, OSFriendlyName) {
std::string os_name_str = SbSysInfo::OSFriendlyName();
EXPECT_NE(os_name_str, "");
}
#endif

} // namespace starboard
Expand Down
7 changes: 6 additions & 1 deletion cobalt/browser/user_agent/user_agent_platform_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ void UserAgentPlatformInfo::InitializePlatformDependentFieldsAndroid() {
}
#elif BUILDFLAG(IS_STARBOARD)
void UserAgentPlatformInfo::InitializePlatformDependentFieldsStarboard() {
const std::string os_name = base::SysInfo::OperatingSystemName();
std::string os_name = base::SysInfo::OperatingSystemName();
const std::string os_friendly_name =
base::starboard::SbSysInfo::OSFriendlyName();
if (!os_friendly_name.empty()) {
os_name = os_friendly_name + "; " + os_name;
}
const std::string os_version = base::SysInfo::OperatingSystemVersion();
set_os_name_and_version(
base::StringPrintf("%s %s", os_name.c_str(), os_version.c_str()));
Expand Down
Loading