diff options
author | 2023-10-30 08:02:24 +0000 | |
---|---|---|
committer | 2023-10-30 11:26:22 +0000 | |
commit | 25c1a3b8543dd1756308424dd65030f90bb7a99f (patch) | |
tree | 47483af2f39a1ff2d26442658ff43f0de44c70ac /libs/binder/RpcSession.cpp | |
parent | 84b7cff1a7082d32e9043014e57db7b4ed2aa7a0 (diff) |
Revert "Use std::unique_ptr instead of ScopeGuard"
Revert submission 2780893
Reason for revert: breaking boot tests
Bug: 308214260
Reverted changes: /q/submissionid:2780893
Change-Id: I7a4ee9a45583a8a1d4a33447de55c63e6ce9d42a
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index 524b54c31c..fa8f2b51ac 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -27,8 +27,8 @@ #include <string_view> #include <android-base/macros.h> +#include <android-base/scopeguard.h> #include <binder/BpBinder.h> -#include <binder/Functional.h> #include <binder/Parcel.h> #include <binder/RpcServer.h> #include <binder/RpcTransportRaw.h> @@ -52,7 +52,6 @@ extern "C" JavaVM* AndroidRuntimeGetJavaVM(); namespace android { -using namespace android::binder::impl; using base::unique_fd; RpcSession::RpcSession(std::unique_ptr<RpcTransportCtx> ctx) : mCtx(std::move(ctx)) { @@ -498,7 +497,7 @@ status_t RpcSession::setupClient(const std::function<status_t(const std::vector< if (auto status = initShutdownTrigger(); status != OK) return status; auto oldProtocolVersion = mProtocolVersion; - auto cleanup = make_scope_guard([&] { + auto cleanup = base::ScopeGuard([&] { // if any threads are started, shut them down (void)shutdownAndWait(true); @@ -578,7 +577,7 @@ status_t RpcSession::setupClient(const std::function<status_t(const std::vector< if (status_t status = connectAndInit(mId, true /*incoming*/); status != OK) return status; } - cleanup.release(); + cleanup.Disable(); return OK; } |