Use new binder exception constructors moved from binder_common.
Bug: 234019127
Test: atest compos_key_tests MicrodroidHostTestCases MicrodroidTestApp
Change-Id: I938c9d0ebae90c933c9a7ee8c27e9ecb0cc3e5fa
diff --git a/authfs/service/src/authfs.rs b/authfs/service/src/authfs.rs
index c941360..547d15d 100644
--- a/authfs/service/src/authfs.rs
+++ b/authfs/service/src/authfs.rs
@@ -32,9 +32,8 @@
};
use authfs_aidl_interface::aidl::com::android::virt::fs::IAuthFs::{BnAuthFs, IAuthFs};
use authfs_aidl_interface::binder::{
- self, BinderFeatures, ExceptionCode, Interface, ParcelFileDescriptor, Strong,
+ self, BinderFeatures, Interface, ParcelFileDescriptor, Status, Strong,
};
-use binder_common::new_binder_exception;
const AUTHFS_BIN: &str = "/system/bin/authfs";
const AUTHFS_SETUP_POLL_INTERVAL_MS: Duration = Duration::from_millis(50);
@@ -60,9 +59,9 @@
let mut path = PathBuf::from(&self.mountpoint);
path.push(remote_fd_name.to_string());
let file = OpenOptions::new().read(true).write(writable).open(&path).map_err(|e| {
- new_binder_exception(
- ExceptionCode::SERVICE_SPECIFIC,
- format!("failed to open {:?} on authfs: {}", &path, e),
+ Status::new_service_specific_error_str(
+ -1,
+ Some(format!("failed to open {:?} on authfs: {}", &path, e)),
)
})?;
Ok(ParcelFileDescriptor::new(file))
@@ -72,7 +71,7 @@
if let Some(s) = self.mountpoint.to_str() {
Ok(s.to_string())
} else {
- Err(new_binder_exception(ExceptionCode::SERVICE_SPECIFIC, "Bad string encoding"))
+ Err(Status::new_service_specific_error_str(-1, Some("Bad string encoding")))
}
}
}