// Copyright 2013 Google Inc. All Rights Reserved. #include #include "cutils/properties.h" #include "properties.h" namespace { bool GetAndroidProperty(const char* key, std::string& value) { char val[PROPERTY_VALUE_MAX]; if (property_get(key, val, "Unknown") <= 0) return false; value = val; return true; } } namespace wvcdm { bool Properties::GetModelName(std::string& model_name) { return GetAndroidProperty("ro.product.model", model_name); } bool Properties::GetArchitectureName(std::string& arch_name) { return GetAndroidProperty("ro.product.cpu.abi", arch_name); } bool Properties::GetDeviceName(std::string& device_name) { return GetAndroidProperty("ro.product.device", device_name); } bool Properties::GetProductName(std::string& product_name) { return GetAndroidProperty("ro.product.name", product_name); } bool Properties::GetBuildInfo(std::string& build_info) { return GetAndroidProperty("ro.build.fingerprint", build_info); } } // namespace wvcdm