Merge "roots: Remove get_system_root and logical_partitions_mapped." am: ba8f38d741 am: c53856dca7
am: fb4f72cb7c

Change-Id: Ib4c2cc6f5f90f1ee59461d52f43a6fcb035bcf03
diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp
index 0f8fffa..9dc0fd8 100644
--- a/fsck_unshare_blocks.cpp
+++ b/fsck_unshare_blocks.cpp
@@ -34,6 +34,7 @@
 #include <android-base/logging.h>
 #include <android-base/properties.h>
 #include <android-base/unique_fd.h>
+#include <fs_mgr/roots.h>
 
 #include "otautil/roots.h"
 
@@ -119,7 +120,7 @@
   std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" };
 
   // Temporarily mount system so we can copy e2fsck_static.
-  std::string system_root = get_system_root();
+  auto system_root = android::fs_mgr::GetSystemRoot();
   bool mounted = ensure_path_mounted_at(system_root, "/mnt/system") != -1;
   partitions.push_back(system_root);
 
diff --git a/otautil/include/otautil/roots.h b/otautil/include/otautil/roots.h
index 482f3d0..2ab3f45 100644
--- a/otautil/include/otautil/roots.h
+++ b/otautil/include/otautil/roots.h
@@ -53,7 +53,3 @@
 // Ensure that all and only the volumes that packages expect to find
 // mounted (/tmp and /cache) are mounted.  Returns 0 on success.
 int setup_install_mounts();
-
-bool logical_partitions_mapped();
-
-std::string get_system_root();
diff --git a/otautil/roots.cpp b/otautil/roots.cpp
index 815d644..a778e05 100644
--- a/otautil/roots.cpp
+++ b/otautil/roots.cpp
@@ -275,11 +275,3 @@
   }
   return 0;
 }
-
-bool logical_partitions_mapped() {
-  return android::fs_mgr::LogicalPartitionsMapped();
-}
-
-std::string get_system_root() {
-  return android::fs_mgr::GetSystemRoot();
-}
diff --git a/recovery.cpp b/recovery.cpp
index dbac3e0..20e5a1b 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -41,6 +41,7 @@
 #include <android-base/stringprintf.h>
 #include <android-base/strings.h>
 #include <cutils/properties.h> /* for property_list */
+#include <fs_mgr/roots.h>
 #include <healthhalutils/HealthHalUtils.h>
 #include <ziparchive/zip_archive.h>
 
@@ -437,8 +438,7 @@
         break;
       }
       case Device::MOUNT_SYSTEM:
-        // the system partition is mounted at /mnt/system
-        if (ensure_path_mounted_at(get_system_root(), "/mnt/system") != -1) {
+        if (ensure_path_mounted_at(android::fs_mgr::GetSystemRoot(), "/mnt/system") != -1) {
           ui->Print("Mounted /system.\n");
         }
         break;
diff --git a/recovery_main.cpp b/recovery_main.cpp
index b999505..aba9c5d 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -42,6 +42,7 @@
 #include <android-base/unique_fd.h>
 #include <bootloader_message/bootloader_message.h>
 #include <cutils/sockets.h>
+#include <fs_mgr/roots.h>
 #include <private/android_logger.h> /* private pmsg functions */
 #include <selinux/android.h>
 #include <selinux/label.h>
@@ -505,7 +506,7 @@
       }
 
       case Device::ENTER_FASTBOOT:
-        if (logical_partitions_mapped()) {
+        if (android::fs_mgr::LogicalPartitionsMapped()) {
           ui->Print("Partitions may be mounted - rebooting to enter fastboot.");
           Reboot("fastboot");
         } else {