Merge "metricsd: Fix the update channel parsing logic." am: 87d2486777 am: 2a95850444
am: fe0479e0d0

* commit 'fe0479e0d01ba713e4f7533b5f0ab1768a9bf26d':
  metricsd: Fix the update channel parsing logic.
diff --git a/metricsd/uploader/system_profile_cache.cc b/metricsd/uploader/system_profile_cache.cc
index f7060a2..637cf9e 100644
--- a/metricsd/uploader/system_profile_cache.cc
+++ b/metricsd/uploader/system_profile_cache.cc
@@ -179,13 +179,13 @@
 
 metrics::SystemProfileProto_Channel SystemProfileCache::ProtoChannelFromString(
     const std::string& channel) {
-  if (channel == "stable") {
+  if (channel == "stable-channel") {
     return metrics::SystemProfileProto::CHANNEL_STABLE;
-  } else if (channel == "dev") {
+  } else if (channel == "dev-channel") {
     return metrics::SystemProfileProto::CHANNEL_DEV;
-  } else if (channel == "beta") {
+  } else if (channel == "beta-channel") {
     return metrics::SystemProfileProto::CHANNEL_BETA;
-  } else if (channel == "canary") {
+  } else if (channel == "canary-channel") {
     return metrics::SystemProfileProto::CHANNEL_CANARY;
   }
 
diff --git a/metricsd/uploader/upload_service_test.cc b/metricsd/uploader/upload_service_test.cc
index 236376a..47e7b91 100644
--- a/metricsd/uploader/upload_service_test.cc
+++ b/metricsd/uploader/upload_service_test.cc
@@ -214,10 +214,10 @@
       metrics::SystemProfileProto::CHANNEL_UNKNOWN);
 
   EXPECT_EQ(metrics::SystemProfileProto::CHANNEL_DEV,
-            SystemProfileCache::ProtoChannelFromString("dev"));
+            SystemProfileCache::ProtoChannelFromString("dev-channel"));
 
   EXPECT_EQ(metrics::SystemProfileProto::CHANNEL_STABLE,
-            SystemProfileCache::ProtoChannelFromString("stable"));
+            SystemProfileCache::ProtoChannelFromString("stable-channel"));
 
   EXPECT_EQ(metrics::SystemProfileProto::CHANNEL_UNKNOWN,
             SystemProfileCache::ProtoChannelFromString("this is a test"));