diff options
author | Tomasz Wasilczyk <twasilczyk@google.com> | 2023-08-11 16:09:24 +0000 |
---|---|---|
committer | Tomasz Wasilczyk <twasilczyk@google.com> | 2023-08-11 16:09:24 +0000 |
commit | 719b61aaa4ae7509f5840eb1f973c80a148d59df (patch) | |
tree | 2561598753439df92456ba7d7234960ea5076597 | |
parent | 46c306a38f0803836f50d2d5e19ddbef8233cea6 (diff) | |
download | gsid-719b61aaa4ae7509f5840eb1f973c80a148d59df.tar.gz |
Use String8/16 c_str
Bug: 295394788
Test: make checkbuild
Change-Id: If90ffb78c2a988c992e2d2e9583ad11f70b3e294
-rw-r--r-- | gsi_service.cpp | 4 | ||||
-rw-r--r-- | gsi_tool.cpp | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/gsi_service.cpp b/gsi_service.cpp index 31b558c..a380f3d 100644 --- a/gsi_service.cpp +++ b/gsi_service.cpp @@ -346,7 +346,7 @@ binder::Status GsiService::removeGsiAsync(const sp<IGsiServiceCallback>& resultC bool result = false; auto status = removeGsi(&result); if (!status.isOk()) { - LOG(ERROR) << "Could not removeGsi: " << status.exceptionMessage().string(); + LOG(ERROR) << "Could not removeGsi: " << status.exceptionMessage().c_str(); result = IGsiService::INSTALL_ERROR_GENERIC; } resultCallback->onResult(result); @@ -610,7 +610,7 @@ binder::Status ImageService::createBackingImage(const std::string& name, int64_t auto status = on_progress->onProgress(static_cast<int64_t>(current), static_cast<int64_t>(total)); if (!status.isOk()) { - LOG(ERROR) << "progress callback returned: " << status.toString8().string(); + LOG(ERROR) << "progress callback returned: " << status.toString8().c_str(); return false; } return true; diff --git a/gsi_tool.cpp b/gsi_tool.cpp index aba9404..fb2d9e6 100644 --- a/gsi_tool.cpp +++ b/gsi_tool.cpp @@ -73,7 +73,7 @@ static const std::map<std::string, CommandCallback> kCommandMap = { static std::string ErrorMessage(const android::binder::Status& status, int error_code = IGsiService::INSTALL_ERROR_GENERIC) { if (!status.isOk()) { - return status.exceptionMessage().string(); + return status.exceptionMessage().c_str(); } return "error code " + std::to_string(error_code); } @@ -500,7 +500,7 @@ static int WipeData(sp<IGsiService> gsid, int argc, char** /* argv */) { bool running; auto status = gsid->isGsiRunning(&running); if (!status.isOk()) { - std::cerr << "error: " << status.exceptionMessage().string() << std::endl; + std::cerr << "error: " << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } if (running) { @@ -511,7 +511,7 @@ static int WipeData(sp<IGsiService> gsid, int argc, char** /* argv */) { bool installed; status = gsid->isGsiInstalled(&installed); if (!status.isOk()) { - std::cerr << "error: " << status.exceptionMessage().string() << std::endl; + std::cerr << "error: " << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } if (!installed) { @@ -536,7 +536,7 @@ static int Status(sp<IGsiService> gsid, int argc, char** /* argv */) { bool running; auto status = gsid->isGsiRunning(&running); if (!status.isOk()) { - std::cerr << "error: " << status.exceptionMessage().string() << std::endl; + std::cerr << "error: " << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } else if (running) { std::cout << "running" << std::endl; @@ -544,7 +544,7 @@ static int Status(sp<IGsiService> gsid, int argc, char** /* argv */) { bool installed; status = gsid->isGsiInstalled(&installed); if (!status.isOk()) { - std::cerr << "error: " << status.exceptionMessage().string() << std::endl; + std::cerr << "error: " << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } else if (installed) { std::cout << "installed" << std::endl; @@ -552,7 +552,7 @@ static int Status(sp<IGsiService> gsid, int argc, char** /* argv */) { bool enabled; status = gsid->isGsiEnabled(&enabled); if (!status.isOk()) { - std::cerr << status.exceptionMessage().string() << std::endl; + std::cerr << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } else if (running || installed) { std::cout << (enabled ? "enabled" : "disabled") << std::endl; @@ -566,7 +566,7 @@ static int Status(sp<IGsiService> gsid, int argc, char** /* argv */) { std::vector<std::string> dsu_slots; status = gsid->getInstalledDsuSlots(&dsu_slots); if (!status.isOk()) { - std::cerr << status.exceptionMessage().string() << std::endl; + std::cerr << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } int n = 0; @@ -580,13 +580,13 @@ static int Status(sp<IGsiService> gsid, int argc, char** /* argv */) { // because we can't stat the "outside" userdata. continue; } - std::cerr << "error: " << status.exceptionMessage().string() << std::endl; + std::cerr << "error: " << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } std::vector<std::string> images; status = image_service->getAllBackingImages(&images); if (!status.isOk()) { - std::cerr << "error: " << status.exceptionMessage().string() << std::endl; + std::cerr << "error: " << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } for (auto&& image : images) { @@ -612,7 +612,7 @@ static int Cancel(sp<IGsiService> gsid, int /* argc */, char** /* argv */) { bool cancelled = false; auto status = gsid->cancelGsiInstall(&cancelled); if (!status.isOk()) { - std::cerr << status.exceptionMessage().string() << std::endl; + std::cerr << status.exceptionMessage().c_str() << std::endl; return EX_SOFTWARE; } if (!cancelled) { |