]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/platform-system-libvintf.git/commitdiff
libvintf: deprecate ro.build.system_root_image android-o-mr1-iot-release-smart-display-r3
authorMark Salyzyn <salyzyn@google.com>
Wed, 10 Oct 2018 21:15:38 +0000 (14:15 -0700)
committerMark Salyzyn <salyzyn@google.com>
Wed, 10 Oct 2018 22:40:08 +0000 (15:40 -0700)
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

VintfObjectRecovery.cpp

index a7bc17494dda1a44dcd122943bce269b77a0001a..33039800a2351218d97ea3001655b4baca304b78 100644 (file)
@@ -51,9 +51,10 @@ static FstabMgr defaultFstabMgr() {
 
 class RecoveryPartitionMounter : public PartitionMounter {
    public:
-    RecoveryPartitionMounter(bool systemRootImage) : mSystemRootImage(systemRootImage) {}
+    RecoveryPartitionMounter() : fstab_(defaultFstabMgr()) {}
     status_t mountSystem() const override {
-        if (mSystemRootImage) {
+        if (!fstab_) return UNKNOWN_ERROR;
+        if (fs_mgr_get_entry_for_mount_point(fstab_.get(), "/system") == nullptr) {
             return mount("/", kSystemImageRootDir);
         } else {
             return mount("/system", kSystemImageRootDir);
@@ -67,14 +68,11 @@ class RecoveryPartitionMounter : public PartitionMounter {
     status_t umountVendor() const override { return umount(kVendorImageRootDir); }
 
    private:
-    const bool mSystemRootImage = false;
+    FstabMgr fstab_;
 
     status_t mount(const char* path, const char* mountPoint) const {
-        FstabMgr fstab = defaultFstabMgr();
-        if (fstab == NULL) {
-            return UNKNOWN_ERROR;
-        }
-        return mountAt(fstab, path, mountPoint);
+        if (!fstab_) return UNKNOWN_ERROR;
+        return mountAt(fstab_, path, mountPoint);
     }
 };
 
@@ -110,8 +108,7 @@ class RecoveryFileSystem : public FileSystem {
 int32_t VintfObjectRecovery::CheckCompatibility(
         const std::vector<std::string> &xmls, std::string *error) {
     auto propertyFetcher = std::make_unique<details::PropertyFetcherImpl>();
-    bool systemRootImage = propertyFetcher->getBoolProperty("ro.build.system_root_image", false);
-    auto mounter = std::make_unique<details::RecoveryPartitionMounter>(systemRootImage);
+    auto mounter = std::make_unique<details::RecoveryPartitionMounter>();
     auto fileSystem = std::make_unique<details::RecoveryFileSystem>();
     auto vintfObject = std::make_unique<VintfObject>(std::move(fileSystem), std::move(mounter),
                                                      nullptr /* runtime info factory */,