summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-10-12 16:53:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-10-12 16:53:41 +0000
commit4a5a337ef24dd61f69952b405a9b914bdf2ff7d4 (patch)
tree949d88f2ff48b46472ca188b1835150fec35c27f /debuggerd
parent96e8042e415cfcb35b6fcc9b2781bf089184410f (diff)
parent31121cafecefdd8153563632fc717a930598bd7c (diff)
downloadcore-4a5a337ef24dd61f69952b405a9b914bdf2ff7d4.tar.gz
core-4a5a337ef24dd61f69952b405a9b914bdf2ff7d4.tar.bz2
core-4a5a337ef24dd61f69952b405a9b914bdf2ff7d4.zip
Merge "Move some properties users to __system_property_read_callback()"
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/libdebuggerd/tombstone.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp
index d134cf22f..6fb29a938 100644
--- a/debuggerd/libdebuggerd/tombstone.cpp
+++ b/debuggerd/libdebuggerd/tombstone.cpp
@@ -35,12 +35,12 @@
#include <string>
#include <android-base/file.h>
+#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/unique_fd.h>
#include <android/log.h>
#include <backtrace/Backtrace.h>
#include <backtrace/BacktraceMap.h>
-#include <cutils/properties.h>
#include <log/log.h>
#include <log/logprint.h>
#include <private/android_filesystem_config.h>
@@ -53,6 +53,8 @@
#include "libdebuggerd/machine.h"
#include "libdebuggerd/open_files_list.h"
+using android::base::GetBoolProperty;
+using android::base::GetProperty;
using android::base::StringPrintf;
#define STACK_WORDS 16
@@ -206,14 +208,11 @@ static const char* get_sigcode(int signo, int code) {
}
static void dump_header_info(log_t* log) {
- char fingerprint[PROPERTY_VALUE_MAX];
- char revision[PROPERTY_VALUE_MAX];
+ auto fingerprint = GetProperty("ro.build.fingerprint", "unknown");
+ auto revision = GetProperty("ro.revision", "unknown");
- property_get("ro.build.fingerprint", fingerprint, "unknown");
- property_get("ro.revision", revision, "unknown");
-
- _LOG(log, logtype::HEADER, "Build fingerprint: '%s'\n", fingerprint);
- _LOG(log, logtype::HEADER, "Revision: '%s'\n", revision);
+ _LOG(log, logtype::HEADER, "Build fingerprint: '%s'\n", fingerprint.c_str());
+ _LOG(log, logtype::HEADER, "Revision: '%s'\n", revision.c_str());
_LOG(log, logtype::HEADER, "ABI: '%s'\n", ABI_STRING);
}
@@ -724,9 +723,7 @@ static void dump_crash(log_t* log, BacktraceMap* map, BacktraceMap* map_new,
const std::string& process_name, const std::map<pid_t, std::string>& threads,
uintptr_t abort_msg_address) {
// don't copy log messages to tombstone unless this is a dev device
- char value[PROPERTY_VALUE_MAX];
- property_get("ro.debuggable", value, "0");
- bool want_logs = (value[0] == '1');
+ bool want_logs = GetBoolProperty("ro.debuggable", false);
_LOG(log, logtype::HEADER,
"*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");