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
diff --git a/libs/binder/tests/binderLibTest.cpp b/libs/binder/tests/binderLibTest.cpp
index eaf426d..341e9ce 100644
--- a/libs/binder/tests/binderLibTest.cpp
+++ b/libs/binder/tests/binderLibTest.cpp
@@ -30,11 +30,11 @@
#include <android-base/properties.h>
#include <android-base/result-gmock.h>
#include <android-base/result.h>
+#include <android-base/scopeguard.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#include <binder/Binder.h>
#include <binder/BpBinder.h>
-#include <binder/Functional.h>
#include <binder/IBinder.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
@@ -52,7 +52,6 @@
#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
using namespace android;
-using namespace android::binder::impl;
using namespace std::string_literals;
using namespace std::chrono_literals;
using android::base::testing::HasValue;
@@ -1326,7 +1325,7 @@
ASSERT_EQ(0, ret);
// Restore the original file limits when the test finishes
- auto guardUnguard = make_scope_guard([&]() { setrlimit(RLIMIT_NOFILE, &origNofile); });
+ base::ScopeGuard guardUnguard([&]() { setrlimit(RLIMIT_NOFILE, &origNofile); });
rlimit testNofile = {1024, 1024};
ret = setrlimit(RLIMIT_NOFILE, &testNofile);