Loading include/ftl/non_null.h +9 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,15 @@ class NonNull final { constexpr NonNull(const NonNull&) = default; constexpr NonNull& operator=(const NonNull&) = default; template <typename U, typename = std::enable_if_t<std::is_convertible_v<U, Pointer>>> constexpr NonNull(const NonNull<U>& other) : pointer_(other.get()) {} template <typename U, typename = std::enable_if_t<std::is_convertible_v<U, Pointer>>> constexpr NonNull& operator=(const NonNull<U>& other) { pointer_ = other.get(); return *this; } [[nodiscard]] constexpr const Pointer& get() const { return pointer_; } [[nodiscard]] constexpr explicit operator const Pointer&() const { return get(); } Loading libs/binder/tests/binderCacheUnitTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ TEST_F(LibbinderCacheTest, RemoveFromCacheOnServerDeath) { EXPECT_EQ(OK, mServiceManager->addService(kCachedServiceName, binder2)); // Confirm that new service is returned instead of old. int retry_count = 5; int retry_count = 20; sp<IBinder> result2; do { std::this_thread::sleep_for(std::chrono::milliseconds(50)); Loading libs/binder/trusty/rust/binder_rpc_test/main.rs +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ use binder::{BinderFeatures, IBinder, Status, StatusCode, Strong}; use binder_rpc_test_aidl::aidl::IBinderRpcSession::{BnBinderRpcSession, IBinderRpcSession}; use binder_rpc_test_aidl::aidl::IBinderRpcTest::{BnBinderRpcTest, IBinderRpcTest}; use binder_rpc_test_session::MyBinderRpcSession; use libc::{clock_gettime, CLOCK_REALTIME}; use libc::{clock_gettime, CLOCK_BOOTTIME}; use rpcbinder::RpcSession; use trusty_std::ffi::{CString, FallibleCString}; Loading Loading @@ -56,7 +56,7 @@ fn get_time_ns() -> u64 { let mut ts = libc::timespec { tv_sec: 0, tv_nsec: 0 }; // Safety: Passing valid pointer to variable ts which lives past end of call assert_eq!(unsafe { clock_gettime(CLOCK_REALTIME, &mut ts) }, 0); assert_eq!(unsafe { clock_gettime(CLOCK_BOOTTIME, &mut ts) }, 0); ts.tv_sec as u64 * 1_000_000_000u64 + ts.tv_nsec as u64 } Loading libs/binder/trusty/rust/rpcbinder/rules.mk +2 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,8 @@ MODULE_LIBRARY_DEPS += \ $(LIBBINDER_DIR)/trusty/rust/binder_ndk_sys \ $(LIBBINDER_DIR)/trusty/rust/binder_rpc_unstable_bindgen \ $(LIBBINDER_DIR)/trusty/rust/binder_rpc_server_bindgen \ external/rust/crates/cfg-if \ external/rust/crates/foreign-types \ $(call FIND_CRATE,cfg-if) \ $(call FIND_CRATE,foreign-types) \ trusty/user/base/lib/tipc/rust \ trusty/user/base/lib/trusty-sys \ Loading libs/binder/trusty/rust/rules.mk +2 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,8 @@ MODULE_LIBRARY_DEPS += \ $(LIBBINDER_DIR)/trusty/ndk \ $(LIBBINDER_DIR)/trusty/rust/binder_ndk_sys \ $(LIBBINDER_DIR)/trusty/rust/binder_rpc_unstable_bindgen \ external/rust/crates/downcast-rs \ external/rust/crates/libc \ $(call FIND_CRATE,downcast-rs) \ $(call FIND_CRATE,libc) \ trusty/user/base/lib/trusty-sys \ MODULE_RUSTFLAGS += \ Loading Loading
include/ftl/non_null.h +9 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,15 @@ class NonNull final { constexpr NonNull(const NonNull&) = default; constexpr NonNull& operator=(const NonNull&) = default; template <typename U, typename = std::enable_if_t<std::is_convertible_v<U, Pointer>>> constexpr NonNull(const NonNull<U>& other) : pointer_(other.get()) {} template <typename U, typename = std::enable_if_t<std::is_convertible_v<U, Pointer>>> constexpr NonNull& operator=(const NonNull<U>& other) { pointer_ = other.get(); return *this; } [[nodiscard]] constexpr const Pointer& get() const { return pointer_; } [[nodiscard]] constexpr explicit operator const Pointer&() const { return get(); } Loading
libs/binder/tests/binderCacheUnitTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ TEST_F(LibbinderCacheTest, RemoveFromCacheOnServerDeath) { EXPECT_EQ(OK, mServiceManager->addService(kCachedServiceName, binder2)); // Confirm that new service is returned instead of old. int retry_count = 5; int retry_count = 20; sp<IBinder> result2; do { std::this_thread::sleep_for(std::chrono::milliseconds(50)); Loading
libs/binder/trusty/rust/binder_rpc_test/main.rs +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ use binder::{BinderFeatures, IBinder, Status, StatusCode, Strong}; use binder_rpc_test_aidl::aidl::IBinderRpcSession::{BnBinderRpcSession, IBinderRpcSession}; use binder_rpc_test_aidl::aidl::IBinderRpcTest::{BnBinderRpcTest, IBinderRpcTest}; use binder_rpc_test_session::MyBinderRpcSession; use libc::{clock_gettime, CLOCK_REALTIME}; use libc::{clock_gettime, CLOCK_BOOTTIME}; use rpcbinder::RpcSession; use trusty_std::ffi::{CString, FallibleCString}; Loading Loading @@ -56,7 +56,7 @@ fn get_time_ns() -> u64 { let mut ts = libc::timespec { tv_sec: 0, tv_nsec: 0 }; // Safety: Passing valid pointer to variable ts which lives past end of call assert_eq!(unsafe { clock_gettime(CLOCK_REALTIME, &mut ts) }, 0); assert_eq!(unsafe { clock_gettime(CLOCK_BOOTTIME, &mut ts) }, 0); ts.tv_sec as u64 * 1_000_000_000u64 + ts.tv_nsec as u64 } Loading
libs/binder/trusty/rust/rpcbinder/rules.mk +2 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,8 @@ MODULE_LIBRARY_DEPS += \ $(LIBBINDER_DIR)/trusty/rust/binder_ndk_sys \ $(LIBBINDER_DIR)/trusty/rust/binder_rpc_unstable_bindgen \ $(LIBBINDER_DIR)/trusty/rust/binder_rpc_server_bindgen \ external/rust/crates/cfg-if \ external/rust/crates/foreign-types \ $(call FIND_CRATE,cfg-if) \ $(call FIND_CRATE,foreign-types) \ trusty/user/base/lib/tipc/rust \ trusty/user/base/lib/trusty-sys \ Loading
libs/binder/trusty/rust/rules.mk +2 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,8 @@ MODULE_LIBRARY_DEPS += \ $(LIBBINDER_DIR)/trusty/ndk \ $(LIBBINDER_DIR)/trusty/rust/binder_ndk_sys \ $(LIBBINDER_DIR)/trusty/rust/binder_rpc_unstable_bindgen \ external/rust/crates/downcast-rs \ external/rust/crates/libc \ $(call FIND_CRATE,downcast-rs) \ $(call FIND_CRATE,libc) \ trusty/user/base/lib/trusty-sys \ MODULE_RUSTFLAGS += \ Loading