From 9611c18aa286a55de54f46e54e1296f98e0d9194 Mon Sep 17 00:00:00 2001 From: "T.J. Mercier" Date: Fri, 25 Oct 2024 17:11:02 +0000 Subject: [PATCH] Don't use android::base::StartsWith / EndsWith These libbase functions now directly pass through to the standard library. [1] Use the standard library directly, and eliminate this dependency on libbase. [1] https://r.android.com/c/platform/system/libbase/+/3315082 Change-Id: I83d79ffa2658f30ae09a7f27cedf14e62b5df41d --- libprocessgroup/processgroup.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp index d3719eea3..95221594b 100644 --- a/libprocessgroup/processgroup.cpp +++ b/libprocessgroup/processgroup.cpp @@ -37,19 +37,18 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include using android::base::GetBoolProperty; -using android::base::StartsWith; using android::base::StringPrintf; using android::base::WriteStringToFile; @@ -255,7 +254,7 @@ static bool RemoveEmptyUidCgroups(const std::string& uid_path) { continue; } - if (!StartsWith(dir->d_name, "pid_")) { + if (!std::string_view(dir->d_name).starts_with("pid_")) { continue; } @@ -296,7 +295,7 @@ void removeAllEmptyProcessGroups() { continue; } - if (!StartsWith(dir->d_name, "uid_")) { + if (!std::string_view(dir->d_name).starts_with("uid_")) { continue; }