aboutsummaryrefslogtreecommitdiff
path: root/tests/aidl_test_client_ndk_nested.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/aidl_test_client_ndk_nested.cpp')
-rw-r--r--tests/aidl_test_client_ndk_nested.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/aidl_test_client_ndk_nested.cpp b/tests/aidl_test_client_ndk_nested.cpp
index 632e5be7..686219c6 100644
--- a/tests/aidl_test_client_ndk_nested.cpp
+++ b/tests/aidl_test_client_ndk_nested.cpp
@@ -17,6 +17,7 @@
#include <android/binder_auto_utils.h>
#include <android/binder_manager.h>
#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <utils/String16.h>
@@ -39,7 +40,9 @@ using testing::Optional;
struct AidlTest : testing::Test {
template <typename T>
std::shared_ptr<T> getService() {
- ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_getService(T::descriptor));
+ android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+ android::ProcessState::self()->startThreadPool();
+ ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
return T::fromBinder(binder);
}
};