From 44fd9bcfd709432f19fb13c7200973c2d3374ab3 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 19 Jan 2022 17:49:46 +0000 Subject: [PATCH] Revert^2 "[binder_common] Update binder import path" Import from the binder crate root instead of binder::public_api for compatibility with the new crate structure. Relanding change: Ia37ec9d1ec9afea8ff61fecb06d13bfb8a4f65cf Test: m Bug: 196056781 Change-Id: I35e1d9268929f35d3ce494c2833f39f708170b96 --- binder_common/lazy_service.rs | 2 +- binder_common/lib.rs | 2 +- binder_common/rpc_client.rs | 4 ++-- binder_common/rpc_server.rs | 2 +- compos/common/binder.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/binder_common/lazy_service.rs b/binder_common/lazy_service.rs index a2b85dbf..9d605b6a 100644 --- a/binder_common/lazy_service.rs +++ b/binder_common/lazy_service.rs @@ -17,7 +17,7 @@ //! Rust API for lazy (aka dynamic) AIDL services. //! See https://source.android.com/devices/architecture/aidl/dynamic-aidl. -use binder::public_api::force_lazy_services_persist; +use binder::force_lazy_services_persist; use lazy_static::lazy_static; use std::sync::Mutex; diff --git a/binder_common/lib.rs b/binder_common/lib.rs index fa91f5a2..fd81da5e 100644 --- a/binder_common/lib.rs +++ b/binder_common/lib.rs @@ -20,7 +20,7 @@ pub mod lazy_service; pub mod rpc_client; pub mod rpc_server; -use binder::public_api::{ExceptionCode, Status}; +use binder::{ExceptionCode, Status}; use std::ffi::CString; /// Constructs a new Binder error `Status` with the given `ExceptionCode` and message. diff --git a/binder_common/rpc_client.rs b/binder_common/rpc_client.rs index 262a689b..1aabe841 100644 --- a/binder_common/rpc_client.rs +++ b/binder_common/rpc_client.rs @@ -16,14 +16,14 @@ //! Helpers for implementing an RPC Binder client. -use binder::public_api::{StatusCode, Strong}; use binder::unstable_api::{new_spibinder, AIBinder}; +use binder::{StatusCode, Strong}; /// Connects to a binder RPC server. pub fn connect_rpc_binder( cid: u32, port: u32, -) -> binder::Result> { +) -> Result, StatusCode> { // SAFETY: AIBinder returned by RpcClient has correct reference count, and the ownership can be // safely taken by new_spibinder. let ibinder = unsafe { diff --git a/binder_common/rpc_server.rs b/binder_common/rpc_server.rs index 36075cf7..5c9d2a0b 100644 --- a/binder_common/rpc_server.rs +++ b/binder_common/rpc_server.rs @@ -16,8 +16,8 @@ //! Helpers for implementing an RPC Binder server. -use binder::public_api::SpIBinder; use binder::unstable_api::AsNative; +use binder::SpIBinder; use std::os::raw; /// Run a binder RPC server, serving the supplied binder service implementation on the given vsock diff --git a/compos/common/binder.rs b/compos/common/binder.rs index 6bd3957a..ae857e06 100644 --- a/compos/common/binder.rs +++ b/compos/common/binder.rs @@ -17,7 +17,7 @@ //! Helper for converting Error types to what Binder expects use anyhow::Result; -use binder::public_api::{ExceptionCode, Result as BinderResult}; +use binder::{ExceptionCode, Result as BinderResult}; use binder_common::new_binder_exception; use log::warn; use std::fmt::Debug;