summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/binder/Android.bp9
-rw-r--r--libs/binder/tests/Android.bp2
-rw-r--r--libs/binder/tests/binderRpcTest.cpp7
3 files changed, 16 insertions, 2 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index 7422d09fc5..f53a2567c6 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -271,6 +271,15 @@ cc_library_shared {
defaults: ["libbinder_tls_defaults"],
}
+// For testing
+cc_library_static {
+ name: "libbinder_tls_static",
+ defaults: ["libbinder_tls_defaults"],
+ visibility: [
+ ":__subpackages__",
+ ],
+}
+
// AIDL interface between libbinder and framework.jar
filegroup {
name: "libbinder_aidl",
diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp
index b7ad199b75..2546edba1d 100644
--- a/libs/binder/tests/Android.bp
+++ b/libs/binder/tests/Android.bp
@@ -145,6 +145,7 @@ cc_test {
defaults: [
"binder_test_defaults",
"libbinder_ndk_host_user",
+ "libbinder_tls_shared_deps",
],
srcs: [
@@ -159,6 +160,7 @@ cc_test {
"liblog",
],
static_libs: [
+ "libbinder_tls_static",
"binderRpcTestIface-cpp",
"binderRpcTestIface-ndk",
],
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 15ccae9399..35db4444d5 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -31,6 +31,7 @@
#include <binder/RpcSession.h>
#include <binder/RpcTransport.h>
#include <binder/RpcTransportRaw.h>
+#include <binder/RpcTransportTls.h>
#include <gtest/gtest.h>
#include <chrono>
@@ -54,16 +55,18 @@ static_assert(RPC_WIRE_PROTOCOL_VERSION + 1 == RPC_WIRE_PROTOCOL_VERSION_NEXT ||
RPC_WIRE_PROTOCOL_VERSION == RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL);
const char* kLocalInetAddress = "127.0.0.1";
-enum class RpcSecurity { RAW };
+enum class RpcSecurity { RAW, TLS };
static inline std::vector<RpcSecurity> RpcSecurityValues() {
- return {RpcSecurity::RAW};
+ return {RpcSecurity::RAW, RpcSecurity::TLS};
}
static inline std::unique_ptr<RpcTransportCtxFactory> newFactory(RpcSecurity rpcSecurity) {
switch (rpcSecurity) {
case RpcSecurity::RAW:
return RpcTransportCtxFactoryRaw::make();
+ case RpcSecurity::TLS:
+ return RpcTransportCtxFactoryTls::make();
default:
LOG_ALWAYS_FATAL("Unknown RpcSecurity %d", rpcSecurity);
}