#include "device/bluetooth/floss/floss_features.h"
#include "base/system/sys_info.h"
namespace floss {
namespace features {
#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kFlossEnabled, "Floss", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kLLPrivacyIsAvailable, base::FEATURE_ENABLED_BY_DEFAULT);
namespace {
constexpr const char* kNotLaunchedBoards[] = {
"",
};
}
static bool IsDeviceLaunchedFloss() {
std::string board = base::SysInfo::HardwareModelName();
if (auto pos = board.find('-'); pos != std::string::npos) {
board.erase(pos);
}
for (auto* b : kNotLaunchedBoards) {
if (board.compare(b) == 0) {
return false;
}
}
return true;
}
#endif
bool IsFlossEnabled() {
#if BUILDFLAG(IS_CHROMEOS)
if (!base::FeatureList::GetStateIfOverridden(floss::features::kFlossEnabled)
.has_value() &&
IsDeviceLaunchedFloss()) {
return true;
}
return base::FeatureList::IsEnabled(floss::features::kFlossEnabled);
#else
return false;
#endif
}
bool IsLLPrivacyAvailable() {
#if BUILDFLAG(IS_CHROMEOS)
return base::FeatureList::IsEnabled(floss::features::kLLPrivacyIsAvailable);
#else
return false;
#endif
}
}
}