Skip to content
Snippets Groups Projects
Commit af11354b authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by Gerrit Code Review
Browse files

Merge "Use libbase properties for a slight simplification." into main

parents 4dec273a 497e3e05
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,6 @@ cc_binary {
header_libs: ["bpf_headers"],
shared_libs: [
"libbase",
"libcutils",
"liblog",
],
srcs: [
......
......@@ -59,9 +59,9 @@
#include <android-base/cmsg.h>
#include <android-base/file.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#include <cutils/properties.h>
#define BPF_FS_PATH "/sys/fs/bpf/"
......@@ -79,17 +79,11 @@ using std::optional;
using std::string;
using std::vector;
static std::string getBuildTypeInternal() {
char value[PROPERTY_VALUE_MAX] = {};
(void)property_get("ro.build.type", value, "unknown"); // ignore length
return value;
}
namespace android {
namespace bpf {
const std::string& getBuildType() {
static std::string t = getBuildTypeInternal();
static std::string t = android::base::GetProperty("ro.build.type", "unknown");
return t;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment