27 QJniObject intentObject(intent);
28 const QString action = intentObject.callMethod<QString>(
"getAction");
30 qCDebug(QT_BT_ANDROID) <<
"ServiceDiscoveryBroadcastReceiver::onReceive() - event:" << action;
32 if (action == valueForStaticField<QtJniTypes::BluetoothDevice, JavaNames::ActionUuid>()) {
33 QString keyExtra = valueForStaticField<QtJniTypes::BluetoothDevice, JavaNames::ExtraUuid>();
34 const QJniArray parcelableUuids = intentObject.callMethod<QtJniTypes::Parcelable[]>(
35 "getParcelableArrayExtra", keyExtra);
36 if (!parcelableUuids.isValid()) {
37 emit uuidFetchFinished(QBluetoothAddress(), QList<QBluetoothUuid>());
40 const QList<QBluetoothUuid> result = ServiceDiscoveryBroadcastReceiver::convertParcelableArray(parcelableUuids);
42 keyExtra = valueForStaticField<QtJniTypes::BluetoothDevice, JavaNames::ExtraDevice>();
43 const QtJniTypes::Parcelable bluetoothDevice =
44 intentObject.callMethod<QtJniTypes::Parcelable>(
"getParcelableExtra", keyExtra);
45 QBluetoothAddress address;
46 if (bluetoothDevice.isValid()) {
47 address = QBluetoothAddress(bluetoothDevice.callMethod<QString>(
"getAddress"));
48 emit uuidFetchFinished(address, result);
50 emit uuidFetchFinished(QBluetoothAddress(), QList<QBluetoothUuid>());
57 QList<QBluetoothUuid> result;
58 if (!parcelUuidArray.isValid())
61 for (
const auto &parcel : parcelUuidArray) {
62 QBluetoothUuid uuid(parcel.callMethod<QString>(
"toString"));