From 4092a77774b0cefbedd8ed87145145903b053dba Mon Sep 17 00:00:00 2001 From: Rajesh Nyamagoud Date: Mon, 24 Oct 2022 19:25:35 +0000 Subject: [PATCH] Replaced `-1` with `EXIT_FAILURE` and validated confirmationui service status after registering it with `CHECK_EQ` macro. Bug: b/205760172 Test: atest VtsHalConfirmationUITargetTest Change-Id: I00f5a09ca525e3abb63a5d1f404fb6f3daed9442 --- trusty/confirmationui/service.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/trusty/confirmationui/service.cpp b/trusty/confirmationui/service.cpp index b286c0a98..44fa3a696 100644 --- a/trusty/confirmationui/service.cpp +++ b/trusty/confirmationui/service.cpp @@ -31,12 +31,8 @@ int main() { 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; - } + CHECK_EQ(status, STATUS_OK) << "Could not register " << instance; ABinderProcess_joinThreadPool(); - return -1; + return EXIT_FAILURE; }