Revert "Revert "Implement addAuthToken method of IKeystoreAuthorization ...""

This reverts commit 96f410658821497db0f562c2ba2bc359bc3b1dfc.

Reason for revert: This change does not have an impact on the observed behavior, It can land by itself.

Change-Id: I7e1ff63d0bae77b4382047eaaacb8d34e31e2bc4
diff --git a/keystore2/src/keystore2_main.rs b/keystore2/src/keystore2_main.rs
index 8607eef..c75cfc8 100644
--- a/keystore2/src/keystore2_main.rs
+++ b/keystore2/src/keystore2_main.rs
@@ -16,6 +16,7 @@
 
 use binder::Interface;
 use keystore2::apc::ApcManager;
+use keystore2::authorization::AuthorizationManager;
 use keystore2::background_task_handler::Message;
 use keystore2::globals::{BACKGROUND_TASK_HANDLER, ENFORCEMENTS};
 use keystore2::service::KeystoreService;
@@ -25,6 +26,7 @@
 
 static KS2_SERVICE_NAME: &str = "android.system.keystore2";
 static APC_SERVICE_NAME: &str = "android.security.apc";
+static AUTHORIZATION_SERVICE_NAME: &str = "android.security.authorization";
 
 /// Keystore 2.0 takes one argument which is a path indicating its designated working directory.
 fn main() {
@@ -78,6 +80,14 @@
         panic!("Failed to register service {} because of {:?}.", APC_SERVICE_NAME, e);
     });
 
+    let authorization_service = AuthorizationManager::new_native_binder().unwrap_or_else(|e| {
+        panic!("Failed to create service {} because of {:?}.", AUTHORIZATION_SERVICE_NAME, e);
+    });
+    binder::add_service(AUTHORIZATION_SERVICE_NAME, authorization_service.as_binder())
+        .unwrap_or_else(|e| {
+            panic!("Failed to register service {} because of {:?}.", AUTHORIZATION_SERVICE_NAME, e);
+        });
+
     info!("Successfully registered Keystore 2.0 service.");
 
     info!("Joining thread pool now.");