Changes to adapt confirmationui AIDL spec.
Replaced HIDL spec implementation with AIDL spec in confirmationui
module.
Ignore-AOSP-First: Dependent on internal change.
Bug: b/205760172
Test: Run confirmation UI test using CTS Verifier, atest VtsHalConfirmationUITargetTest
Change-Id: I49b9cb6d93fa35fd611003f7545d2ce4976eec7c
diff --git a/trusty/confirmationui/service.cpp b/trusty/confirmationui/service.cpp
index dd7e84b..b286c0a 100644
--- a/trusty/confirmationui/service.cpp
+++ b/trusty/confirmationui/service.cpp
@@ -15,21 +15,28 @@
*/
#include <android-base/logging.h>
-#include <hidl/HidlTransportSupport.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
#include <TrustyConfirmationuiHal.h>
-using android::sp;
-using android::hardware::confirmationui::V1_0::implementation::createTrustyConfirmationUI;
+using ::aidl::android::hardware::confirmationui::createTrustyConfirmationUI;
+using ::aidl::android::hardware::confirmationui::IConfirmationUI;
int main() {
- ::android::hardware::configureRpcThreadpool(1, true /*willJoinThreadpool*/);
- auto service = createTrustyConfirmationUI();
- auto status = service->registerAsService();
- if (status != android::OK) {
- LOG(FATAL) << "Could not register service for ConfirmationUI 1.0 (" << status << ")";
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+
+ auto confirmationui = createTrustyConfirmationUI();
+
+ const auto instance = std::string(IConfirmationUI::descriptor) + "/default";
+ binder_status_t status =
+ AServiceManager_addService(confirmationui->asBinder().get(), instance.c_str());
+
+ if (status != STATUS_OK) {
+ LOG(FATAL) << "Could not register service for " << instance.c_str() << "(" << status << ")";
return -1;
}
- ::android::hardware::joinRpcThreadpool();
+
+ ABinderProcess_joinThreadPool();
return -1;
}