diff options
-rw-r--r-- | libs/binder/Android.bp | 103 | ||||
-rw-r--r-- | libs/binder/OS.cpp | 5 | ||||
-rw-r--r-- | libs/binder/OS.h | 3 | ||||
-rw-r--r-- | libs/binder/RpcServer.cpp | 2 | ||||
-rw-r--r-- | libs/binder/RpcSession.cpp | 2 | ||||
-rw-r--r-- | libs/binder/binder_module.h | 19 | ||||
-rw-r--r-- | libs/binder/rust/rpcbinder/Android.bp | 9 | ||||
-rw-r--r-- | libs/binder/tests/Android.bp | 5 | ||||
-rw-r--r-- | libs/binder/trusty/OS.cpp | 10 | ||||
-rw-r--r-- | libs/binder/trusty/RpcServerTrusty.cpp | 5 | ||||
-rw-r--r-- | libs/binder/trusty/RpcTransportTipcTrusty.cpp | 13 | ||||
-rw-r--r-- | libs/binder/trusty/include_mock/lib/tipc/tipc_srv.h | 51 | ||||
-rw-r--r-- | libs/binder/trusty/include_mock/openssl/rand.h | 20 | ||||
-rw-r--r-- | libs/binder/trusty/include_mock/trusty_ipc.h | 85 | ||||
-rw-r--r-- | libs/binder/trusty/include_mock/trusty_log.h | 26 | ||||
-rw-r--r-- | libs/binder/trusty/include_mock/uapi/err.h | 40 | ||||
-rw-r--r-- | libs/binder/trusty/include_mock/uapi/trusty_uuid.h | 20 | ||||
-rw-r--r-- | libs/binder/trusty/logging.cpp | 4 | ||||
-rw-r--r-- | libs/binder/trusty/rules.mk | 1 |
19 files changed, 369 insertions, 54 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp index 2cb6821ae7..5dca468f35 100644 --- a/libs/binder/Android.bp +++ b/libs/binder/Android.bp @@ -71,15 +71,9 @@ filegroup { } cc_defaults { - name: "libbinder_defaults", + name: "libbinder_common_defaults", host_supported: true, - // TODO(b/31559095): get headers from bionic on host - include_dirs: [ - "bionic/libc/kernel/android/uapi/", - "bionic/libc/kernel/uapi/", - ], - srcs: [ "Binder.cpp", "BpBinder.cpp", @@ -87,19 +81,45 @@ cc_defaults { "FdTrigger.cpp", "IInterface.cpp", "IResultReceiver.cpp", - "OS.cpp", "Parcel.cpp", "ParcelFileDescriptor.cpp", "RpcSession.cpp", "RpcServer.cpp", "RpcState.cpp", - "RpcTransportRaw.cpp", "Stability.cpp", "Status.cpp", "TextOutput.cpp", "Utils.cpp", ], + shared_libs: [ + "libcutils", + "libutils", + ], + + static_libs: [ + "libbase", + ], + + header_libs: [ + "libbinder_headers", + ], +} + +cc_defaults { + name: "libbinder_android_defaults", + + // TODO(b/31559095): get headers from bionic on host + include_dirs: [ + "bionic/libc/kernel/android/uapi/", + "bionic/libc/kernel/uapi/", + ], + + srcs: [ + "OS.cpp", + "RpcTransportRaw.cpp", + ], + target: { host: { srcs: [ @@ -133,16 +153,9 @@ cc_defaults { shared_libs: [ "liblog", - "libcutils", - "libutils", - ], - - static_libs: [ - "libbase", ], header_libs: [ - "libbinder_headers", "libandroid_runtime_vm_headers", ], @@ -177,6 +190,48 @@ cc_defaults { ], } +cc_library_shared { + name: "libbinder_on_trusty_mock", + defaults: ["libbinder_common_defaults"], + + srcs: [ + // Trusty-specific files + "trusty/logging.cpp", + "trusty/OS.cpp", + "trusty/RpcServerTrusty.cpp", + "trusty/RpcTransportTipcTrusty.cpp", + "trusty/TrustyStatus.cpp", + "trusty/socket.cpp", + ], + + cflags: [ + "-DBINDER_RPC_SINGLE_THREADED", + // Trusty libbinder uses vendor stability for its binders + "-D__ANDROID_VNDK__", + "-U__ANDROID__", + "-D__TRUSTY__", + "-DTRUSTY_USERSPACE", + // Flags from the Trusty build system + "-Werror", + "-Wsign-compare", + "-Wno-unused-function", + "-Wno-unused-label", + "-fno-common", + "-fno-omit-frame-pointer", + "-fno-threadsafe-statics", + ], + rtti: false, + + local_include_dirs: [ + "trusty/include", + "trusty/include_mock", + ], + + visibility: [ + ":__subpackages__", + ], +} + cc_defaults { name: "libbinder_kernel_defaults", srcs: [ @@ -208,7 +263,8 @@ cc_defaults { cc_library { name: "libbinder", defaults: [ - "libbinder_defaults", + "libbinder_common_defaults", + "libbinder_android_defaults", "libbinder_kernel_defaults", ], @@ -268,7 +324,10 @@ cc_library { cc_library_static { name: "libbinder_rpc_no_kernel", - defaults: ["libbinder_defaults"], + defaults: [ + "libbinder_common_defaults", + "libbinder_android_defaults", + ], visibility: [ ":__subpackages__", ], @@ -277,7 +336,8 @@ cc_library_static { cc_library_static { name: "libbinder_rpc_single_threaded", defaults: [ - "libbinder_defaults", + "libbinder_common_defaults", + "libbinder_android_defaults", "libbinder_kernel_defaults", ], cflags: [ @@ -290,7 +350,10 @@ cc_library_static { cc_library_static { name: "libbinder_rpc_single_threaded_no_kernel", - defaults: ["libbinder_defaults"], + defaults: [ + "libbinder_common_defaults", + "libbinder_android_defaults", + ], cflags: [ "-DBINDER_RPC_SINGLE_THREADED", ], diff --git a/libs/binder/OS.cpp b/libs/binder/OS.cpp index cc4a03ba67..24ce2bb465 100644 --- a/libs/binder/OS.cpp +++ b/libs/binder/OS.cpp @@ -17,6 +17,7 @@ #include "OS.h" #include <android-base/file.h> +#include <binder/RpcTransportRaw.h> #include <string.h> using android::base::ErrnoError; @@ -58,4 +59,8 @@ status_t dupFileDescriptor(int oldFd, int* newFd) { return OK; } +std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory() { + return RpcTransportCtxFactoryRaw::make(); +} + } // namespace android diff --git a/libs/binder/OS.h b/libs/binder/OS.h index d6e1c78ae9..5ab8bab0e7 100644 --- a/libs/binder/OS.h +++ b/libs/binder/OS.h @@ -20,6 +20,7 @@ #include <android-base/result.h> #include <android-base/unique_fd.h> +#include <binder/RpcTransport.h> #include <utils/Errors.h> namespace android { @@ -30,4 +31,6 @@ status_t getRandomBytes(uint8_t* data, size_t size); status_t dupFileDescriptor(int oldFd, int* newFd); +std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory(); + } // namespace android diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index 3fc6612f9f..f3becbd3f1 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -55,7 +55,7 @@ RpcServer::~RpcServer() { sp<RpcServer> RpcServer::make(std::unique_ptr<RpcTransportCtxFactory> rpcTransportCtxFactory) { // Default is without TLS. if (rpcTransportCtxFactory == nullptr) - rpcTransportCtxFactory = RpcTransportCtxFactoryRaw::make(); + rpcTransportCtxFactory = makeDefaultRpcTransportCtxFactory(); auto ctx = rpcTransportCtxFactory->newServerCtx(); if (ctx == nullptr) return nullptr; return sp<RpcServer>::make(std::move(ctx)); diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index c05a177be4..f109bc6538 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -68,7 +68,7 @@ RpcSession::~RpcSession() { sp<RpcSession> RpcSession::make() { // Default is without TLS. - return make(RpcTransportCtxFactoryRaw::make()); + return make(makeDefaultRpcTransportCtxFactory()); } sp<RpcSession> RpcSession::make(std::unique_ptr<RpcTransportCtxFactory> rpcTransportCtxFactory) { diff --git a/libs/binder/binder_module.h b/libs/binder/binder_module.h index 7574c29e8b..793795e1d4 100644 --- a/libs/binder/binder_module.h +++ b/libs/binder/binder_module.h @@ -100,23 +100,4 @@ struct binder_frozen_status_info { #define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32) #endif // BINDER_ENABLE_ONEWAY_SPAM_DETECTION -#ifndef BINDER_GET_EXTENDED_ERROR -/* struct binder_extened_error - extended error information - * @id: identifier for the failed operation - * @command: command as defined by binder_driver_return_protocol - * @param: parameter holding a negative errno value - * - * Used with BINDER_GET_EXTENDED_ERROR. This extends the error information - * returned by the driver upon a failed operation. Userspace can pull this - * data to properly handle specific error scenarios. - */ -struct binder_extended_error { - __u32 id; - __u32 command; - __s32 param; -}; - -#define BINDER_GET_EXTENDED_ERROR _IOWR('b', 17, struct binder_extended_error) -#endif // BINDER_GET_EXTENDED_ERROR - #endif // _BINDER_MODULE_H_ diff --git a/libs/binder/rust/rpcbinder/Android.bp b/libs/binder/rust/rpcbinder/Android.bp index 067ca0dcdd..f16939036c 100644 --- a/libs/binder/rust/rpcbinder/Android.bp +++ b/libs/binder/rust/rpcbinder/Android.bp @@ -1,3 +1,12 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_native_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_native_license"], +} + rust_library { name: "librpcbinder_rs", crate_name: "rpcbinder", diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp index 1babfd5813..e460d2c965 100644 --- a/libs/binder/tests/Android.bp +++ b/libs/binder/tests/Android.bp @@ -341,6 +341,11 @@ cc_test { "binderRpcTest_shared_defaults", "libbinder_tls_shared_deps", ], + + // Add the Trusty mock library as a fake dependency so it gets built + required: [ + "libbinder_on_trusty_mock", + ], } cc_test { diff --git a/libs/binder/trusty/OS.cpp b/libs/binder/trusty/OS.cpp index b21fe6acf5..46346bb3e9 100644 --- a/libs/binder/trusty/OS.cpp +++ b/libs/binder/trusty/OS.cpp @@ -20,13 +20,15 @@ #include <lib/rand/rand.h> #endif +#include <binder/RpcTransportTipcTrusty.h> + #include "../OS.h" using android::base::Result; namespace android { -Result<void> setNonBlocking(android::base::borrowed_fd fd) { +Result<void> setNonBlocking(android::base::borrowed_fd /*fd*/) { // Trusty IPC syscalls are all non-blocking by default. return {}; } @@ -41,9 +43,13 @@ status_t getRandomBytes(uint8_t* data, size_t size) { #endif // TRUSTY_USERSPACE } -status_t dupFileDescriptor(int oldFd, int* newFd) { +status_t dupFileDescriptor(int /*oldFd*/, int* /*newFd*/) { // TODO: implement separately return INVALID_OPERATION; } +std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory() { + return RpcTransportCtxFactoryTipcTrusty::make(); +} + } // namespace android diff --git a/libs/binder/trusty/RpcServerTrusty.cpp b/libs/binder/trusty/RpcServerTrusty.cpp index 9e48f811a9..67d7331eee 100644 --- a/libs/binder/trusty/RpcServerTrusty.cpp +++ b/libs/binder/trusty/RpcServerTrusty.cpp @@ -129,7 +129,7 @@ int RpcServerTrusty::handleConnect(const tipc_port* port, handle_t chan, const u return rc; } -int RpcServerTrusty::handleMessage(const tipc_port* port, handle_t chan, void* ctx) { +int RpcServerTrusty::handleMessage(const tipc_port* /*port*/, handle_t /*chan*/, void* ctx) { auto* channelContext = reinterpret_cast<ChannelContext*>(ctx); LOG_ALWAYS_FATAL_IF(channelContext == nullptr, "bad state: message received on uninitialized channel"); @@ -146,7 +146,8 @@ int RpcServerTrusty::handleMessage(const tipc_port* port, handle_t chan, void* c return NO_ERROR; } -void RpcServerTrusty::handleDisconnect(const tipc_port* port, handle_t chan, void* ctx) {} +void RpcServerTrusty::handleDisconnect(const tipc_port* /*port*/, handle_t /*chan*/, + void* /*ctx*/) {} void RpcServerTrusty::handleChannelCleanup(void* ctx) { auto* channelContext = reinterpret_cast<ChannelContext*>(ctx); diff --git a/libs/binder/trusty/RpcTransportTipcTrusty.cpp b/libs/binder/trusty/RpcTransportTipcTrusty.cpp index 4777a5e0cc..ca7f7d3576 100644 --- a/libs/binder/trusty/RpcTransportTipcTrusty.cpp +++ b/libs/binder/trusty/RpcTransportTipcTrusty.cpp @@ -45,9 +45,9 @@ public: } status_t interruptableWriteFully( - FdTrigger* fdTrigger, iovec* iovs, int niovs, - const std::optional<android::base::function_ref<status_t()>>& altPoll, - const std::vector<std::variant<base::unique_fd, base::borrowed_fd>>* ancillaryFds) + FdTrigger* /*fdTrigger*/, iovec* iovs, int niovs, + const std::optional<android::base::function_ref<status_t()>>& /*altPoll*/, + const std::vector<std::variant<base::unique_fd, base::borrowed_fd>>* /*ancillaryFds*/) override { if (niovs < 0) { return BAD_VALUE; @@ -95,9 +95,10 @@ public: } status_t interruptableReadFully( - FdTrigger* fdTrigger, iovec* iovs, int niovs, - const std::optional<android::base::function_ref<status_t()>>& altPoll, - std::vector<std::variant<base::unique_fd, base::borrowed_fd>>* ancillaryFds) override { + FdTrigger* /*fdTrigger*/, iovec* iovs, int niovs, + const std::optional<android::base::function_ref<status_t()>>& /*altPoll*/, + std::vector<std::variant<base::unique_fd, base::borrowed_fd>>* /*ancillaryFds*/) + override { if (niovs < 0) { return BAD_VALUE; } diff --git a/libs/binder/trusty/include_mock/lib/tipc/tipc_srv.h b/libs/binder/trusty/include_mock/lib/tipc/tipc_srv.h new file mode 100644 index 0000000000..2747314508 --- /dev/null +++ b/libs/binder/trusty/include_mock/lib/tipc/tipc_srv.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include <stddef.h> +#include <trusty_ipc.h> +#include <uapi/trusty_uuid.h> + +struct tipc_port_acl { + uint32_t flags; + uint32_t uuid_num; + const struct uuid** uuids; + const void* extra_data; +}; + +struct tipc_port { + const char* name; + uint32_t msg_max_size; + uint32_t msg_queue_len; + const struct tipc_port_acl* acl; + const void* priv; +}; + +struct tipc_srv_ops { + int (*on_connect)(const struct tipc_port* port, handle_t chan, const struct uuid* peer, + void** ctx_p); + + int (*on_message)(const struct tipc_port* port, handle_t chan, void* ctx); + + void (*on_disconnect)(const struct tipc_port* port, handle_t chan, void* ctx); + + void (*on_channel_cleanup)(void* ctx); +}; + +static inline int tipc_add_service(struct tipc_hset*, const struct tipc_port*, uint32_t, uint32_t, + const struct tipc_srv_ops*) { + return 0; +} diff --git a/libs/binder/trusty/include_mock/openssl/rand.h b/libs/binder/trusty/include_mock/openssl/rand.h new file mode 100644 index 0000000000..07dcc1cb6d --- /dev/null +++ b/libs/binder/trusty/include_mock/openssl/rand.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +static inline int RAND_bytes(unsigned char*, int) { + return 0; +} diff --git a/libs/binder/trusty/include_mock/trusty_ipc.h b/libs/binder/trusty/include_mock/trusty_ipc.h new file mode 100644 index 0000000000..a2170cea64 --- /dev/null +++ b/libs/binder/trusty/include_mock/trusty_ipc.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include <stddef.h> +#include <stdint.h> +#include <sys/types.h> +#include <sys/uio.h> +#include <uapi/trusty_uuid.h> + +#define INFINITE_TIME 1 +#define IPC_MAX_MSG_HANDLES 8 + +#define IPC_HANDLE_POLL_HUP 0x1 +#define IPC_HANDLE_POLL_MSG 0x2 +#define IPC_HANDLE_POLL_SEND_UNBLOCKED 0x4 + +typedef int handle_t; + +typedef struct ipc_msg { + uint32_t num_iov; + iovec* iov; + uint32_t num_handles; + handle_t* handles; +} ipc_msg_t; + +typedef struct ipc_msg_info { + size_t len; + uint32_t id; + uint32_t num_handles; +} ipc_msg_info_t; + +typedef struct uevent { + uint32_t event; +} uevent_t; + +static inline handle_t port_create(const char*, uint32_t, uint32_t, uint32_t) { + return 0; +} +static inline handle_t connect(const char*, uint32_t) { + return 0; +} +static inline handle_t accept(handle_t, uuid_t*) { + return 0; +} +static inline int set_cookie(handle_t, void*) { + return 0; +} +static inline handle_t handle_set_create(void) { + return 0; +} +static inline int handle_set_ctrl(handle_t, uint32_t, struct uevent*) { + return 0; +} +static inline int wait(handle_t, uevent_t*, uint32_t) { + return 0; +} +static inline int wait_any(uevent_t*, uint32_t) { + return 0; +} +static inline int get_msg(handle_t, ipc_msg_info_t*) { + return 0; +} +static inline ssize_t read_msg(handle_t, uint32_t, uint32_t, ipc_msg_t*) { + return 0; +} +static inline int put_msg(handle_t, uint32_t) { + return 0; +} +static inline ssize_t send_msg(handle_t, ipc_msg_t*) { + return 0; +} diff --git a/libs/binder/trusty/include_mock/trusty_log.h b/libs/binder/trusty/include_mock/trusty_log.h new file mode 100644 index 0000000000..d51e75280c --- /dev/null +++ b/libs/binder/trusty/include_mock/trusty_log.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include <stdio.h> + +// Mock definitions for the Trusty logging macros. These are not +// meant to be run, just compiled successfully. +#define TLOGD(fmt, ...) printf(fmt, ##__VA_ARGS__) +#define TLOGI(fmt, ...) printf(fmt, ##__VA_ARGS__) +#define TLOGW(fmt, ...) printf(fmt, ##__VA_ARGS__) +#define TLOGE(fmt, ...) printf(fmt, ##__VA_ARGS__) +#define TLOGC(fmt, ...) printf(fmt, ##__VA_ARGS__) diff --git a/libs/binder/trusty/include_mock/uapi/err.h b/libs/binder/trusty/include_mock/uapi/err.h new file mode 100644 index 0000000000..c7e117e419 --- /dev/null +++ b/libs/binder/trusty/include_mock/uapi/err.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +enum { + NO_ERROR, + ERR_ACCESS_DENIED, + ERR_ALREADY_EXISTS, + ERR_BAD_HANDLE, + ERR_BAD_LEN, + ERR_BAD_STATE, + ERR_CHANNEL_CLOSED, + ERR_CMD_UNKNOWN, + ERR_GENERIC, + ERR_INVALID_ARGS, + ERR_NO_MEMORY, + ERR_NO_MSG, + ERR_NOT_ALLOWED, + ERR_NOT_CONFIGURED, + ERR_NOT_ENOUGH_BUFFER, + ERR_NOT_FOUND, + ERR_NOT_READY, + ERR_NOT_SUPPORTED, + ERR_NOT_VALID, + ERR_TIMED_OUT, + ERR_TOO_BIG, +}; diff --git a/libs/binder/trusty/include_mock/uapi/trusty_uuid.h b/libs/binder/trusty/include_mock/uapi/trusty_uuid.h new file mode 100644 index 0000000000..f636826bec --- /dev/null +++ b/libs/binder/trusty/include_mock/uapi/trusty_uuid.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +typedef struct uuid { + int placeholder; +} uuid_t; diff --git a/libs/binder/trusty/logging.cpp b/libs/binder/trusty/logging.cpp index fd54744fdf..b4243af891 100644 --- a/libs/binder/trusty/logging.cpp +++ b/libs/binder/trusty/logging.cpp @@ -54,7 +54,7 @@ void DefaultAborter(const char* abort_message) { abort(); } -static void TrustyLogLine(const char* msg, int length, android::base::LogSeverity severity, +static void TrustyLogLine(const char* msg, int /*length*/, android::base::LogSeverity severity, const char* tag) { switch (severity) { case VERBOSE: @@ -157,7 +157,7 @@ void LogMessage::LogLine(const char* file, unsigned int line, LogSeverity severi TrustyLogger(DEFAULT, severity, tag ?: "<unknown>", file, line, message); } -bool ShouldLog(LogSeverity severity, const char* tag) { +bool ShouldLog(LogSeverity /*severity*/, const char* /*tag*/) { // This is controlled by Trusty's log level. return true; } diff --git a/libs/binder/trusty/rules.mk b/libs/binder/trusty/rules.mk index d0d0861416..4e5cd18726 100644 --- a/libs/binder/trusty/rules.mk +++ b/libs/binder/trusty/rules.mk @@ -76,7 +76,6 @@ MODULE_EXPORT_INCLUDES += \ $(LIBBINDER_DIR)/ndk/include_cpp \ MODULE_EXPORT_COMPILEFLAGS += \ - -DBINDER_NO_KERNEL_IPC \ -DBINDER_RPC_SINGLE_THREADED \ -D__ANDROID_VNDK__ \ |