authfs: Remove local binder support
Bug: 190851176
Test: atest AuthFsHostTest ComposHostTestCases
Change-Id: I975b53e82d83fcc03b80e26dca886f5f6b724078
diff --git a/authfs/src/file.rs b/authfs/src/file.rs
index 703eddb..947b59f 100644
--- a/authfs/src/file.rs
+++ b/authfs/src/file.rs
@@ -10,7 +10,7 @@
use crate::common::CHUNK_SIZE;
use authfs_aidl_interface::aidl::com::android::virt::fs::IVirtFdService::IVirtFdService;
-use authfs_aidl_interface::binder::{get_interface, Strong};
+use authfs_aidl_interface::binder::Strong;
pub type VirtFdService = Strong<dyn IVirtFdService>;
@@ -18,17 +18,7 @@
pub const RPC_SERVICE_PORT: u32 = 3264;
-fn get_local_binder() -> io::Result<VirtFdService> {
- let service_name = "authfs_fd_server";
- get_interface(service_name).map_err(|e| {
- io::Error::new(
- io::ErrorKind::AddrNotAvailable,
- format!("Cannot reach authfs_fd_server binder service: {}", e),
- )
- })
-}
-
-fn get_rpc_binder(cid: u32) -> io::Result<VirtFdService> {
+pub fn get_rpc_binder_service(cid: u32) -> io::Result<VirtFdService> {
// SAFETY: AIBinder returned by RpcClient has correct reference count, and the ownership can be
// safely taken by new_spibinder.
let ibinder = unsafe {
@@ -46,14 +36,6 @@
}
}
-pub fn get_binder_service(cid: Option<u32>) -> io::Result<VirtFdService> {
- if let Some(cid) = cid {
- get_rpc_binder(cid)
- } else {
- get_local_binder()
- }
-}
-
/// A trait for reading data by chunks. Chunks can be read by specifying the chunk index. Only the
/// last chunk may have incomplete chunk size.
pub trait ReadByChunk {
diff --git a/authfs/src/main.rs b/authfs/src/main.rs
index e004b81..c85d801 100644
--- a/authfs/src/main.rs
+++ b/authfs/src/main.rs
@@ -55,7 +55,7 @@
/// CID of the VM where the service runs.
#[structopt(long)]
- cid: Option<u32>,
+ cid: u32,
/// Extra options to FUSE
#[structopt(short = "o")]
@@ -275,7 +275,7 @@
let mut file_pool = BTreeMap::new();
if args.has_remote_files() {
- let service = file::get_binder_service(args.cid)?;
+ let service = file::get_rpc_binder_service(args.cid)?;
for config in &args.remote_ro_file {
file_pool.insert(