Skip to content

Commit 33a6e89

Browse files
Treehugger RobotGerrit Code Review
authored andcommitted
Merge "[getService] Only set binder when getService2() succeeds" into main
2 parents a115996 + 0aa07a1 commit 33a6e89

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libs/binder/BackendUnifiedServiceManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ Status BackendUnifiedServiceManager::getService(const ::std::string& name,
215215
sp<IBinder>* _aidl_return) {
216216
os::Service service;
217217
Status status = getService2(name, &service);
218-
*_aidl_return = service.get<os::Service::Tag::serviceWithMetadata>().service;
218+
if (status.isOk()) {
219+
*_aidl_return = service.get<os::Service::Tag::serviceWithMetadata>().service;
220+
}
219221
return status;
220222
}
221223

0 commit comments

Comments
 (0)