From 49fce9571af37815cd75db905643b26f2a26ac66 Mon Sep 17 00:00:00 2001 From: Rick Yiu Date: Thu, 8 Apr 2021 22:10:06 +0800 Subject: [PATCH] libprocessgroup: Change LogFailures to string To match the definition of proto file. Bug: 184715843 Test: function works Change-Id: I1ef4b3509069d8c83e8afd192c72edf62c772c26 --- libprocessgroup/task_profiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp index f13a6815c..db00a4981 100644 --- a/libprocessgroup/task_profiles.cpp +++ b/libprocessgroup/task_profiles.cpp @@ -518,10 +518,10 @@ bool TaskProfiles::Load(const CgroupMap& cg_map, const std::string& file_name) { std::string attr_filepath = params_val["FilePath"].asString(); std::string attr_value = params_val["Value"].asString(); if (!attr_filepath.empty() && !attr_value.empty()) { - const Json::Value& logfailures = params_val["LogFailures"]; - bool attr_logfailures = logfailures.isNull() || logfailures.asBool(); + std::string attr_logfailures = params_val["LogFailures"].asString(); + bool logfailures = attr_logfailures.empty() || attr_logfailures == "true"; profile->Add(std::make_unique(attr_filepath, attr_value, - attr_logfailures)); + logfailures)); } else if (attr_filepath.empty()) { LOG(WARNING) << "WriteFile: invalid parameter: " << "empty filepath";