58 if (!ensureAndroidPermission(QBluetoothPermission::Access)) {
59 qCWarning(QT_BT_ANDROID) <<
"Serviceinfo registerService() failed due to"
60 "missing permissions";
64 const QList<QBluetoothHostInfo> localDevices = QBluetoothLocalDevice::allDevices();
65 if (localDevices.isEmpty())
68 if (!localAdapter.isNull()) {
70 for (
const QBluetoothHostInfo &hostInfo : localDevices) {
71 if (hostInfo.address() == localAdapter) {
78 qCWarning(QT_BT_ANDROID) << localAdapter.toString() <<
"is not a valid local Bt adapter";
87 if (protocolDescriptor(QBluetoothUuid::ProtocolUuid::Rfcomm).isEmpty()) {
88 qCWarning(QT_BT_ANDROID) << Q_FUNC_INFO <<
"Only RFCOMM services can be registered on Android";
98 bool result = sPriv->initiateActiveListening(
99 attributes.value(QBluetoothServiceInfo::ServiceId).value<QBluetoothUuid>(),
100 attributes.value(QBluetoothServiceInfo::ServiceName).toString());