diff options
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r-- | libs/binder/IServiceManager.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index 17e522d921..12a18f2a69 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -26,6 +26,7 @@ #include <android-base/properties.h> #include <android/os/BnServiceCallback.h> +#include <android/os/IAccessor.h> #include <android/os/IServiceManager.h> #include <binder/IPCThreadState.h> #include <binder/Parcel.h> @@ -57,6 +58,8 @@ using AidlRegistrationCallback = IServiceManager::LocalRegistrationCallback; using AidlServiceManager = android::os::IServiceManager; using android::binder::Status; +using android::os::IAccessor; +using android::os::Service; // libbinder's IServiceManager.h can't rely on the values generated by AIDL // because many places use its headers via include_dirs (meaning, without @@ -139,7 +142,10 @@ protected: // When implementing ServiceManagerShim, use realGetService instead of // mUnifiedServiceManager->getService so that it can be overridden in ServiceManagerHostShim. virtual Status realGetService(const std::string& name, sp<IBinder>* _aidl_return) { - return mUnifiedServiceManager->getService(name, _aidl_return); + Service service; + Status status = mUnifiedServiceManager->getService(name, &service); + *_aidl_return = service.get<Service::Tag::binder>(); + return status; } }; @@ -327,11 +333,11 @@ sp<IBinder> ServiceManagerShim::getService(const String16& name) const sp<IBinder> ServiceManagerShim::checkService(const String16& name) const { - sp<IBinder> ret; + Service ret; if (!mUnifiedServiceManager->checkService(String8(name).c_str(), &ret).isOk()) { return nullptr; } - return ret; + return ret.get<Service::Tag::binder>(); } status_t ServiceManagerShim::addService(const String16& name, const sp<IBinder>& service, |