Commit 865bf2ba authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS PhoneHub] Add Phone Hub features to enum_util.cc

This was left off a previous CL which originally added enum values and
was not noticed because things worked correctly with DeviceSync v2.
However, DeviceSync v1 still requires these util functions to be
correct.

Bug: 1106937
Change-Id: I5048949615d2c9eeb27631a75be5a0d560d390fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373298
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Josh Nohle <nohle@chromium.org>
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarJosh Nohle <nohle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801254}
parent 8f7eb755
...@@ -85,6 +85,12 @@ std::ostream& operator<<(std::ostream& stream, ...@@ -85,6 +85,12 @@ std::ostream& operator<<(std::ostream& stream,
case cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT: case cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT:
stream << "[SMS Connect client]"; stream << "[SMS Connect client]";
break; break;
case cryptauth::SoftwareFeature::PHONE_HUB_HOST:
stream << "[Phone Hub host]";
break;
case cryptauth::SoftwareFeature::PHONE_HUB_CLIENT:
stream << "[Phone Hub client]";
break;
default: default:
stream << "[unknown software feature]"; stream << "[unknown software feature]";
break; break;
...@@ -110,6 +116,10 @@ cryptauth::SoftwareFeature SoftwareFeatureStringToEnum( ...@@ -110,6 +116,10 @@ cryptauth::SoftwareFeature SoftwareFeatureStringToEnum(
return cryptauth::SoftwareFeature::SMS_CONNECT_HOST; return cryptauth::SoftwareFeature::SMS_CONNECT_HOST;
if (software_feature_as_string == "smsConnectClient") if (software_feature_as_string == "smsConnectClient")
return cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT; return cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT;
if (software_feature_as_string == "phoneHubHost")
return cryptauth::SoftwareFeature::PHONE_HUB_HOST;
if (software_feature_as_string == "phoneHubClient")
return cryptauth::SoftwareFeature::PHONE_HUB_CLIENT;
return cryptauth::SoftwareFeature::UNKNOWN_FEATURE; return cryptauth::SoftwareFeature::UNKNOWN_FEATURE;
} }
...@@ -133,6 +143,10 @@ std::string SoftwareFeatureEnumToString( ...@@ -133,6 +143,10 @@ std::string SoftwareFeatureEnumToString(
return "smsConnectHost"; return "smsConnectHost";
case cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT: case cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT:
return "smsConnectClient"; return "smsConnectClient";
case cryptauth::SoftwareFeature::PHONE_HUB_HOST:
return "phoneHubHost";
case cryptauth::SoftwareFeature::PHONE_HUB_CLIENT:
return "phoneHubClient";
default: default:
return "unknownFeature"; return "unknownFeature";
} }
...@@ -157,6 +171,10 @@ std::string SoftwareFeatureEnumToStringAllCaps( ...@@ -157,6 +171,10 @@ std::string SoftwareFeatureEnumToStringAllCaps(
return "SMS_CONNECT_HOST"; return "SMS_CONNECT_HOST";
case cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT: case cryptauth::SoftwareFeature::SMS_CONNECT_CLIENT:
return "SMS_CONNECT_CLIENT"; return "SMS_CONNECT_CLIENT";
case cryptauth::SoftwareFeature::PHONE_HUB_HOST:
return "PHONE_HUB_HOST";
case cryptauth::SoftwareFeature::PHONE_HUB_CLIENT:
return "PHONE_HUB_CLIENT";
default: default:
return "UNKNOWN_FEATURE"; return "UNKNOWN_FEATURE";
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment