diff options
author | Elliott Hughes <enh@google.com> | 2016-09-26 21:32:48 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-09-26 21:32:48 +0200 |
commit | cc02f9652f7994c835c7073d13b30f60ff1134af (patch) | |
tree | 034b34abded47d933f5e4f84b8f92936fb74bd47 /uncrypt/uncrypt.cpp | |
parent | Merge "Check corruption when reading uncrypt_status file" (diff) | |
parent | Switch to <android-base/properties.h>. (diff) | |
download | android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.tar android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.tar.gz android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.tar.bz2 android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.tar.lz android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.tar.xz android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.tar.zst android_bootable_recovery-cc02f9652f7994c835c7073d13b30f60ff1134af.zip |
Diffstat (limited to 'uncrypt/uncrypt.cpp')
-rw-r--r-- | uncrypt/uncrypt.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp index 96edfd781..dea8445ea 100644 --- a/uncrypt/uncrypt.cpp +++ b/uncrypt/uncrypt.cpp @@ -107,12 +107,12 @@ #include <android-base/file.h> #include <android-base/logging.h> +#include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <bootloader_message_writer.h> #include <cutils/android_reboot.h> -#include <cutils/properties.h> #include <cutils/sockets.h> #include <fs_mgr.h> @@ -163,13 +163,15 @@ static struct fstab* read_fstab() { fstab = NULL; // The fstab path is always "/fstab.${ro.hardware}". - char fstab_path[PATH_MAX+1] = "/fstab."; - if (!property_get("ro.hardware", fstab_path+strlen(fstab_path), "")) { + std::string ro_hardware = android::base::GetProperty("ro.hardware", ""); + if (ro_hardware.empty()) { LOG(ERROR) << "failed to get ro.hardware"; return NULL; } - fstab = fs_mgr_read_fstab(fstab_path); + std::string fstab_path = "/fstab." + ro_hardware; + + fstab = fs_mgr_read_fstab(fstab_path.c_str()); if (!fstab) { LOG(ERROR) << "failed to read " << fstab_path; return NULL; @@ -194,9 +196,7 @@ static const char* find_block_device(const char* path, bool* encryptable, bool* *encryptable = false; if (fs_mgr_is_encryptable(v) || fs_mgr_is_file_encrypted(v)) { *encryptable = true; - char buffer[PROPERTY_VALUE_MAX+1]; - if (property_get("ro.crypto.state", buffer, "") && - strcmp(buffer, "encrypted") == 0) { + if (android::base::GetProperty("ro.crypto.state", "") == "encrypted") { *encrypted = true; } } |