From 1de48a256fa9f754d3171e90345cb6d2db25baba Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 30 Oct 2023 14:19:19 +0000 Subject: Revert^2 "Use std::unique_ptr instead of ScopeGuard" 25c1a3b8543dd1756308424dd65030f90bb7a99f Test: m Bug: 302723053 Change-Id: Id9355c10d78d0c55afb49f512b78bb0923fbc4f7 --- libs/binder/RpcState.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs/binder/RpcState.cpp') diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp index 964a5c4ff9..c090a9c36f 100644 --- a/libs/binder/RpcState.cpp +++ b/libs/binder/RpcState.cpp @@ -18,8 +18,8 @@ #include "RpcState.h" -#include #include +#include #include #include @@ -38,6 +38,8 @@ namespace android { +using namespace android::binder::impl; + #if RPC_FLAKE_PRONE void rpcMaybeWaitToFlake() { [[clang::no_destroy]] static std::random_device r; @@ -808,11 +810,11 @@ status_t RpcState::processCommand( origGuard = kernelBinderState->pushGetCallingSpGuard(&spGuard); } - base::ScopeGuard guardUnguard = [&]() { + auto guardUnguard = make_scope_guard([&]() { if (kernelBinderState != nullptr) { kernelBinderState->restoreGetCallingSpGuard(origGuard); } - }; + }); #endif // BINDER_WITH_KERNEL_IPC switch (command.command) { -- cgit v1.2.3-59-g8ed1b