diff options
author | Tom Cherry <tomcherry@google.com> | 2017-10-12 16:53:41 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-12 16:53:41 +0000 |
commit | 4a5a337ef24dd61f69952b405a9b914bdf2ff7d4 (patch) | |
tree | 949d88f2ff48b46472ca188b1835150fec35c27f /fs_mgr | |
parent | 96e8042e415cfcb35b6fcc9b2781bf089184410f (diff) | |
parent | 31121cafecefdd8153563632fc717a930598bd7c (diff) | |
download | system_core-4a5a337ef24dd61f69952b405a9b914bdf2ff7d4.tar.gz system_core-4a5a337ef24dd61f69952b405a9b914bdf2ff7d4.tar.bz2 system_core-4a5a337ef24dd61f69952b405a9b914bdf2ff7d4.zip |
Merge "Move some properties users to __system_property_read_callback()"
Diffstat (limited to 'fs_mgr')
-rw-r--r-- | fs_mgr/Android.bp | 14 | ||||
-rw-r--r-- | fs_mgr/fs_mgr.cpp | 28 |
2 files changed, 16 insertions, 26 deletions
diff --git a/fs_mgr/Android.bp b/fs_mgr/Android.bp index 7fd67c293..2f530efb4 100644 --- a/fs_mgr/Android.bp +++ b/fs_mgr/Android.bp @@ -55,12 +55,22 @@ cc_library_static { "liblogwrap", "libfstab", ], + cppflags: [ + "-DALLOW_SKIP_SECURE_CHECK=0", + "-DALLOW_ADBD_DISABLE_VERITY=0", + ], product_variables: { debuggable: { - cppflags: ["-DALLOW_ADBD_DISABLE_VERITY=1"], + cppflags: [ + "-UALLOW_ADBD_DISABLE_VERITY", + "-DALLOW_ADBD_DISABLE_VERITY=1", + ], }, eng: { - cppflags: ["-DALLOW_SKIP_SECURE_CHECK=1"], + cppflags: [ + "-UALLOW_SKIP_SECURE_CHECK", + "-DALLOW_SKIP_SECURE_CHECK=1", + ], }, }, } diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 874189a80..47e3e1715 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -543,15 +543,6 @@ static int fs_match(const char *in1, const char *in2) return ret; } -static int device_is_force_encrypted() { - int ret = -1; - char value[PROP_VALUE_MAX]; - ret = __system_property_get("ro.vold.forceencryption", value); - if (ret < 0) - return 0; - return strcmp(value, "1") ? 0 : 1; -} - /* * Tries to mount any of the consecutive fstab entries that match * the mountpoint of the one given by fstab->recs[start_idx]. @@ -726,7 +717,9 @@ out: static bool needs_block_encryption(const struct fstab_rec* rec) { - if (device_is_force_encrypted() && fs_mgr_is_encryptable(rec)) return true; + if (android::base::GetBoolProperty("ro.vold.forceencryption", false) && + fs_mgr_is_encryptable(rec)) + return true; if (rec->fs_mgr_flags & MF_FORCECRYPT) return true; if (rec->fs_mgr_flags & MF_CRYPT) { /* Check for existence of convert_fde breadcrumb file */ @@ -769,20 +762,7 @@ static int handle_encryptable(const struct fstab_rec* rec) } bool is_device_secure() { - int ret = -1; - char value[PROP_VALUE_MAX]; - ret = __system_property_get("ro.secure", value); - if (ret == 0) { -#ifdef ALLOW_SKIP_SECURE_CHECK - // Allow eng builds to skip this check if the property - // is not readable (happens during early mount) - return false; -#else - // If error and not an 'eng' build, we want to fail secure. - return true; -#endif - } - return strcmp(value, "0") ? true : false; + return android::base::GetBoolProperty("ro.secure", ALLOW_SKIP_SECURE_CHECK ? false : true); } /* When multiple fstab records share the same mount_point, it will |