From e528be5e7d753551f080c5234416e36229426aa2 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 29 Mar 2016 14:25:11 -0700 Subject: [PATCH] fs_mgr: use __android_log_is_debuggable() Test: compile and boot smoke test Bug: 27566046 Bug: 31456426 Change-Id: Ibf4774f742e5a5b7db75d17642ff483a4a0fc0c5 --- fs_mgr/fs_mgr.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c index 2ed6b91d4..d57025571 100644 --- a/fs_mgr/fs_mgr.c +++ b/fs_mgr/fs_mgr.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "fs_mgr_priv.h" #include "fs_mgr_priv_verity.h" @@ -260,15 +261,6 @@ static int fs_match(char *in1, char *in2) return ret; } -static int device_is_debuggable() { - int ret = -1; - char value[PROP_VALUE_MAX]; - ret = __system_property_get("ro.debuggable", value); - if (ret < 0) - return ret; - return strcmp(value, "1") ? 0 : 1; -} - static int device_is_secure() { int ret = -1; char value[PROP_VALUE_MAX]; @@ -537,7 +529,7 @@ int fs_mgr_mount_all(struct fstab *fstab, int mount_mode) if ((fstab->recs[i].fs_mgr_flags & MF_VERIFY) && device_is_secure()) { int rc = fs_mgr_setup_verity(&fstab->recs[i]); - if (device_is_debuggable() && rc == FS_MGR_SETUP_VERITY_DISABLED) { + if (__android_log_is_debuggable() && rc == FS_MGR_SETUP_VERITY_DISABLED) { INFO("Verity disabled"); } else if (rc != FS_MGR_SETUP_VERITY_SUCCESS) { ERROR("Could not set up verified partition, skipping!\n"); @@ -699,7 +691,7 @@ int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device, if ((fstab->recs[i].fs_mgr_flags & MF_VERIFY) && device_is_secure()) { int rc = fs_mgr_setup_verity(&fstab->recs[i]); - if (device_is_debuggable() && rc == FS_MGR_SETUP_VERITY_DISABLED) { + if (__android_log_is_debuggable() && rc == FS_MGR_SETUP_VERITY_DISABLED) { INFO("Verity disabled"); } else if (rc != FS_MGR_SETUP_VERITY_SUCCESS) { ERROR("Could not set up verified partition, skipping!\n"); @@ -903,7 +895,7 @@ int fs_mgr_early_setup_verity(struct fstab_rec *fstab_rec) { if ((fstab_rec->fs_mgr_flags & MF_VERIFY) && device_is_secure()) { int rc = fs_mgr_setup_verity(fstab_rec); - if (device_is_debuggable() && rc == FS_MGR_SETUP_VERITY_DISABLED) { + if (__android_log_is_debuggable() && rc == FS_MGR_SETUP_VERITY_DISABLED) { INFO("Verity disabled"); return FS_MGR_EARLY_SETUP_VERITY_NO_VERITY; } else if (rc == FS_MGR_SETUP_VERITY_SUCCESS) {