summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2018-10-10 16:15:38 -0500
committerMark Salyzyn2018-10-10 17:40:08 -0500
commitb40e32c92c3d60f59385001a53e7a057fdef37da (patch)
treeb3bbbe6bbd1f91378b1d87f0d6b262de0f926db4
parent34168f34e0263f76aa2e6bfde59c50bf3e9769f3 (diff)
downloadplatform-system-libvintf-b40e32c92c3d60f59385001a53e7a057fdef37da.tar.gz
platform-system-libvintf-b40e32c92c3d60f59385001a53e7a057fdef37da.tar.xz
platform-system-libvintf-b40e32c92c3d60f59385001a53e7a057fdef37da.zip
libvintf: deprecate ro.build.system_root_imageandroid-o-mr1-iot-release-smart-display-r3
If default_fstab does not have "/", then it should have "/system", there is no need to check the ro.build.system_root_image property. Test: compile Bug: 109821005 Change-Id: If6419b08f79b30800d13fbb9b320e48f435243f3
-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 */,