From 15800946e09f7272fe487cbebb4c9e009cb59811 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 20 Feb 2019 12:51:33 -0800 Subject: [PATCH] __android_log_is_debuggable() shouldn't be an apex symbol Remove a superfluous check in fs_mgr, since those return values are already impossible for a non-debuggable build. Replace a one time call to __android_log_is_debuggable(), since there's no reason to cache the value or use this symbol. Test: build Change-Id: Icd4bef7b616c49d304303747388d7e3018c6fcfc --- fs_mgr/fs_mgr.cpp | 8 ++------ libcutils/trace-dev.inc | 2 +- liblog/liblog.map.txt | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index b69e773e4..0c904c46e 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -1098,9 +1098,7 @@ int fs_mgr_mount_all(Fstab* fstab, int mount_mode) { } } else if ((current_entry.fs_mgr_flags.verify)) { int rc = fs_mgr_setup_verity(¤t_entry, true); - if (__android_log_is_debuggable() && - (rc == FS_MGR_SETUP_VERITY_DISABLED || - rc == FS_MGR_SETUP_VERITY_SKIPPED)) { + if (rc == FS_MGR_SETUP_VERITY_DISABLED || rc == FS_MGR_SETUP_VERITY_SKIPPED) { LINFO << "Verity disabled"; } else if (rc != FS_MGR_SETUP_VERITY_SUCCESS) { LERROR << "Could not set up verified partition, skipping!"; @@ -1331,9 +1329,7 @@ static int fs_mgr_do_mount_helper(Fstab* fstab, const std::string& n_name, } } else if (fstab_entry.fs_mgr_flags.verify) { int rc = fs_mgr_setup_verity(&fstab_entry, true); - if (__android_log_is_debuggable() && - (rc == FS_MGR_SETUP_VERITY_DISABLED || - rc == FS_MGR_SETUP_VERITY_SKIPPED)) { + if (rc == FS_MGR_SETUP_VERITY_DISABLED || rc == FS_MGR_SETUP_VERITY_SKIPPED) { LINFO << "Verity disabled"; } else if (rc != FS_MGR_SETUP_VERITY_SUCCESS) { LERROR << "Could not set up verified partition, skipping!"; diff --git a/libcutils/trace-dev.inc b/libcutils/trace-dev.inc index c9580af04..e3da77bec 100644 --- a/libcutils/trace-dev.inc +++ b/libcutils/trace-dev.inc @@ -80,7 +80,7 @@ static bool atrace_is_cmdline_match(const char* cmdline) // Determine whether application-level tracing is enabled for this process. static bool atrace_is_app_tracing_enabled() { - bool sys_debuggable = __android_log_is_debuggable(); + bool sys_debuggable = property_get_bool("ro.debuggable", 0); bool result = false; if (sys_debuggable || atrace_is_debuggable) { diff --git a/liblog/liblog.map.txt b/liblog/liblog.map.txt index 69a807ba6..ce4c53c82 100644 --- a/liblog/liblog.map.txt +++ b/liblog/liblog.map.txt @@ -51,7 +51,7 @@ LIBLOG_M { LIBLOG_O { global: __android_log_is_loggable_len; - __android_log_is_debuggable; # apex vndk + __android_log_is_debuggable; # vndk }; LIBLOG_Q {