diff options
author | Yo Chiang <yochiang@google.com> | 2020-10-13 12:12:30 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-10-13 12:12:30 +0000 |
commit | 542566bb81a26d273e5658e30f2cc3730b73e013 (patch) | |
tree | 61f1575419d347206d53a296094b0271de048490 | |
parent | c1ee10fb27c1a1e2652635f7f42313755622db79 (diff) | |
parent | cb2cd4194205fed0312dca02c7404ebf62b97ba9 (diff) | |
download | gsid-542566bb81a26d273e5658e30f2cc3730b73e013.tar.gz |
Merge "Make GetActiveDsu() static inline" am: 53ad534d6f am: bb1950da87 am: cb2cd41942
Original change: https://android-review.googlesource.com/c/platform/system/gsid/+/1452415
Change-Id: Iae7dda1f312e87cc28e557ef97401cb1dbf7914b
-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); } |