aboutsummaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2024-04-29 12:41:43 -0700
committerJason Macnak <natsu@google.com>2024-04-29 14:32:57 -0700
commitbfb414a562d2e65a87220f9d8287c779e24dfe14 (patch)
treecdcfd8529c4d88fe701cb03058d143ffa807b35c /host
parent4444f3f2aad73718fa9674251f365b6c907ac986 (diff)
downloadcuttlefish-bfb414a562d2e65a87220f9d8287c779e24dfe14.tar.gz
Update modem_simulator to read RIL settings from CuttlefishConfig
... in order to remove modem_simulator's dependency on device config. Bug: b/261231681 Test: launch Cuttlefish and open Youtube in browser Change-Id: I850cf4d4bf9fdbe24fc261ac597878ee93d22f3f
Diffstat (limited to 'host')
-rw-r--r--host/commands/modem_simulator/Android.bp2
-rw-r--r--host/commands/modem_simulator/cf_device_config.cpp28
2 files changed, 9 insertions, 21 deletions
diff --git a/host/commands/modem_simulator/Android.bp b/host/commands/modem_simulator/Android.bp
index c0d03718e..0f684e825 100644
--- a/host/commands/modem_simulator/Android.bp
+++ b/host/commands/modem_simulator/Android.bp
@@ -43,8 +43,6 @@ cc_defaults {
"libbase",
"libjsoncpp",
"libnl",
- "libcuttlefish_device_config",
- "libcuttlefish_device_config_proto",
],
static_libs: [
"libcuttlefish_host_config",
diff --git a/host/commands/modem_simulator/cf_device_config.cpp b/host/commands/modem_simulator/cf_device_config.cpp
index 1201db51a..58a740a23 100644
--- a/host/commands/modem_simulator/cf_device_config.cpp
+++ b/host/commands/modem_simulator/cf_device_config.cpp
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include "common/libs/device_config/device_config.h"
#include "host/commands/modem_simulator/device_config.h"
#include "host/libs/config/cuttlefish_config.h"
@@ -45,30 +44,21 @@ std::string DeviceConfig::DefaultHostArtifactsPath(const std::string& file) {
}
std::string DeviceConfig::ril_address_and_prefix() {
- auto device_config_helper = cuttlefish::DeviceConfigHelper::Get();
- if (!device_config_helper) {
- return "10.0.2.15/24";
- }
- const auto& ril_config = device_config_helper->GetDeviceConfig().ril_config();
- return ril_config.ipaddr() + "/" + std::to_string(ril_config.prefixlen());
+ auto config = cuttlefish::CuttlefishConfig::Get();
+ auto instance = config->ForDefaultInstance();
+ return instance.ril_ipaddr() + "/" + std::to_string(instance.ril_prefixlen());
};
std::string DeviceConfig::ril_gateway() {
- auto device_config_helper = cuttlefish::DeviceConfigHelper::Get();
- if (!device_config_helper) {
- return "10.0.2.2";
- }
- const auto& ril_config = device_config_helper->GetDeviceConfig().ril_config();
- return ril_config.gateway();
+ auto config = cuttlefish::CuttlefishConfig::Get();
+ auto instance = config->ForDefaultInstance();
+ return instance.ril_gateway();
}
std::string DeviceConfig::ril_dns() {
- auto device_config_helper = cuttlefish::DeviceConfigHelper::Get();
- if (!device_config_helper) {
- return "8.8.8.8";
- }
- const auto& ril_config = device_config_helper->GetDeviceConfig().ril_config();
- return ril_config.dns();
+ auto config = cuttlefish::CuttlefishConfig::Get();
+ auto instance = config->ForDefaultInstance();
+ return instance.ril_dns();
}
std::ifstream DeviceConfig::open_ifstream_crossplat(const char* filename) {