Use libbase properties for a slight simplification. am: 3b0811b786
am: 0228644fa2
am: 4541c2eabf
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/2779648 Change-Id: I9e4e97cf015e1c7ee071155fc1b07e70cf45d544 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
a0e307cc4a
3 changed files with 2 additions and 10 deletions
|
@ -42,7 +42,6 @@ cc_binary {
|
|||
shared_libs: [
|
||||
"libbase",
|
||||
"libbpf_android",
|
||||
"libcutils",
|
||||
"liblog",
|
||||
],
|
||||
srcs: [
|
||||
|
|
|
@ -39,7 +39,6 @@ cc_library {
|
|||
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libcutils",
|
||||
"libutils",
|
||||
"liblog",
|
||||
],
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue