From 68261eec2442f25a223faac2b3601a87021ea72a Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 28 Jul 2020 09:51:54 -0700 Subject: logd: remove users of __android_logger_property_get_bool() __android_logger_property_get_bool() has a clunky API and doesn't belong in liblog, since a vast majority of liblog users will never query this property. Specifically 1) Replace with GetBoolProperty() when completely equivalent. 2) Remove checking if property values are 'eng' or 'svelte', since there's no evidence that those values were ever used. 3) Remove checking 'persist.logd.statistics' and 'ro.logd.statistics', since there's no evidence that those values were ever used. 4) Set ro.logd.kernel explicitly, so other processes don't need to replicate the defaults that logd uses. Test: build Change-Id: I7c37af64ba7754e839185f46da66bf077f09d9c3 --- logd/LogAudit.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'logd/LogAudit.cpp') diff --git a/logd/LogAudit.cpp b/logd/LogAudit.cpp index 0ce9796b0..0e17476ea 100644 --- a/logd/LogAudit.cpp +++ b/logd/LogAudit.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include @@ -40,6 +40,8 @@ #include "LogUtils.h" #include "libaudit.h" +using android::base::GetBoolProperty; + #define KMSG_PRIORITY(PRI) \ '<', '0' + LOG_MAKEPRI(LOG_AUTH, LOG_PRI(PRI)) / 10, \ '0' + LOG_MAKEPRI(LOG_AUTH, LOG_PRI(PRI)) % 10, '>' @@ -48,8 +50,8 @@ LogAudit::LogAudit(LogBuffer* buf, int fdDmesg, LogStatistics* stats) : SocketListener(getLogSocket(), false), logbuf(buf), fdDmesg(fdDmesg), - main(__android_logger_property_get_bool("ro.logd.auditd.main", BOOL_DEFAULT_TRUE)), - events(__android_logger_property_get_bool("ro.logd.auditd.events", BOOL_DEFAULT_TRUE)), + main(GetBoolProperty("ro.logd.auditd.main", true)), + events(GetBoolProperty("ro.logd.auditd.events", true)), initialized(false), stats_(stats) { static const char auditd_message[] = { KMSG_PRIORITY(LOG_INFO), -- cgit v1.2.3