system/core
Révision | a34d119057f1d62e6a6158fd682bcd4732b05cf6 (tree) |
---|---|
l'heure | 2019-03-28 19:36:04 |
Auteur | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
fs_mgr: check ro.* property first
fs_mgr reads default fstab via ro.hardware property before Android 8.0.
However, Android 8.0 changed it to use ro.boot.hardware. The incompatible
change is bad.
Android-x86 doesn't set ro.boot.hardware anymore. Let's check ro.*
properties as before.
@@ -51,7 +51,13 @@ bool fs_mgr_get_boot_config_from_kernel_cmdline(const std::string& key, std::str | ||
51 | 51 | bool fs_mgr_get_boot_config(const std::string& key, std::string* out_val) { |
52 | 52 | FS_MGR_CHECK(out_val != nullptr); |
53 | 53 | |
54 | - // first check if we have "ro.boot" property already | |
54 | + // first check if we have "ro.*" property already | |
55 | + *out_val = android::base::GetProperty("ro." + key, ""); | |
56 | + if (!out_val->empty()) { | |
57 | + return true; | |
58 | + } | |
59 | + | |
60 | + // second check if we have "ro.boot.*" property | |
55 | 61 | *out_val = android::base::GetProperty("ro.boot." + key, ""); |
56 | 62 | if (!out_val->empty()) { |
57 | 63 | return true; |