Remove setters and json backing for runtime files
These are at fixed paths relative to cuttlefish_runtime (aka
instance_dir) already, the duplicate data doesn't need to be stored.
This is incremental progress to making cuttlefish_config.json reusable
between instances, as there are now less absolute paths.
Bug: 145247175
Test: Run locally, check logcat is still present.
Change-Id: If4900ef3d0217b4ea90c43f8b24c2537ca178c58
diff --git a/host/commands/assemble_cvd/flags.cc b/host/commands/assemble_cvd/flags.cc
index 4495d13..f776042 100644
--- a/host/commands/assemble_cvd/flags.cc
+++ b/host/commands/assemble_cvd/flags.cc
@@ -299,21 +299,11 @@
tmp_config_obj.PerInstanceInternalPath("usb-ip"));
}
- tmp_config_obj.set_kernel_log_pipe_name(
- tmp_config_obj.PerInstanceInternalPath("kernel-log-pipe"));
- tmp_config_obj.set_console_pipe_name(
- tmp_config_obj.PerInstanceInternalPath("console-pipe"));
tmp_config_obj.set_deprecated_boot_completed(FLAGS_deprecated_boot_completed);
- tmp_config_obj.set_console_path(tmp_config_obj.PerInstancePath("console"));
- tmp_config_obj.set_logcat_path(tmp_config_obj.PerInstancePath("logcat"));
tmp_config_obj.set_logcat_receiver_binary(
vsoc::DefaultHostArtifactsPath("bin/logcat_receiver"));
tmp_config_obj.set_config_server_binary(
vsoc::DefaultHostArtifactsPath("bin/config_server"));
- tmp_config_obj.set_launcher_log_path(
- tmp_config_obj.PerInstancePath("launcher.log"));
- tmp_config_obj.set_launcher_monitor_socket_path(
- tmp_config_obj.PerInstancePath("launcher_monitor.sock"));
tmp_config_obj.set_mobile_bridge_name(FLAGS_mobile_interface);
tmp_config_obj.set_mobile_tap_name(FLAGS_mobile_tap_name);
diff --git a/host/libs/config/cuttlefish_config.cpp b/host/libs/config/cuttlefish_config.cpp
index 93c5635..ae89a21 100644
--- a/host/libs/config/cuttlefish_config.cpp
+++ b/host/libs/config/cuttlefish_config.cpp
@@ -96,13 +96,7 @@
const char* kUsbV1SocketName = "usb_v1_socket_name";
const char* kVhciPort = "vhci_port";
const char* kUsbIpSocketName = "usb_ip_socket_name";
-const char* kKernelLogPipeName = "kernel_log_pipe_name";
-const char* kConsolePipeName = "console_pipe_name";
const char* kDeprecatedBootCompleted = "deprecated_boot_completed";
-const char* kConsolePath = "console_path";
-const char* kLogcatPath = "logcat_path";
-const char* kLauncherLogPath = "launcher_log_path";
-const char* kLauncherMonitorPath = "launcher_monitor_socket";
const char* kMobileBridgeName = "mobile_bridge_name";
const char* kMobileTapName = "mobile_tap_name";
@@ -361,19 +355,11 @@
}
std::string CuttlefishConfig::kernel_log_pipe_name() const {
- return (*dictionary_)[kKernelLogPipeName].asString();
-}
-void CuttlefishConfig::set_kernel_log_pipe_name(
- const std::string& kernel_log_pipe_name) {
- (*dictionary_)[kKernelLogPipeName] = kernel_log_pipe_name;
+ return cvd::AbsolutePath(PerInstanceInternalPath("kernel-log-pipe"));
}
std::string CuttlefishConfig::console_pipe_name() const {
- return (*dictionary_)[kConsolePipeName].asString();
-}
-void CuttlefishConfig::set_console_pipe_name(
- const std::string& console_pipe_name) {
- SetPath(kConsolePipeName, console_pipe_name);
+ return cvd::AbsolutePath(PerInstanceInternalPath("console-pipe"));
}
bool CuttlefishConfig::deprecated_boot_completed() const {
@@ -385,33 +371,19 @@
}
std::string CuttlefishConfig::console_path() const {
- return (*dictionary_)[kConsolePath].asString();
-}
-void CuttlefishConfig::set_console_path(const std::string& console_path) {
- SetPath(kConsolePath, console_path);
+ return cvd::AbsolutePath(PerInstancePath("console"));
}
std::string CuttlefishConfig::logcat_path() const {
- return (*dictionary_)[kLogcatPath].asString();
-}
-void CuttlefishConfig::set_logcat_path(const std::string& logcat_path) {
- SetPath(kLogcatPath, logcat_path);
+ return cvd::AbsolutePath(PerInstancePath("logcat"));
}
std::string CuttlefishConfig::launcher_monitor_socket_path() const {
- return (*dictionary_)[kLauncherMonitorPath].asString();
-}
-void CuttlefishConfig::set_launcher_monitor_socket_path(
- const std::string& launcher_monitor_path) {
- SetPath(kLauncherMonitorPath, launcher_monitor_path);
+ return cvd::AbsolutePath(PerInstancePath("launcher_monitor.sock"));
}
std::string CuttlefishConfig::launcher_log_path() const {
- return (*dictionary_)[kLauncherLogPath].asString();
-}
-void CuttlefishConfig::set_launcher_log_path(
- const std::string& launcher_log_path) {
- (*dictionary_)[kLauncherLogPath] = launcher_log_path;
+ return cvd::AbsolutePath(PerInstancePath("launcher.log"));
}
std::string CuttlefishConfig::mobile_bridge_name() const {
diff --git a/host/libs/config/cuttlefish_config.h b/host/libs/config/cuttlefish_config.h
index 0b23f00..aea9055 100644
--- a/host/libs/config/cuttlefish_config.h
+++ b/host/libs/config/cuttlefish_config.h
@@ -162,19 +162,15 @@
void set_usb_ip_socket_name(const std::string& usb_ip_socket_name);
std::string kernel_log_pipe_name() const;
- void set_kernel_log_pipe_name(const std::string& kernel_log_pipe_name);
std::string console_pipe_name() const;
- void set_console_pipe_name(const std::string& console_pipe_name);
bool deprecated_boot_completed() const;
void set_deprecated_boot_completed(bool deprecated_boot_completed);
std::string console_path() const;
- void set_console_path(const std::string& console_path);
std::string logcat_path() const;
- void set_logcat_path(const std::string& logcat_path);
std::string logcat_receiver_binary() const;
void set_logcat_receiver_binary(const std::string& binary);
@@ -183,11 +179,8 @@
void set_config_server_binary(const std::string& binary);
std::string launcher_log_path() const;
- void set_launcher_log_path(const std::string& launcher_log_path);
std::string launcher_monitor_socket_path() const;
- void set_launcher_monitor_socket_path(
- const std::string& launhcer_monitor_path);
std::string mobile_bridge_name() const;
void set_mobile_bridge_name(const std::string& mobile_bridge_name);