ohos: provide pairing mechanism


Introduce QOhosBluetoothRemoteDeviceProxy and register a callback for
the bond state changes emitted while pairing with remote devices. Carry
the remote device id, the new bond state and the unbond cause; based on
that emit the proxy bondStateChanged() signal. Read the cause as
optional even though BondStateParam declares it mandatory, and act on
it only when the bond failed or the device was unpaired, the only
outcome its value describes.

Track the pending pairing processes in m_pendingPairingRequests to block
duplicate requests and to reject state handling for requests not
initiated by the given QOhosBluetoothLocalDevicePrivate instance.

Expire a pending request after 30 s. OHOS reports no bond state change
when the user leaves the system pairing dialog unanswered, so the
request would stay pending forever and block every later one. Read the
pair state before reporting the expiry, because the bond can be
established without a reported state change.

Fall back to Paired for AuthorizedPaired, which OHOS does not
distinguish, and report PairingError for unpairing requests on paired
devices, because OHOS offers no way to remove an existing bond.

Report QBluetoothLocalDevice::MissingPermissionsError through
errorOccurred() when the access bluetooth permission is not granted:
check the permission inside QOhosBluetoothRemoteDeviceProxy, emit its
missingPermission() signal, and connect that signal to errorOccurred()
in QBluetoothLocalDevice. Let pairingStatus() fall back
to Unpaired, and keep the backend free of Qt error types.

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