Introduce authfs_service

authfs_service serves as a privileged process in order to facilitate
authfs mounting (which is a privileged operation) for the client.

Once the service exists on microdroid, we will re-architect compsvc to
get the FD from authfs_service.

Code review hints:
 - authfs.rs is a modified copy from compos/src/authfs.rs. The original
   file should later be deleted as part of the re-architecturing.
 - The implementation intends to tie the lifecycle of an authfs
   instance/process/mount to the IAuthFs object, and clean up on the
   Rust object's drop.

Bug: 194717985
Test: 1. Start an fd_server with some files opened for read and write
      2. Start authfs_service
      3. Write a binder client with proper AuthFsConfig to get an
         IAuthFs from authfs_service. Let the client retrieves the FDs
         and copy from one remote FD to the other.
      4. Observe the file copy is correct.

Change-Id: Ia9979ee8d23f87bc33e2b670e135f63fee016426
diff --git a/authfs/service/src/common.rs b/authfs/service/src/common.rs
new file mode 100644
index 0000000..00efe9e
--- /dev/null
+++ b/authfs/service/src/common.rs
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+use std::ffi::CString;
+
+use authfs_aidl_interface::binder::{ExceptionCode, Status};
+
+/// Helper function to create a binder exception.
+pub fn new_binder_exception<T: AsRef<str>>(exception: ExceptionCode, message: T) -> Status {
+    Status::new_exception(exception, CString::new(message.as_ref()).as_deref().ok())
+}