summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2018-10-11 10:48:25 -0500
committerandroid-build-merger2018-10-11 10:48:25 -0500
commit5fc1a4066dbaddf84b48ee6e34bc81d8b6ba2ae2 (patch)
treeb3bbbe6bbd1f91378b1d87f0d6b262de0f926db4
parent4d8d9fd44f8371a9332de0ef79038898ff700e3a (diff)
parentb40e32c92c3d60f59385001a53e7a057fdef37da (diff)
downloadplatform-system-libvintf-5fc1a4066dbaddf84b48ee6e34bc81d8b6ba2ae2.tar.gz
platform-system-libvintf-5fc1a4066dbaddf84b48ee6e34bc81d8b6ba2ae2.tar.xz
platform-system-libvintf-5fc1a4066dbaddf84b48ee6e34bc81d8b6ba2ae2.zip
libvintf: deprecate ro.build.system_root_image
am: b40e32c92c Change-Id: I13f443343c822d6d0fbbf8c5f60ff28e799e9aad
-rw-r--r--VintfObjectRecovery.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/VintfObjectRecovery.cpp b/VintfObjectRecovery.cpp
index a7bc174..3303980 100644
--- a/VintfObjectRecovery.cpp
+++ b/VintfObjectRecovery.cpp
@@ -51,9 +51,10 @@ static FstabMgr defaultFstabMgr() {
51 51
52class RecoveryPartitionMounter : public PartitionMounter { 52class RecoveryPartitionMounter : public PartitionMounter {
53 public: 53 public:
54 RecoveryPartitionMounter(bool systemRootImage) : mSystemRootImage(systemRootImage) {} 54 RecoveryPartitionMounter() : fstab_(defaultFstabMgr()) {}
55 status_t mountSystem() const override { 55 status_t mountSystem() const override {
56 if (mSystemRootImage) { 56 if (!fstab_) return UNKNOWN_ERROR;
57 if (fs_mgr_get_entry_for_mount_point(fstab_.get(), "/system") == nullptr) {
57 return mount("/", kSystemImageRootDir); 58 return mount("/", kSystemImageRootDir);
58 } else { 59 } else {
59 return mount("/system", kSystemImageRootDir); 60 return mount("/system", kSystemImageRootDir);
@@ -67,14 +68,11 @@ class RecoveryPartitionMounter : public PartitionMounter {
67 status_t umountVendor() const override { return umount(kVendorImageRootDir); } 68 status_t umountVendor() const override { return umount(kVendorImageRootDir); }
68 69
69 private: 70 private:
70 const bool mSystemRootImage = false; 71 FstabMgr fstab_;
71 72
72 status_t mount(const char* path, const char* mountPoint) const { 73 status_t mount(const char* path, const char* mountPoint) const {
73 FstabMgr fstab = defaultFstabMgr(); 74 if (!fstab_) return UNKNOWN_ERROR;
74 if (fstab == NULL) { 75 return mountAt(fstab_, path, mountPoint);
75 return UNKNOWN_ERROR;
76 }
77 return mountAt(fstab, path, mountPoint);
78 } 76 }
79}; 77};
80 78
@@ -110,8 +108,7 @@ class RecoveryFileSystem : public FileSystem {
110int32_t VintfObjectRecovery::CheckCompatibility( 108int32_t VintfObjectRecovery::CheckCompatibility(
111 const std::vector<std::string> &xmls, std::string *error) { 109 const std::vector<std::string> &xmls, std::string *error) {
112 auto propertyFetcher = std::make_unique<details::PropertyFetcherImpl>(); 110 auto propertyFetcher = std::make_unique<details::PropertyFetcherImpl>();
113 bool systemRootImage = propertyFetcher->getBoolProperty("ro.build.system_root_image", false); 111 auto mounter = std::make_unique<details::RecoveryPartitionMounter>();
114 auto mounter = std::make_unique<details::RecoveryPartitionMounter>(systemRootImage);
115 auto fileSystem = std::make_unique<details::RecoveryFileSystem>(); 112 auto fileSystem = std::make_unique<details::RecoveryFileSystem>();
116 auto vintfObject = std::make_unique<VintfObject>(std::move(fileSystem), std::move(mounter), 113 auto vintfObject = std::make_unique<VintfObject>(std::move(fileSystem), std::move(mounter),
117 nullptr /* runtime info factory */, 114 nullptr /* runtime info factory */,