ohos: add ohos service info implementation


Register the SPP service of an already inited server. Only RFCOMM (SPP)
services can be registered on OHOS, so use the previously created and
inited server context to start listening with the server proxy - from
this point the server is capable of accepting the connections.

Look the server context up by the RFCOMM server channel of the
registered QBluetoothServiceInfo, and take the service UUID from it as
well, because OHOS identifies an SPP service by the UUID given to
sppListen() - the same UUID a client connects with.

Reject the registration when the service is not an RFCOMM one, when it
carries neither the server channel nor the service UUID, when the
service name is already taken by another server or when the server is
already listening. Report the reason of a failed registration with the
QBluetoothServer errors, which the server proxy notifies for a failed
sppListen() call.

Close the server socket when accepting the clients cannot be started,
so that a service which is not registered leaves neither the system
socket nor the taken service name behind.

Ignore the result of the sppAccept() call which is still in flight when
the service gets unregistered: close the accepted client socket instead
of announcing the connection, do not report the failed accepting and do
not accept the next connections anymore.

Task-number: QTBUG-147192
Pick-to: 6.12
Change-Id: I4e85603d3b84dfb17af0053bcab2ac30dac48c1c
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Zbigniew Chyla <zbigniew.chyla@qt.io>
commit1ed4182fe50b112ceabd6c2848984a3719552ac1
parent23c057674ce0b3b03101d24c6e7276887a9adac8
authorAdam Krzykala <adam.krzykala@qt.io>
committerDawid Śliwa <dawid.sliwa@qt.io>
commit timeMon, 14 Sep 2026 12:02:29 +0000