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