aboutsummaryrefslogtreecommitdiff
path: root/test/android_test_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/android_test_utils.cc')
-rw-r--r--test/android_test_utils.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/android_test_utils.cc b/test/android_test_utils.cc
index 8c6081ae2..bfb1e1c33 100644
--- a/test/android_test_utils.cc
+++ b/test/android_test_utils.cc
@@ -17,9 +17,9 @@
#include "test/android_test_utils.h"
#include <stdlib.h>
-#include <sys/system_properties.h>
#include "perfetto/base/logging.h"
+#include "perfetto/ext/base/android_utils.h"
#include "perfetto/ext/base/file_utils.h"
namespace perfetto {
@@ -45,17 +45,13 @@ void PollRunState(bool desired_run_state,
} // namespace
bool IsDebuggableBuild() {
- char buf[PROP_VALUE_MAX + 1] = {};
- int ret = __system_property_get("ro.debuggable", buf);
- PERFETTO_CHECK(ret >= 0);
- return std::string(buf) == "1";
+ std::string debuggable = base::GetAndroidProp("ro.debuggable");
+ return debuggable == "1";
}
bool IsUserBuild() {
- char buf[PROP_VALUE_MAX + 1] = {};
- int ret = __system_property_get("ro.build.type", buf);
- PERFETTO_CHECK(ret >= 0);
- return std::string(buf) == "user";
+ std::string build_type = base::GetAndroidProp("ro.build.type");
+ return build_type == "user";
}
// note: cannot use gtest macros due to return type