Loading libs/binder/Android.bp +9 −0 Original line number Original line Diff line number Diff line Loading @@ -271,6 +271,15 @@ cc_library_shared { defaults: ["libbinder_tls_defaults"], 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 // AIDL interface between libbinder and framework.jar filegroup { filegroup { name: "libbinder_aidl", name: "libbinder_aidl", Loading libs/binder/tests/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -145,6 +145,7 @@ cc_test { defaults: [ defaults: [ "binder_test_defaults", "binder_test_defaults", "libbinder_ndk_host_user", "libbinder_ndk_host_user", "libbinder_tls_shared_deps", ], ], srcs: [ srcs: [ Loading @@ -159,6 +160,7 @@ cc_test { "liblog", "liblog", ], ], static_libs: [ static_libs: [ "libbinder_tls_static", "binderRpcTestIface-cpp", "binderRpcTestIface-cpp", "binderRpcTestIface-ndk", "binderRpcTestIface-ndk", ], ], Loading libs/binder/tests/binderRpcTest.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <binder/RpcSession.h> #include <binder/RpcSession.h> #include <binder/RpcTransport.h> #include <binder/RpcTransport.h> #include <binder/RpcTransportRaw.h> #include <binder/RpcTransportRaw.h> #include <binder/RpcTransportTls.h> #include <gtest/gtest.h> #include <gtest/gtest.h> #include <chrono> #include <chrono> Loading @@ -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); RPC_WIRE_PROTOCOL_VERSION == RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL); const char* kLocalInetAddress = "127.0.0.1"; const char* kLocalInetAddress = "127.0.0.1"; enum class RpcSecurity { RAW }; enum class RpcSecurity { RAW, TLS }; static inline std::vector<RpcSecurity> RpcSecurityValues() { static inline std::vector<RpcSecurity> RpcSecurityValues() { return {RpcSecurity::RAW}; return {RpcSecurity::RAW, RpcSecurity::TLS}; } } static inline std::unique_ptr<RpcTransportCtxFactory> newFactory(RpcSecurity rpcSecurity) { static inline std::unique_ptr<RpcTransportCtxFactory> newFactory(RpcSecurity rpcSecurity) { switch (rpcSecurity) { switch (rpcSecurity) { case RpcSecurity::RAW: case RpcSecurity::RAW: return RpcTransportCtxFactoryRaw::make(); return RpcTransportCtxFactoryRaw::make(); case RpcSecurity::TLS: return RpcTransportCtxFactoryTls::make(); default: default: LOG_ALWAYS_FATAL("Unknown RpcSecurity %d", rpcSecurity); LOG_ALWAYS_FATAL("Unknown RpcSecurity %d", rpcSecurity); } } Loading Loading
libs/binder/Android.bp +9 −0 Original line number Original line Diff line number Diff line Loading @@ -271,6 +271,15 @@ cc_library_shared { defaults: ["libbinder_tls_defaults"], 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 // AIDL interface between libbinder and framework.jar filegroup { filegroup { name: "libbinder_aidl", name: "libbinder_aidl", Loading
libs/binder/tests/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -145,6 +145,7 @@ cc_test { defaults: [ defaults: [ "binder_test_defaults", "binder_test_defaults", "libbinder_ndk_host_user", "libbinder_ndk_host_user", "libbinder_tls_shared_deps", ], ], srcs: [ srcs: [ Loading @@ -159,6 +160,7 @@ cc_test { "liblog", "liblog", ], ], static_libs: [ static_libs: [ "libbinder_tls_static", "binderRpcTestIface-cpp", "binderRpcTestIface-cpp", "binderRpcTestIface-ndk", "binderRpcTestIface-ndk", ], ], Loading
libs/binder/tests/binderRpcTest.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <binder/RpcSession.h> #include <binder/RpcSession.h> #include <binder/RpcTransport.h> #include <binder/RpcTransport.h> #include <binder/RpcTransportRaw.h> #include <binder/RpcTransportRaw.h> #include <binder/RpcTransportTls.h> #include <gtest/gtest.h> #include <gtest/gtest.h> #include <chrono> #include <chrono> Loading @@ -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); RPC_WIRE_PROTOCOL_VERSION == RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL); const char* kLocalInetAddress = "127.0.0.1"; const char* kLocalInetAddress = "127.0.0.1"; enum class RpcSecurity { RAW }; enum class RpcSecurity { RAW, TLS }; static inline std::vector<RpcSecurity> RpcSecurityValues() { static inline std::vector<RpcSecurity> RpcSecurityValues() { return {RpcSecurity::RAW}; return {RpcSecurity::RAW, RpcSecurity::TLS}; } } static inline std::unique_ptr<RpcTransportCtxFactory> newFactory(RpcSecurity rpcSecurity) { static inline std::unique_ptr<RpcTransportCtxFactory> newFactory(RpcSecurity rpcSecurity) { switch (rpcSecurity) { switch (rpcSecurity) { case RpcSecurity::RAW: case RpcSecurity::RAW: return RpcTransportCtxFactoryRaw::make(); return RpcTransportCtxFactoryRaw::make(); case RpcSecurity::TLS: return RpcTransportCtxFactoryTls::make(); default: default: LOG_ALWAYS_FATAL("Unknown RpcSecurity %d", rpcSecurity); LOG_ALWAYS_FATAL("Unknown RpcSecurity %d", rpcSecurity); } } Loading