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

Commit bbbf327c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8704672 from 1fb28ba1 to tm-release

Change-Id: Ice1bfb582999fbd25d57fec7943ee20d355c57a9
parents 197e748f 1fb28ba1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@
    <uses-permission android:name="android.permission.NETWORK_FACTORY"/>
    <uses-permission android:name="android.permission.TETHER_PRIVILEGED"/>
    <uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
    <uses-permission android:name="android.permission.BLUETOOTH_STACK"/>
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
    <uses-permission android:name="android.permission.MANAGE_USERS"/>
+11 −5
Original line number Diff line number Diff line
@@ -584,6 +584,7 @@ class HearingAidImpl : public HearingAid {
    }
  }

  // Just take care phy update successful case to avoid loop excuting.
  void OnPhyUpdateEvent(uint16_t conn_id, uint8_t tx_phys, uint8_t rx_phys,
                        tGATT_STATUS status) {
    HearingDevice* hearingDevice = hearingDevices.FindByConnId(conn_id);
@@ -591,14 +592,19 @@ class HearingAidImpl : public HearingAid {
      DVLOG(2) << "Skipping unknown device, conn_id=" << loghex(conn_id);
      return;
    }
    if (status == GATT_SUCCESS && tx_phys == PHY_LE_2M &&
        rx_phys == PHY_LE_2M) {
    if (status != GATT_SUCCESS) {
      LOG(WARNING) << hearingDevice->address
                   << " phy update fail with status: " << status;
      return;
    }
    if (tx_phys == PHY_LE_2M && rx_phys == PHY_LE_2M) {
      LOG(INFO) << hearingDevice->address << " phy update to 2M successful";
      return;
    }
    LOG(INFO) << hearingDevice->address
              << " phy update to 2M fail, try again. status: " << status
              << ", tx_phys: " << tx_phys << ", rx_phys: " << rx_phys;
    LOG(INFO)
        << hearingDevice->address
        << " phy update successful but not target phy, try again. tx_phys: "
        << tx_phys << ", rx_phys: " << rx_phys;
    BTM_BleSetPhy(hearingDevice->address, PHY_LE_2M, PHY_LE_2M, 0);
  }

+5 −0
Original line number Diff line number Diff line
@@ -585,6 +585,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
      return;
    }
    connect_list.erase(address_with_type);
    connecting_le_.erase(address_with_type);
    direct_connections_.erase(address_with_type);
    register_with_address_manager();
    le_address_manager_->RemoveDeviceFromFilterAcceptList(
@@ -643,6 +644,10 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
          connectability_state_machine_text(connectability_state_).c_str());
      return;
    }
    if (connect_list.empty()) {
      LOG_ERROR("Attempting to re-arm le connection state machine when filter accept list is empty");
      return;
    }
    AddressWithType empty(Address::kEmpty, AddressType::RANDOM_DEVICE_ADDRESS);
    connectability_state_ = ConnectabilityState::ARMING;
    connecting_le_ = connect_list;
+4 −0
Original line number Diff line number Diff line
@@ -1338,12 +1338,16 @@ void shim::legacy::Acl::CancelClassicConnection(const hci::Address& address) {
void shim::legacy::Acl::AcceptLeConnectionFrom(
    const hci::AddressWithType& address_with_type, bool is_direct,
    std::promise<bool> promise) {
  LOG_DEBUG("AcceptLeConnectionFrom %s",
            PRIVATE_ADDRESS(address_with_type.GetAddress()));
  handler_->CallOn(pimpl_.get(), &Acl::impl::accept_le_connection_from,
                   address_with_type, is_direct, std::move(promise));
}

void shim::legacy::Acl::IgnoreLeConnectionFrom(
    const hci::AddressWithType& address_with_type) {
  LOG_DEBUG("IgnoreLeConnectionFrom %s",
            PRIVATE_ADDRESS(address_with_type.GetAddress()));
  handler_->CallOn(pimpl_.get(), &Acl::impl::ignore_le_connection_from,
                   address_with_type);
}
+15 −2
Original line number Diff line number Diff line
@@ -205,8 +205,14 @@ bool BTM_AcceptlistAdd(const RawAddress& address) {
    LOG_WARN("Controller does not support Le");
    return false;
  }

  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(address);
  if (p_dev_rec != NULL && p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) {
    p_dev_rec->ble.in_controller_list |= BTM_ACCEPTLIST_BIT;
  }

  return bluetooth::shim::ACL_AcceptLeConnectionFrom(
      convert_to_address_with_type(address, btm_find_dev(address)),
      convert_to_address_with_type(address, p_dev_rec),
      /* is_direct */ false);
}

@@ -216,8 +222,15 @@ void BTM_AcceptlistRemove(const RawAddress& address) {
    LOG_WARN("Controller does not support Le");
    return;
  }

  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(address);
  if (p_dev_rec != NULL && p_dev_rec->device_type & BT_DEVICE_TYPE_BLE) {
    p_dev_rec->ble.in_controller_list &= ~BTM_ACCEPTLIST_BIT;
  }

  bluetooth::shim::ACL_IgnoreLeConnectionFrom(
      convert_to_address_with_type(address, btm_find_dev(address)));
      convert_to_address_with_type(address, p_dev_rec));
  return;
}

/** Clear the acceptlist, end any pending acceptlist connections */
Loading