Platform BpfLoader: remove IGNORE_ON_{USER,USERDEBUG,ENG} support
Unlike in mainline, this isn't actually particularly useful for
platform, as you can simply not include such programs
via Android.bp/mk stanzas at build time.
Even in mainline we've had only one user (and we've graduated
that use as well...)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com
Change-Id: I66a83e79a866c306de4c409e8b5822eac99454ec
diff --git a/libbpf_android/Loader.cpp b/libbpf_android/Loader.cpp
index 43635a3..7c2cf0b 100644
--- a/libbpf_android/Loader.cpp
+++ b/libbpf_android/Loader.cpp
@@ -69,11 +69,6 @@
namespace android {
namespace bpf {
-const std::string& getBuildType() {
- static std::string t = android::base::GetProperty("ro.build.type", "unknown");
- return t;
-}
-
static unsigned int page_size = static_cast<unsigned int>(getpagesize());
constexpr const char* lookupSelinuxContext(const domain d, const char* const unspecified = "") {
@@ -661,14 +656,6 @@
continue;
}
- if ((md[i].ignore_on_eng && isEng()) || (md[i].ignore_on_user && isUser()) ||
- (md[i].ignore_on_userdebug && isUserdebug())) {
- ALOGI("skipping map %s which is ignored on %s builds", mapNames[i].c_str(),
- getBuildType().c_str());
- mapFds.push_back(unique_fd());
- continue;
- }
-
if ((isArm() && isKernel32Bit() && md[i].ignore_on_arm32) ||
(isArm() && isKernel64Bit() && md[i].ignore_on_aarch64) ||
(isX86() && isKernel32Bit() && md[i].ignore_on_x86_32) ||
@@ -922,14 +909,6 @@
// Note: make sure to only check for unrecognized *after* verifying bpfloader
// version limits include this bpfloader's version.
- if ((cs[i].prog_def->ignore_on_eng && isEng()) ||
- (cs[i].prog_def->ignore_on_user && isUser()) ||
- (cs[i].prog_def->ignore_on_userdebug && isUserdebug())) {
- ALOGD("cs[%d].name:%s is ignored on %s builds", i, name.c_str(),
- getBuildType().c_str());
- continue;
- }
-
if ((isArm() && isKernel32Bit() && cs[i].prog_def->ignore_on_arm32) ||
(isArm() && isKernel64Bit() && cs[i].prog_def->ignore_on_aarch64) ||
(isX86() && isKernel32Bit() && cs[i].prog_def->ignore_on_x86_32) ||
diff --git a/libbpf_android/include/libbpf_android.h b/libbpf_android/include/libbpf_android.h
index 46c7970..172a2db 100644
--- a/libbpf_android/include/libbpf_android.h
+++ b/libbpf_android/include/libbpf_android.h
@@ -83,19 +83,5 @@
// Exposed for testing
unsigned int readSectionUint(const char* name, std::ifstream& elfFile, unsigned int defVal);
-// Returns the build type string (from ro.build.type).
-const std::string& getBuildType();
-
-// The following functions classify the 3 Android build types.
-inline bool isEng() {
- return getBuildType() == "eng";
-}
-inline bool isUser() {
- return getBuildType() == "user";
-}
-inline bool isUserdebug() {
- return getBuildType() == "userdebug";
-}
-
} // namespace bpf
} // namespace android