shill: Use synchronous GetAll calls to ModemManager

Recently we added async calls to DBusPropertiesProxy.

When using those for calls to ModemManager, cellular
connections started to fail.

This makes those calls synchronous again while we investigate
the root cause.

BUG=b:175694667
TEST=Manual connect to Cellular network succeeds

Change-Id: I524827ec9e0d28b7ce1925a4ecaf570138a07281
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2595671
Tested-by: Steven Bennetts <stevenjb@chromium.org>
Tested-by: Pavan Holla <pholla@google.com>
Auto-Submit: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Pavan Holla <pholla@google.com>
diff --git a/shill/cellular/cellular_bearer.cc b/shill/cellular/cellular_bearer.cc
index dc363d5..5093fff 100644
--- a/shill/cellular/cellular_bearer.cc
+++ b/shill/cellular/cellular_bearer.cc
@@ -172,14 +172,8 @@
   if (!dbus_properties_proxy_)
     return;
 
-  dbus_properties_proxy_->GetAllAsync(
-      MM_DBUS_INTERFACE_BEARER,
-      base::Bind(&CellularBearer::OnPropertiesChanged,
-                 weak_ptr_factory_.GetWeakPtr(), MM_DBUS_INTERFACE_BEARER),
-      base::Bind([](const Error& error) {
-        LOG(WARNING) << "Error fetching modem bearer properties: " << error
-                     << ". Bearer is likely gone and thus ignored.";
-      }));
+  auto properties = dbus_properties_proxy_->GetAll(MM_DBUS_INTERFACE_BEARER);
+  OnPropertiesChanged(MM_DBUS_INTERFACE_BEARER, properties);
 }
 
 void CellularBearer::OnPropertiesChanged(
diff --git a/shill/cellular/cellular_capability_3gpp.cc b/shill/cellular/cellular_capability_3gpp.cc
index bb2b1f0..4452cf8 100644
--- a/shill/cellular/cellular_capability_3gpp.cc
+++ b/shill/cellular/cellular_capability_3gpp.cc
@@ -762,21 +762,12 @@
   SLOG(this, 3) << __func__;
   CHECK(dbus_properties_proxy_);
 
-  dbus_properties_proxy_->GetAllAsync(
-      MM_DBUS_INTERFACE_MODEM,
-      base::Bind(&CellularCapability3gpp::OnModemPropertiesChanged,
-                 weak_ptr_factory_.GetWeakPtr()),
-      base::Bind([](const Error& error) {
-        LOG(ERROR) << "Error fetching modem properties: " << error;
-      }));
+  auto properties = dbus_properties_proxy_->GetAll(MM_DBUS_INTERFACE_MODEM);
+  OnModemPropertiesChanged(properties);
 
-  dbus_properties_proxy_->GetAllAsync(
-      MM_DBUS_INTERFACE_MODEM_MODEM3GPP,
-      base::Bind(&CellularCapability3gpp::OnModem3gppPropertiesChanged,
-                 weak_ptr_factory_.GetWeakPtr()),
-      base::Bind([](const Error& error) {
-        LOG(ERROR) << "Error fetching modem 3GPP properties: " << error;
-      }));
+  auto properties_3gpp =
+      dbus_properties_proxy_->GetAll(MM_DBUS_INTERFACE_MODEM_MODEM3GPP);
+  OnModem3gppPropertiesChanged(properties_3gpp);
 }
 
 void CellularCapability3gpp::UpdateServiceOLP() {
@@ -1752,21 +1743,12 @@
   std::unique_ptr<DBusPropertiesProxy> sim_properties_proxy =
       control_interface()->CreateDBusPropertiesProxy(
           sim_path, cellular()->dbus_service());
-  DBusPropertiesProxy* sim_properties_proxy_ptr = sim_properties_proxy.get();
-  sim_properties_proxy_ptr->GetAllAsync(
-      MM_DBUS_INTERFACE_SIM,
-      base::Bind(&CellularCapability3gpp::OnGetSimProperties,
-                 weak_ptr_factory_.GetWeakPtr(), sim_path,
-                 base::Passed(&sim_properties_proxy)),
-      base::Bind([](const Error& error) {
-        LOG(ERROR) << "Error fetching SIM properties: " << error;
-      }));
+  auto sim_properties = sim_properties_proxy->GetAll(MM_DBUS_INTERFACE_SIM);
+  OnGetSimProperties(sim_path, sim_properties);
 }
 
 void CellularCapability3gpp::OnGetSimProperties(
-    RpcIdentifier sim_path,
-    std::unique_ptr<DBusPropertiesProxy> sim_properties_proxy,
-    const KeyValueStore& properties) {
+    RpcIdentifier sim_path, const KeyValueStore& properties) {
   if (sim_path == sim_path_)
     OnSimPropertiesChanged(properties);
   // |sim_properties_proxy| will be safely released here.
diff --git a/shill/cellular/cellular_capability_3gpp.h b/shill/cellular/cellular_capability_3gpp.h
index 9dd33dc..47a8e4d 100644
--- a/shill/cellular/cellular_capability_3gpp.h
+++ b/shill/cellular/cellular_capability_3gpp.h
@@ -312,10 +312,8 @@
   // SIM property change handlers
   // TODO(armansito): Put these methods in a 3GPP-only subclass.
   void RequestSimProperties(RpcIdentifier sim_path);
-  void OnGetSimProperties(
-      RpcIdentifier sim_path,
-      std::unique_ptr<DBusPropertiesProxy> sim_properties_proxy,
-      const KeyValueStore& properties);
+  void OnGetSimProperties(RpcIdentifier sim_path,
+                          const KeyValueStore& properties);
   void OnSimPropertiesChanged(const KeyValueStore& properties);
   void OnSpnChanged(const std::string& spn);
   void OnSimIdentifierChanged(const std::string& id);
diff --git a/shill/cellular/cellular_capability_cdma.cc b/shill/cellular/cellular_capability_cdma.cc
index c546087..325d2c2 100644
--- a/shill/cellular/cellular_capability_cdma.cc
+++ b/shill/cellular/cellular_capability_cdma.cc
@@ -258,13 +258,8 @@
   std::unique_ptr<DBusPropertiesProxy> properties_proxy =
       control_interface()->CreateDBusPropertiesProxy(
           cellular()->dbus_path(), cellular()->dbus_service());
-  properties_proxy->GetAllAsync(
-      MM_DBUS_INTERFACE_MODEM_MODEMCDMA,
-      base::Bind(&CellularCapabilityCdma::OnModemCdmaPropertiesChanged,
-                 weak_cdma_ptr_factory_.GetWeakPtr()),
-      base::Bind([](const Error& error) {
-        LOG(ERROR) << "Error fetching modem CDMA properties: " << error;
-      }));
+  auto properties = properties_proxy->GetAll(MM_DBUS_INTERFACE_MODEM_MODEMCDMA);
+  OnModemCdmaPropertiesChanged(properties);
 }
 
 void CellularCapabilityCdma::OnActivationStateChangedSignal(