Skip to content

Conversation

@cjreynol
Copy link
Collaborator

@cjreynol cjreynol commented Jan 27, 2026

NOTE: I saw there is a 4th value listed in the help text for data_policy, but there is no matching enum value. Reference:

Bug: 442664611

To re-use the same parsing logic for metrics gathering.

Bug:442664611
Not yet converted for transmission, but available.

Bug: 442664611
@cjreynol cjreynol self-assigned this Jan 27, 2026
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Jan 27, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Jan 27, 2026
@cjreynol cjreynol requested a review from Databean January 27, 2026 18:43
Result<DataPolicyFlag> DataPolicyFlag::FromGlobalGflags() {
const auto flag_info = gflags::GetCommandLineFlagInfoOrDie(kFlagName);
std::vector<std::string> flag_values =
CF_EXPECT(StringFromGlobalGflags(flag_info, kFlagName));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we take this opportunity to move the string-to-enum conversion earlier, so we can do an enum-to-enum conversion in the metrics code instead?

The other conversion only happens when reading from the config so the ideal would be to store the enum in the config, but that expands the scope of this change by a bit.

using logs::proto::wireless::android::cuttlefish::events::MetricsEventV2;

CuttlefishFlags_DataPolicy ConvertDataPolicy(std::string_view data_policy) {
if (data_policy == "always_create") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these use the common string constants?

static constexpr std::string_view kDataPolicyAlwaysCreate = "always_create";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants