Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46e86943 authored by Archie Pusaka's avatar Archie Pusaka Committed by Gerrit Code Review
Browse files

Merge changes Iad6bd166,If5d6dfa3

* changes:
  Floss: Check services_resolved against the changed property
  Floss: Prevent propagating SDP failure message during RNR
parents 36fb8899 44229f58
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1759,9 +1759,8 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
        pairing_cb.sdp_attempts = 0;

        // Send UUIDs discovered through EIR to Java to unblock pairing intent
        // when SDP failed or no UUID is discovered
        if (p_data->disc_res.result != BTA_SUCCESS ||
            p_data->disc_res.num_uuids == 0) {
        // when SDP failed
        if (p_data->disc_res.result != BTA_SUCCESS) {
          auto uuids_iter = eir_uuids_cache.find(bd_addr);
          if (uuids_iter != eir_uuids_cache.end()) {
            num_eir_uuids = uuids_iter->second.size();
+10 −11
Original line number Diff line number Diff line
@@ -1561,19 +1561,18 @@ impl BtifBluetoothCallbacks for Bluetooth {
                Bluetooth::send_metrics_remote_device_info(d);

                let info = d.info.clone();
                let has_uuids = d
                    .properties
                    .get(&BtPropertyType::Uuids)
                    .and_then(|prop| match prop {
                        BluetoothProperty::Uuids(uu) => Some(uu.len() > 0),
                        _ => None,
                    })
                    .map_or(false, |v| v);

                if !d.services_resolved {
                    let has_uuids = properties.iter().any(|prop| match prop {
                        BluetoothProperty::Uuids(uu) => uu.len() > 0,
                        _ => false,
                    });

                    // Services are resolved when uuids are fetched.
                d.services_resolved = has_uuids;
                    d.services_resolved |= has_uuids;
                }

                if d.wait_to_connect && has_uuids {
                if d.wait_to_connect && d.services_resolved {
                    d.wait_to_connect = false;

                    let sent_info = info.clone();