Properly detect system-as-root
ANDROID_ROOT environment variable is also used by other Android
components thus it should ALWAYS be /system in order not to break other
tools. On the other hand, AOSP does have a system property to indicate
system-as-root, just make use of it.
Change-Id: I7fc58a78db7abd05fac9000910169c370f5de62d
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 3c2b1c6..141576f 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -2840,10 +2840,9 @@
}
string TWPartitionManager::Get_Android_Root_Path() {
- std::string Android_Root = getenv("ANDROID_ROOT");
- if (Android_Root == "")
- Android_Root = "/system";
- return Android_Root;
+ if (property_get_bool("ro.build.system_root_image", false))
+ return "/system_root";
+ return "/system";
}
void TWPartitionManager::Remove_Uevent_Devices(const string& Mount_Point) {