Loading metricsd/constants.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ static const char kFailedUploadCountName[] = "failed_upload_count"; static const char kDefaultVersion[] = "0.0.0.0"; static const char kDefaultVersion[] = "0.0.0.0"; // System properties used. // System properties used. static const char kBuildTargetIdProperty[] = "ro.product.build_target_id"; static const char kProductIdProperty[] = "ro.product.product_id"; static const char kChannelProperty[] = "ro.product.channel"; static const char kChannelProperty[] = "ro.product.channel"; static const char kProductVersionProperty[] = "ro.product.version"; static const char kProductVersionProperty[] = "ro.product.version"; } // namespace metrics } // namespace metrics Loading metricsd/uploader/system_profile_cache.cc +4 −4 Original line number Original line Diff line number Diff line Loading @@ -73,10 +73,10 @@ bool SystemProfileCache::Initialize() { CHECK(!initialized_) CHECK(!initialized_) << "this should be called only once in the metrics_daemon lifetime."; << "this should be called only once in the metrics_daemon lifetime."; profile_.build_target_id = GetProperty(metrics::kBuildTargetIdProperty); profile_.product_id = GetProperty(metrics::kProductIdProperty); if (profile_.build_target_id.empty()) { if (profile_.product_id.empty()) { LOG(ERROR) << "System property " << metrics::kBuildTargetIdProperty LOG(ERROR) << "System property " << metrics::kProductIdProperty << " is not set."; << " is not set."; return false; return false; } } Loading Loading @@ -136,7 +136,7 @@ bool SystemProfileCache::Populate( profile_proto->set_channel(profile_.channel); profile_proto->set_channel(profile_.channel); metrics::SystemProfileProto_BrilloDeviceData* device_data = metrics::SystemProfileProto_BrilloDeviceData* device_data = profile_proto->mutable_brillo(); profile_proto->mutable_brillo(); device_data->set_build_target_id(profile_.build_target_id); device_data->set_build_target_id(profile_.product_id); return true; return true; } } Loading metricsd/uploader/system_profile_cache.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,7 @@ struct SystemProfile { std::string client_id; std::string client_id; int session_id; int session_id; metrics::SystemProfileProto::Channel channel; metrics::SystemProfileProto::Channel channel; std::string build_target_id; std::string product_id; }; }; // Retrieves general system informations needed by the protobuf for context and // Retrieves general system informations needed by the protobuf for context and Loading metricsd/uploader/upload_service_test.cc +2 −2 Original line number Original line Diff line number Diff line Loading @@ -224,7 +224,7 @@ TEST_F(UploadServiceTest, ValuesInConfigFileAreSent) { upload_service_->sender_.reset(sender); upload_service_->sender_.reset(sender); SetTestingProperty(metrics::kChannelProperty, "beta"); SetTestingProperty(metrics::kChannelProperty, "beta"); SetTestingProperty(metrics::kBuildTargetIdProperty, "hello"); SetTestingProperty(metrics::kProductIdProperty, "hello"); SetTestingProperty(metrics::kProductVersionProperty, "1.2.3.4"); SetTestingProperty(metrics::kProductVersionProperty, "1.2.3.4"); scoped_ptr<metrics::MetricSample> histogram = scoped_ptr<metrics::MetricSample> histogram = Loading Loading @@ -267,7 +267,7 @@ TEST_F(UploadServiceTest, PersistentGUID) { } } TEST_F(UploadServiceTest, SessionIdIncrementedAtInitialization) { TEST_F(UploadServiceTest, SessionIdIncrementedAtInitialization) { SetTestingProperty(metrics::kBuildTargetIdProperty, "hello"); SetTestingProperty(metrics::kProductIdProperty, "hello"); SystemProfileCache cache(true, dir_.path()); SystemProfileCache cache(true, dir_.path()); cache.Initialize(); cache.Initialize(); int session_id = cache.profile_.session_id; int session_id = cache.profile_.session_id; Loading Loading
metricsd/constants.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ static const char kFailedUploadCountName[] = "failed_upload_count"; static const char kDefaultVersion[] = "0.0.0.0"; static const char kDefaultVersion[] = "0.0.0.0"; // System properties used. // System properties used. static const char kBuildTargetIdProperty[] = "ro.product.build_target_id"; static const char kProductIdProperty[] = "ro.product.product_id"; static const char kChannelProperty[] = "ro.product.channel"; static const char kChannelProperty[] = "ro.product.channel"; static const char kProductVersionProperty[] = "ro.product.version"; static const char kProductVersionProperty[] = "ro.product.version"; } // namespace metrics } // namespace metrics Loading
metricsd/uploader/system_profile_cache.cc +4 −4 Original line number Original line Diff line number Diff line Loading @@ -73,10 +73,10 @@ bool SystemProfileCache::Initialize() { CHECK(!initialized_) CHECK(!initialized_) << "this should be called only once in the metrics_daemon lifetime."; << "this should be called only once in the metrics_daemon lifetime."; profile_.build_target_id = GetProperty(metrics::kBuildTargetIdProperty); profile_.product_id = GetProperty(metrics::kProductIdProperty); if (profile_.build_target_id.empty()) { if (profile_.product_id.empty()) { LOG(ERROR) << "System property " << metrics::kBuildTargetIdProperty LOG(ERROR) << "System property " << metrics::kProductIdProperty << " is not set."; << " is not set."; return false; return false; } } Loading Loading @@ -136,7 +136,7 @@ bool SystemProfileCache::Populate( profile_proto->set_channel(profile_.channel); profile_proto->set_channel(profile_.channel); metrics::SystemProfileProto_BrilloDeviceData* device_data = metrics::SystemProfileProto_BrilloDeviceData* device_data = profile_proto->mutable_brillo(); profile_proto->mutable_brillo(); device_data->set_build_target_id(profile_.build_target_id); device_data->set_build_target_id(profile_.product_id); return true; return true; } } Loading
metricsd/uploader/system_profile_cache.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,7 @@ struct SystemProfile { std::string client_id; std::string client_id; int session_id; int session_id; metrics::SystemProfileProto::Channel channel; metrics::SystemProfileProto::Channel channel; std::string build_target_id; std::string product_id; }; }; // Retrieves general system informations needed by the protobuf for context and // Retrieves general system informations needed by the protobuf for context and Loading
metricsd/uploader/upload_service_test.cc +2 −2 Original line number Original line Diff line number Diff line Loading @@ -224,7 +224,7 @@ TEST_F(UploadServiceTest, ValuesInConfigFileAreSent) { upload_service_->sender_.reset(sender); upload_service_->sender_.reset(sender); SetTestingProperty(metrics::kChannelProperty, "beta"); SetTestingProperty(metrics::kChannelProperty, "beta"); SetTestingProperty(metrics::kBuildTargetIdProperty, "hello"); SetTestingProperty(metrics::kProductIdProperty, "hello"); SetTestingProperty(metrics::kProductVersionProperty, "1.2.3.4"); SetTestingProperty(metrics::kProductVersionProperty, "1.2.3.4"); scoped_ptr<metrics::MetricSample> histogram = scoped_ptr<metrics::MetricSample> histogram = Loading Loading @@ -267,7 +267,7 @@ TEST_F(UploadServiceTest, PersistentGUID) { } } TEST_F(UploadServiceTest, SessionIdIncrementedAtInitialization) { TEST_F(UploadServiceTest, SessionIdIncrementedAtInitialization) { SetTestingProperty(metrics::kBuildTargetIdProperty, "hello"); SetTestingProperty(metrics::kProductIdProperty, "hello"); SystemProfileCache cache(true, dir_.path()); SystemProfileCache cache(true, dir_.path()); cache.Initialize(); cache.Initialize(); int session_id = cache.profile_.session_id; int session_id = cache.profile_.session_id; Loading