Use ro.debuggable property instead of checking build type
Test: make
Change-Id: I094663c20721f345cd6684e06fcef38f300790be
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index 2133a2c..d56b017 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -181,12 +181,8 @@
#endif
#if defined(__BIONIC__)
-static bool is_user_build() {
- std::string build_type = android::base::GetProperty("ro.build.type", "user");
- if (build_type == "userdebug" || build_type == "eng") {
- return false;
- }
- return true;
+static bool is_debuggable_build() {
+ return android::base::GetBoolProperty("ro.debuggable", false);
}
#endif
@@ -194,7 +190,7 @@
// whose search paths include the 'ns2/' subdir.
TEST(dl, exec_with_ld_config_file) {
#if defined(__BIONIC__)
- if (is_user_build()) {
+ if (!is_debuggable_build()) {
// LD_CONFIG_FILE is not supported on user build
return;
}
@@ -216,7 +212,7 @@
// additional namespaces other than the default namespace.
TEST(dl, exec_with_ld_config_file_with_ld_preload) {
#if defined(__BIONIC__)
- if (is_user_build()) {
+ if (!is_debuggable_build()) {
// LD_CONFIG_FILE is not supported on user build
return;
}
@@ -244,7 +240,7 @@
// This test is only for CTS.
return;
}
- if (!is_user_build()) {
+ if (is_debuggable_build()) {
// Skip the test for non production devices
return;
}