Skip to content

Commit 2717c00

Browse files
Orlando Arbildoandroid-build-merge-worker-robot
authored andcommitted
Merge "Build var to use vendor binder for trusty compile" into main am: 26bbdac
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3305566 Change-Id: I86fd0670cee30607c3e4cfaba2c9fb5f57655e3a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents 52507b4 + 26bbdac commit 2717c00

4 files changed

Lines changed: 27 additions & 6 deletions

File tree

libs/binder/rust/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mod proxy;
104104
mod service;
105105
#[cfg(not(any(trusty, android_ndk)))]
106106
mod state;
107-
#[cfg(not(any(android_vendor, android_ndk, android_vndk)))]
107+
#[cfg(not(any(android_vendor, android_ndk, android_vndk, trusty)))]
108108
mod system_only;
109109

110110
use binder_ndk_sys as sys;
@@ -125,7 +125,7 @@ pub use service::{
125125
pub use service::{get_interface, get_service};
126126
#[cfg(not(any(trusty, android_ndk)))]
127127
pub use state::{ProcessState, ThreadState};
128-
#[cfg(not(any(android_vendor, android_vndk, android_ndk)))]
128+
#[cfg(not(any(android_vendor, android_vndk, android_ndk, trusty)))]
129129
pub use system_only::{delegate_accessor, Accessor, AccessorProvider, ConnectionInfo};
130130

131131
/// Binder result containing a [`Status`] on error.

libs/binder/trusty/rules.mk

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,24 @@ MODULE_EXPORT_INCLUDES += \
6464
MODULE_EXPORT_INCLUDES += \
6565
$(LIBBINDER_DIR)/ndk/include_cpp \
6666

67+
ifeq (false,$(call TOBOOL,$(USE_SYSTEM_BINDER)))
68+
BINDER_EXTRA_COMPILE_FLAGS := \
69+
-D__ANDROID_VENDOR__ \
70+
-D__ANDROID_VNDK__ \
71+
72+
else
73+
BINDER_EXTRA_COMPILE_FLAGS := \
74+
-DANDROID_PLATFORM \
75+
76+
endif
77+
6778
MODULE_EXPORT_COMPILEFLAGS += \
6879
-DBINDER_RPC_SINGLE_THREADED \
6980
-DBINDER_ENABLE_LIBLOG_ASSERT \
7081
-DBINDER_DISABLE_NATIVE_HANDLE \
7182
-DBINDER_DISABLE_BLOB \
7283
-DBINDER_NO_LIBBASE \
73-
-D__ANDROID_VENDOR__ \
74-
-D__ANDROID_VNDK__ \
84+
$(BINDER_EXTRA_COMPILE_FLAGS)
7585

7686
# libbinder has some deprecated declarations that we want to produce warnings
7787
# not errors

libs/binder/trusty/rust/binder_ndk_sys/rules.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ MODULE_LIBRARY_DEPS += \
3030
trusty/user/base/lib/trusty-sys \
3131

3232
MODULE_RUSTFLAGS += \
33-
--cfg 'android_vendor' \
3433
--cfg 'trusty' \
3534

35+
ifeq (false,$(call TOBOOL,$(USE_SYSTEM_BINDER)))
36+
MODULE_RUSTFLAGS += \
37+
--cfg 'android_vendor' \
38+
39+
endif
40+
3641
MODULE_BINDGEN_SRC_HEADER := $(LIBBINDER_DIR)/rust/sys/BinderBindings.hpp
3742

3843
# Add the flags from the flag file

libs/binder/trusty/rust/rules.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ MODULE_LIBRARY_DEPS += \
3232
trusty/user/base/lib/trusty-sys \
3333

3434
MODULE_RUSTFLAGS += \
35-
--cfg 'android_vendor' \
3635
--cfg 'trusty' \
3736

37+
ifeq (false,$(call TOBOOL,$(USE_SYSTEM_BINDER)))
38+
MODULE_RUSTFLAGS += \
39+
--cfg 'android_vendor' \
40+
41+
endif
42+
43+
3844
# Trusty does not have `ProcessState`, so there are a few
3945
# doc links in `IBinder` that are still broken.
4046
MODULE_RUSTFLAGS += \

0 commit comments

Comments
 (0)