Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa07a11 authored by Alice Wang's avatar Alice Wang
Browse files

[getService] Only set binder when getService2() succeeds

To avoid crashing in the getService() call.

Bug: 387175643
Test: atest servicemanager_test
Change-Id: I8617e748fdb85e96ded4c59b5c7785be20de05ee
parent 87a06b7f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -215,7 +215,9 @@ Status BackendUnifiedServiceManager::getService(const ::std::string& name,
                                                sp<IBinder>* _aidl_return) {
    os::Service service;
    Status status = getService2(name, &service);
    if (status.isOk()) {
        *_aidl_return = service.get<os::Service::Tag::serviceWithMetadata>().service;
    }
    return status;
}