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/main.rs b/authfs/service/src/main.rs
index 890e108..fe8af61 100644
--- a/authfs/service/src/main.rs
+++ b/authfs/service/src/main.rs
@@ -34,9 +34,8 @@
BnAuthFsService, IAuthFsService,
};
use authfs_aidl_interface::binder::{
- self, add_service, BinderFeatures, ExceptionCode, Interface, ProcessState, Strong,
+ self, add_service, BinderFeatures, ExceptionCode, Interface, ProcessState, Status, Strong,
};
-use binder_common::new_binder_exception;
const SERVICE_NAME: &str = "authfs_service";
const SERVICE_ROOT: &str = "/data/misc/authfs";
@@ -57,16 +56,16 @@
// The directory is supposed to be deleted when `AuthFs` is dropped.
create_dir(&mountpoint).map_err(|e| {
- new_binder_exception(
- ExceptionCode::SERVICE_SPECIFIC,
- format!("Cannot create mount directory {:?}: {:?}", &mountpoint, e),
+ Status::new_service_specific_error_str(
+ -1,
+ Some(format!("Cannot create mount directory {:?}: {:?}", &mountpoint, e)),
)
})?;
authfs::AuthFs::mount_and_wait(mountpoint, config, self.debuggable).map_err(|e| {
- new_binder_exception(
- ExceptionCode::SERVICE_SPECIFIC,
- format!("mount_and_wait failed: {:?}", e),
+ Status::new_service_specific_error_str(
+ -1,
+ Some(format!("mount_and_wait failed: {:?}", e)),
)
})
}
@@ -80,9 +79,9 @@
fn validate(&self, config: &AuthFsConfig) -> binder::Result<()> {
if config.port < 0 {
- return Err(new_binder_exception(
+ return Err(Status::new_exception_str(
ExceptionCode::ILLEGAL_ARGUMENT,
- format!("Invalid port: {}", config.port),
+ Some(format!("Invalid port: {}", config.port)),
));
}
Ok(())