Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,7 @@ DEFINE_int32(num_instances, CF_DEFAULTS_NUM_INSTANCES,
DEFINE_string(instance_nums, CF_DEFAULTS_INSTANCE_NUMS,
"A comma-separated list of instance numbers "
"to use. Mutually exclusive with base_instance_num.");
DEFINE_string(report_anonymous_usage_stats,
CF_DEFAULTS_REPORT_ANONYMOUS_USAGE_STATS,
"Report anonymous usage "
"statistics for metrics collection and analysis.");
DEFINE_string(report_anonymous_usage_stats, "", "Deprecated, no usage.");
DEFINE_vec(ril_dns, CF_DEFAULTS_RIL_DNS, "DNS address of mobile network (RIL)");
DEFINE_vec(kgdb, fmt::format("{}", CF_DEFAULTS_KGDB),
"Configure the virtual device for debugging the kernel "
Expand Down
3 changes: 0 additions & 3 deletions base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ Result<CuttlefishConfig> InitializeCuttlefishConfiguration(

tmp_config_obj.set_sig_server_address(FLAGS_webrtc_sig_server_addr);

tmp_config_obj.set_enable_metrics(FLAGS_report_anonymous_usage_stats);
// TODO(moelsherif): Handle this flag (set_metrics_binary) in the future

std::optional<bool> guest_config_mac80211_hwsim =
guest_configs[0].enforce_mac80211_hwsim;
if (guest_config_mac80211_hwsim.has_value()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@
#define CF_DEFAULTS_FIXED_LOCATION_FILE_PATH CF_DEFAULTS_DYNAMIC_STRING
#define CF_DEFAULTS_GNSS_FILE_PATH CF_DEFAULTS_DYNAMIC_STRING

// Metrics default parameters
// TODO: Defined twice , please remove redundant definitions
#define CF_DEFAULTS_REPORT_ANONYMOUS_USAGE_STATS CF_DEFAULTS_DYNAMIC_STRING

// MCU emulator default configuration path
#define CF_DEFAULTS_MCU_CONFIG_PATH CF_DEFAULTS_DYNAMIC_STRING

Expand Down
2 changes: 2 additions & 0 deletions base/cvd/cuttlefish/host/commands/cvd/cli/commands/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ Result<void> CreateSymlinks(const LocalInstanceGroup& group) {
// dangling. The config file in the home directory is used by
// cvd_internal_start to persist the user's choice for
// -report_anonymous_usage_stats.
// NOTE: --report_anonymous_usage_stats flag and its value in the config are
// deprecated
CF_EXPECT(
Copy(group.Instances()[0].InstanceDirectory() + "/cuttlefish_config.json",
CF_EXPECT(SystemWideUserHome()) + "/.cuttlefish_config.json"),
Expand Down
41 changes: 15 additions & 26 deletions base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,8 @@ CvdStartCommandHandler::CvdStartCommandHandler(
static bool HasUnsafeFlagsForBypass(const std::vector<std::string>& args) {
std::vector<std::string> args_copy = args;
bool daemon = true;
std::string report_anonymous = "";
std::vector<Flag> safe_flags = {
GflagsCompatFlag("daemon", daemon),
GflagsCompatFlag("report_anonymous_usage_stats", report_anonymous),
};
auto res = ConsumeFlags(safe_flags, args_copy);
if (!res.ok()) {
Expand Down Expand Up @@ -374,15 +372,6 @@ Result<void> CvdStartCommandHandler::Handle(const CommandRequest& request) {

CF_EXPECT(ConsumeFlags(BuildOwnFlags(), subcmd_args));
subcmd_args.push_back("--daemon=true");
if (own_flags_.report_anonymous_usage_stats) {
subcmd_args.push_back("--report_anonymous_usage_stats=" +
*own_flags_.report_anonymous_usage_stats);
} else if (!own_flags_.daemon) {
// If the user did not specify the anonymous usage stats flag, default it
// to 'n' to ensure that cvd_internal_start does not block waiting for
// input on stdin.
subcmd_args.push_back("--report_anonymous_usage_stats=n");
}

LocalInstanceGroup group =
CF_EXPECT(selector::SelectGroup(instance_manager_, request),
Expand Down Expand Up @@ -572,6 +561,8 @@ Result<void> CvdStartCommandHandler::LaunchDeviceInterruptible(
// determine the default value for the -report_anonymous_usage_stats flag so
// we symlink that to the group's home directory, this link will be
// overwritten later by cvd_internal_start itself.
// NOTE: --report_anonymous_usage_stats flag and its value in the config are
// deprecated
auto symlink_config_res = SymlinkPreviousConfig(group.HomeDir());
if (!symlink_config_res.ok()) {
LOG(ERROR) << "Failed to symlink the config file at system wide home: "
Expand Down Expand Up @@ -687,21 +678,19 @@ Result<std::vector<Flag>> CvdStartCommandHandler::Flags(
}

std::vector<Flag> CvdStartCommandHandler::BuildOwnFlags() {
return {GflagsCompatFlag("host_substitutions", own_flags_.host_substitutions)
.Help("Comma separated list of files to replace in the host "
"artifacts from the android build with artifacts from the "
"cuttlefish-base package. The special value \"all\" causes "
"it to replace everything it can, while with an empty it "
"will replace what the android build specifies in the "
"'debian_substitution_marker' file."),
GflagsCompatFlag("daemon", own_flags_.daemon)
.Help("Run the start command in the background as a daemon. "
"If false, the command runs in the foreground and monitors "
"logs."),
GflagsCompatFlag("report_anonymous_usage_stats",
own_flags_.report_anonymous_usage_stats)
.Help("Report anonymous usage stats. In foreground mode, "
"defaults to 'n' if not specified.")};
return {
GflagsCompatFlag("host_substitutions", own_flags_.host_substitutions)
.Help("Comma separated list of files to replace in the host "
"artifacts from the android build with artifacts from the "
"cuttlefish-base package. The special value \"all\" causes "
"it to replace everything it can, while with an empty it "
"will replace what the android build specifies in the "
"'debian_substitution_marker' file."),
GflagsCompatFlag("daemon", own_flags_.daemon)
.Help("Run the start command in the background as a daemon. "
"If false, the command runs in the foreground and monitors "
"logs."),
};
}

} // namespace cuttlefish
1 change: 0 additions & 1 deletion base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class CvdStartCommandHandler : public CvdCommandHandler {
struct {
std::vector<std::string> host_substitutions;
bool daemon;
std::optional<std::string> report_anonymous_usage_stats;
} own_flags_;
};

Expand Down
24 changes: 0 additions & 24 deletions base/cvd/cuttlefish/host/commands/cvd/cli/parser/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@ cf_cc_library(
],
)

cf_cc_library(
name = "cf_metrics_configs",
srcs = ["cf_metrics_configs.cpp"],
hdrs = ["cf_metrics_configs.h"],
deps = [
"//cuttlefish/host/commands/cvd/cli/parser:cf_configs_common",
"//cuttlefish/host/commands/cvd/cli/parser:load_config_cc_proto",
],
)

cf_cc_test(
name = "configs_inheritance_test",
srcs = ["configs_inheritance_test.cc"],
Expand Down Expand Up @@ -108,7 +98,6 @@ cf_cc_library(
deps = [
"//cuttlefish/host/commands/cvd/cli/parser:cf_configs_common",
"//cuttlefish/host/commands/cvd/cli/parser:cf_configs_instances",
"//cuttlefish/host/commands/cvd/cli/parser:cf_metrics_configs",
"//cuttlefish/host/commands/cvd/cli/parser:launch_cvd_templates",
"//cuttlefish/host/commands/cvd/cli/parser:load_config_cc_proto",
"//cuttlefish/result",
Expand Down Expand Up @@ -177,19 +166,6 @@ cf_cc_library(
],
)

cf_cc_test(
name = "metrics_configs_test",
srcs = ["metrics_configs_test.cc"],
depend_on_what_you_use_enabled = False,
deps = [
"//cuttlefish/host/commands/cvd/cli/parser:test_common",
"//cuttlefish/result",
"//cuttlefish/result:result_matchers",
"//libbase",
"@jsoncpp",
],
)

cf_cc_library(
name = "selector_parser",
srcs = ["selector_parser.cpp"],
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "cuttlefish/host/commands/cvd/cli/parser/cf_configs_common.h"
#include "cuttlefish/host/commands/cvd/cli/parser/cf_configs_instances.h"
#include "cuttlefish/host/commands/cvd/cli/parser/cf_metrics_configs.h"
#include "cuttlefish/host/commands/cvd/cli/parser/launch_cvd_templates.h"
#include "cuttlefish/host/commands/cvd/cli/parser/load_config.pb.h"
#include "cuttlefish/result/result.h"
Expand Down Expand Up @@ -76,7 +75,6 @@ Result<std::vector<std::string>> GenerateCfFlags(
GenerateFlag("netsim_args", absl::StrJoin(launch.netsim_args(), " ")));
}

flags = MergeResults(std::move(flags), GenerateMetricsFlags(launch));
flags =
MergeResults(std::move(flags), CF_EXPECT(GenerateInstancesFlags(launch)));
auto flag_op = GenerateUndefOkFlag(flags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ enum ModemSimulatorSimType {
}

message EnvironmentSpecification {
// deprecated v1 metrics enabling field, report_anonymous_usage_stats
reserved 3;
reserved "metrics";

repeated Instance instances = 1;
optional Fetch fetch = 2;
optional Metrics metrics = 3;
optional Common common = 4;
optional bool netsim_bt = 5;
optional bool netsim_uwb = 6;
Expand All @@ -57,8 +60,11 @@ message EnvironmentSpecification {
// TODO: chadreynolds - when we can make breaking changes and update, use this
// in EnvironmentSpecification instead of individual fields
message EnvironmentOptions {
// deprecated v1 metrics enabling field, report_anonymous_usage_stats
reserved 2;
reserved "metrics";

optional Fetch fetch = 1;
optional Metrics metrics = 2;
optional Common common = 3;
optional bool netsim_bt = 4;
optional bool netsim_uwb = 5;
Expand Down Expand Up @@ -222,10 +228,6 @@ message DeviceState {
optional int32 hinge_angle_value = 2;
}

message Metrics {
optional bool enable = 1;
}

message DisplayOverlay {
int32 vm_index = 1;
int32 display_index = 2;
Expand Down
Loading
Loading