Loading android/app/AndroidManifest.xml +0 −1 Original line number Diff line number Diff line Loading @@ -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"/> Loading system/bta/hearing_aid/hearing_aid.cc +11 −5 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); } Loading system/gd/hci/acl_manager/le_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -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( Loading Loading @@ -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; Loading system/main/shim/acl.cc +4 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading system/stack/btm/btm_ble_bgconn.cc +15 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading @@ -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 Loading
android/app/AndroidManifest.xml +0 −1 Original line number Diff line number Diff line Loading @@ -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"/> Loading
system/bta/hearing_aid/hearing_aid.cc +11 −5 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); } Loading
system/gd/hci/acl_manager/le_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -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( Loading Loading @@ -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; Loading
system/main/shim/acl.cc +4 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading
system/stack/btm/btm_ble_bgconn.cc +15 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading @@ -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