SystemService service = serviceManager.getService(serviceID);
if (service == null) {
return null;
}
Isolate is = Isolate.currentIsolate();
Link serviceToClient = Link.newLink(is, is);
Link clientToService = Link.newLink(is, is);
SystemServiceConnectionLinks linksService =
new SystemServiceConnectionLinks(serviceToClient, clientToService);
SystemServiceConnectionLinks linksClient =
new SystemServiceConnectionLinks(clientToService, serviceToClient);
SystemServiceConnection conService =
new SystemServiceConnectionImpl(linksService);
SystemServiceConnection conClient =
new SystemServiceConnectionImpl(linksClient);
service.acceptConnection(conService);
return conClient;