diff options
author | Yo Chiang <yochiang@google.com> | 2020-10-13 12:25:02 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-10-13 12:25:02 +0000 |
commit | 754d2753950d533c9f41295855d92a320947d090 (patch) | |
tree | 61f1575419d347206d53a296094b0271de048490 | |
parent | 3a15ce65acf3bf81f32c55aaea0294897512d2a7 (diff) | |
parent | 542566bb81a26d273e5658e30f2cc3730b73e013 (diff) | |
download | gsid-754d2753950d533c9f41295855d92a320947d090.tar.gz |
Merge "Make GetActiveDsu() static inline" am: 53ad534d6f am: bb1950da87 am: cb2cd41942 am: 542566bb81
Original change: https://android-review.googlesource.com/c/platform/system/gsid/+/1452415
Change-Id: Ie1357cec82974414708ff9982ece4b12924ad928
-rw-r--r-- | include/libgsi/libgsi.h | 6 | ||||
-rw-r--r-- | libgsi.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/libgsi/libgsi.h b/include/libgsi/libgsi.h index fbe2f17..ed47767 100644 --- a/include/libgsi/libgsi.h +++ b/include/libgsi/libgsi.h @@ -18,6 +18,8 @@ #include <string> +#include <android-base/file.h> + namespace android { namespace gsi { @@ -55,7 +57,9 @@ static constexpr int kMaxBootAttempts = 1; // Get the currently active dsu slot // Return true on success -bool GetActiveDsu(std::string* active_dsu); +static inline bool GetActiveDsu(std::string* active_dsu) { + return android::base::ReadFileToString(kDsuActiveFile, active_dsu); +} // Returns true if the currently running system image is a live GSI. bool IsGsiRunning(); @@ -37,10 +37,6 @@ using android::base::ReadFileToString; using android::base::Split; using android::base::unique_fd; -bool GetActiveDsu(std::string* active_dsu) { - return android::base::ReadFileToString(kDsuActiveFile, active_dsu); -} - bool IsGsiRunning() { return !access(kGsiBootedIndicatorFile, F_OK); } |