Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c2343a9 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11704135 from a89ee5d3 to 24Q3-release

Change-Id: I89f393ec284be715e7d04a6a1056af9c463395dc
parents d71681d6 a89ee5d3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ cc_defaults {
cc_library_headers {
    name: "trusty_mock_headers",
    host_supported: true,
    vendor_available: true,

    export_include_dirs: [
        "trusty/include",
@@ -243,12 +244,18 @@ cc_library_headers {
cc_defaults {
    name: "trusty_mock_defaults",
    host_supported: true,
    vendor_available: true,

    header_libs: [
        "libbinder_headers_base",
        "liblog_stub",
        "trusty_mock_headers",
    ],
    export_header_lib_headers: [
        "libbinder_headers_base",
        "liblog_stub",
        "trusty_mock_headers",
    ],

    shared_libs: [
        "libutils_binder_sdk",
+57 −0
Original line number Diff line number Diff line
@@ -34,6 +34,21 @@ rust_library {
    min_sdk_version: "Tiramisu",
}

rust_library {
    name: "libbinder_rs_on_trusty_mock",
    crate_name: "binder",
    srcs: ["src/lib.rs"],
    cfgs: [
        "trusty",
    ],
    rustlibs: [
        "libbinder_ndk_sys_on_trusty_mock",
        "libdowncast_rs",
        "liblibc",
    ],
    vendor: true,
}

rust_library {
    name: "libbinder_tokio_rs",
    crate_name: "binder_tokio",
@@ -89,6 +104,26 @@ rust_library {
    visibility: [":__subpackages__"],
}

rust_library {
    name: "libbinder_ndk_sys_on_trusty_mock",
    crate_name: "binder_ndk_sys",
    srcs: [
        "sys/lib.rs",
        ":libbinder_ndk_bindgen_on_trusty_mock",
    ],
    cfgs: [
        "trusty",
    ],
    shared_libs: [
        "libbinder_ndk_on_trusty_mock",
    ],
    vendor: true,
    // Lints are checked separately for libbinder_ndk_sys.
    // The Trusty mock copy pulls in extra headers that
    // don't pass the lints for the bindgen output.
    lints: "none",
}

rust_bindgen {
    name: "libbinder_ndk_bindgen",
    crate_name: "binder_ndk_bindgen",
@@ -125,6 +160,28 @@ rust_bindgen {
    min_sdk_version: "Tiramisu",
}

rust_bindgen {
    name: "libbinder_ndk_bindgen_on_trusty_mock",
    crate_name: "binder_ndk_bindgen",
    wrapper_src: "sys/BinderBindings.hpp",
    source_stem: "bindings",
    defaults: [
        "trusty_mock_defaults",
    ],

    bindgen_flag_files: [
        // Unfortunately the only way to specify the rust_non_exhaustive enum
        // style for a type is to make it the default
        // and then specify constified enums for the enums we don't want
        // rustified
        "libbinder_ndk_bindgen_flags.txt",
    ],
    shared_libs: [
        "libbinder_ndk_on_trusty_mock",
        "libc++",
    ],
}

rust_test {
    name: "libbinder_rs-internal_test",
    crate_name: "binder",
+4 −4
Original line number Diff line number Diff line
@@ -100,9 +100,9 @@ mod error;
mod native;
mod parcel;
mod proxy;
#[cfg(not(target_os = "trusty"))]
#[cfg(not(trusty))]
mod service;
#[cfg(not(target_os = "trusty"))]
#[cfg(not(trusty))]
mod state;

use binder_ndk_sys as sys;
@@ -112,13 +112,13 @@ pub use binder::{BinderFeatures, FromIBinder, IBinder, Interface, Strong, Weak};
pub use error::{ExceptionCode, IntoBinderResult, Status, StatusCode};
pub use parcel::{ParcelFileDescriptor, Parcelable, ParcelableHolder};
pub use proxy::{DeathRecipient, SpIBinder, WpIBinder};
#[cfg(not(target_os = "trusty"))]
#[cfg(not(trusty))]
pub use service::{
    add_service, force_lazy_services_persist, get_declared_instances, get_interface, get_service,
    is_declared, is_handling_transaction, register_lazy_service, wait_for_interface,
    wait_for_service, LazyServiceGuard,
};
#[cfg(not(target_os = "trusty"))]
#[cfg(not(trusty))]
pub use state::{ProcessState, ThreadState};

/// Binder result containing a [`Status`] on error.
+2 −2
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> {
    /// contains a `T` pointer in its user data. fd should be a non-owned file
    /// descriptor, and args must be an array of null-terminated string
    /// pointers with length num_args.
    #[cfg(not(target_os = "trusty"))]
    #[cfg(not(trusty))]
    unsafe extern "C" fn on_dump(
        binder: *mut sys::AIBinder,
        fd: i32,
@@ -374,7 +374,7 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> {
    }

    /// Called to handle the `dump` transaction.
    #[cfg(target_os = "trusty")]
    #[cfg(trusty)]
    unsafe extern "C" fn on_dump(
        _binder: *mut sys::AIBinder,
        _fd: i32,
+3 −1
Original line number Diff line number Diff line
@@ -25,7 +25,9 @@ mod bindings {
}

// Trusty puts the full path to the auto-generated file in BINDGEN_INC_FILE
// and builds it with warnings-as-errors, so we need to use #[allow(bad_style)]
// and builds it with warnings-as-errors, so we need to use #[allow(bad_style)].
// We need to use cfg(target_os) instead of cfg(trusty) here because of
// the difference between the two build systems, which we cannot mock.
#[cfg(target_os = "trusty")]
#[allow(bad_style)]
mod bindings {
Loading