diff options
author | 2021-05-10 18:31:34 +0000 | |
---|---|---|
committer | 2021-05-10 18:32:39 +0000 | |
commit | 48c73e0f53ada9c48cabffbc4e0fbd402c71cba9 (patch) | |
tree | cd2bcce1c5495ea9bd512d0cfc54d41ac79036be | |
parent | 2281985cd3e7f6eeeed48f5b4a677e2e665a2eef (diff) |
libbinder: LazyServiceRegistrar log w/ error codes
NEED MORE INPUT!
Bug: 187301655
Test: N/A
Change-Id: Id303361fb1bad8f9741d12628942ec916e352b4a
-rw-r--r-- | libs/binder/LazyServiceRegistrar.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/libs/binder/LazyServiceRegistrar.cpp b/libs/binder/LazyServiceRegistrar.cpp index b503bebc5e..616591182a 100644 --- a/libs/binder/LazyServiceRegistrar.cpp +++ b/libs/binder/LazyServiceRegistrar.cpp @@ -123,16 +123,20 @@ bool ClientCounterCallbackImpl::registerService(const sp<IBinder>& service, cons std::string regStr = (reRegister) ? "Re-registering" : "Registering"; ALOGI("%s service %s", regStr.c_str(), name.c_str()); - if (!manager->addService(name.c_str(), service, allowIsolated, dumpFlags).isOk()) { - ALOGE("Failed to register service %s", name.c_str()); + if (Status status = manager->addService(name.c_str(), service, allowIsolated, dumpFlags); + !status.isOk()) { + ALOGE("Failed to register service %s (%s)", name.c_str(), status.toString8().c_str()); return false; } if (!reRegister) { - if (!manager->registerClientCallback(name, service, - sp<android::os::IClientCallback>::fromExisting(this)) - .isOk()) { - ALOGE("Failed to add client callback for service %s", name.c_str()); + if (Status status = + manager->registerClientCallback(name, service, + sp<android::os::IClientCallback>::fromExisting( + this)); + !status.isOk()) { + ALOGE("Failed to add client callback for service %s (%s)", name.c_str(), + status.toString8().c_str()); return false; } @@ -171,10 +175,10 @@ bool ClientCounterCallbackImpl::tryUnregister() { auto manager = interface_cast<AidlServiceManager>(asBinder(defaultServiceManager())); for (auto& [name, entry] : mRegisteredServices) { - bool success = manager->tryUnregisterService(name, entry.service).isOk(); + Status status = manager->tryUnregisterService(name, entry.service); - if (!success) { - ALOGI("Failed to unregister service %s", name.c_str()); + if (!status.isOk()) { + ALOGI("Failed to unregister service %s (%s)", name.c_str(), status.toString8().c_str()); return false; } entry.registered = false; |