diff options
author | 2023-10-11 20:41:51 +0000 | |
---|---|---|
committer | 2023-10-27 10:56:24 -0700 | |
commit | d6c8a4c0cef26d387c3cb072dbb8abdd922c7e74 (patch) | |
tree | dfa3c7c729f4156c1fc95f900fde3d2600ca6a89 /libs/binder/RpcSession.cpp | |
parent | 49753ae00a00641382c426e9b8fa775f1a364e7e (diff) |
Use std::unique_ptr instead of ScopeGuard
Bug: 302723053
Test: mma
Change-Id: I27226885b8b5e771d675ba2d83d0a2e14551d13e
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index fa8f2b51ac..524b54c31c 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,6 +52,7 @@ 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)) { @@ -497,7 +498,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 = base::ScopeGuard([&] { + auto cleanup = make_scope_guard([&] { // if any threads are started, shut them down (void)shutdownAndWait(true); @@ -577,7 +578,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.Disable(); + cleanup.release(); return OK; } |