summaryrefslogtreecommitdiff
path: root/cmds/dumpstate/DumpstateUtil.cpp
diff options
context:
space:
mode:
author Kevin Jeon <kevinjeon@google.com> 2023-08-02 22:17:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-08-02 22:17:26 +0000
commitea60247fd4eef3cfa321195db0bd3d7278edb26b (patch)
treec9cd27a61c61777c110d72f7a4ced15a4c18ef2b /cmds/dumpstate/DumpstateUtil.cpp
parent6f1dcd5a35ca21c65de973a827fef08cb6cdee6a (diff)
parent7e2d1beb3cfa1b85f3e7ef7bedc5afa29ca83ee7 (diff)
Merge changes from topics "cherrypicker-L54100000962329329:N46400001393040350", "cherrypicker-L59600000962264727:N16700001392121090" into udc-d1-dev
* changes: Update IsStrictRun to be framework-only Add sysprop for identifying strict-run bugreports
Diffstat (limited to 'cmds/dumpstate/DumpstateUtil.cpp')
-rw-r--r--cmds/dumpstate/DumpstateUtil.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmds/dumpstate/DumpstateUtil.cpp b/cmds/dumpstate/DumpstateUtil.cpp
index aa42541a66..484231225d 100644
--- a/cmds/dumpstate/DumpstateUtil.cpp
+++ b/cmds/dumpstate/DumpstateUtil.cpp
@@ -207,6 +207,9 @@ std::string PropertiesHelper::build_type_ = "";
int PropertiesHelper::dry_run_ = -1;
int PropertiesHelper::unroot_ = -1;
int PropertiesHelper::parallel_run_ = -1;
+#if !defined(__ANDROID_VNDK__)
+int PropertiesHelper::strict_run_ = -1;
+#endif
bool PropertiesHelper::IsUserBuild() {
if (build_type_.empty()) {
@@ -237,6 +240,16 @@ bool PropertiesHelper::IsParallelRun() {
return parallel_run_ == 1;
}
+#if !defined(__ANDROID_VNDK__)
+bool PropertiesHelper::IsStrictRun() {
+ if (strict_run_ == -1) {
+ // Defaults to using stricter timeouts.
+ strict_run_ = android::base::GetBoolProperty("dumpstate.strict_run", true) ? 1 : 0;
+ }
+ return strict_run_ == 1;
+}
+#endif
+
int DumpFileToFd(int out_fd, const std::string& title, const std::string& path) {
android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC)));
if (fd.get() < 0) {