From 59d3062f51abf11d1a681511eb51da87bb2d71c9 Mon Sep 17 00:00:00 2001 From: dimitry Date: Wed, 18 Oct 2017 13:23:08 +0200 Subject: [PATCH] Use ro.debuggable property instead of checking build type Test: make Change-Id: I094663c20721f345cd6684e06fcef38f300790be --- tests/dl_test.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp index 2133a2c11..d56b017e5 100644 --- a/tests/dl_test.cpp +++ b/tests/dl_test.cpp @@ -181,12 +181,8 @@ static void create_ld_config_file(std::string& config_file) { #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 @@ static bool is_user_build() { // 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 @@ TEST(dl, exec_with_ld_config_file) { // 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 @@ TEST(dl, disable_ld_config_file) { // This test is only for CTS. return; } - if (!is_user_build()) { + if (is_debuggable_build()) { // Skip the test for non production devices return; }