diff options
author | 2024-08-05 13:39:04 +0000 | |
---|---|---|
committer | 2024-08-14 14:08:30 +0000 | |
commit | 43e3b8bbb1485215ccf168d877e285803832b86c (patch) | |
tree | 24f06727b27135ac63289e6665956fbadbc2247e /libs/binder/IServiceManager.cpp | |
parent | e1c075b7e498370f0a4af6802b6e39ff1c48cb9b (diff) |
Change constructor of ServiceManagerShim
Without this change the defaultServiceManager()
would return a ServiceManagerShim with a BackendUnifiedServiceManager
holding a BackendUnifiedServiceManager.
Test: atest aidl_integration_test
Bug: 333854840
Flag: Exempt Bugfix
Change-Id: I3d3bcfa3392da89085b8f034c42aff30759a2cd2
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r-- | libs/binder/IServiceManager.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index 8b80aed630..3e848ab9b4 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -82,7 +82,7 @@ IServiceManager::~IServiceManager() {} class ServiceManagerShim : public IServiceManager { public: - explicit ServiceManagerShim (const sp<AidlServiceManager>& impl); + explicit ServiceManagerShim(const sp<BackendUnifiedServiceManager>& impl); sp<IBinder> getService(const String16& name) const override; sp<IBinder> checkService(const String16& name) const override; @@ -278,9 +278,8 @@ void* openDeclaredPassthroughHal(const String16& interface, const String16& inst // ---------------------------------------------------------------------- -ServiceManagerShim::ServiceManagerShim(const sp<AidlServiceManager>& impl) { - mUnifiedServiceManager = sp<BackendUnifiedServiceManager>::make(impl); -} +ServiceManagerShim::ServiceManagerShim(const sp<BackendUnifiedServiceManager>& impl) + : mUnifiedServiceManager(impl) {} // This implementation could be simplified and made more efficient by delegating // to waitForService. However, this changes the threading structure in some @@ -621,7 +620,7 @@ class ServiceManagerHostShim : public ServiceManagerShim { public: ServiceManagerHostShim(const sp<AidlServiceManager>& impl, const RpcDelegateServiceManagerOptions& options) - : ServiceManagerShim(impl), mOptions(options) {} + : ServiceManagerShim(sp<BackendUnifiedServiceManager>::make(impl)), mOptions(options) {} // ServiceManagerShim::getService is based on checkService, so no need to override it. sp<IBinder> checkService(const String16& name) const override { return getDeviceService({String8(name).c_str()}, mOptions); |