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

Commit d99ebb96 authored by Roopa Sattiraju's avatar Roopa Sattiraju Committed by Automerger Merge Worker
Browse files

Merge "Removing bonded device when auth fails due to missing keys" into tm-dev...

Merge "Removing bonded device when auth fails due to missing keys" into tm-dev am: e3aa2d02 am: 62960ed2 am: a85ebf45

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/18572254



Change-Id: I68733256a9e2618f6a04e504218a02b499076141
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8d3be410 a85ebf45
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -1123,22 +1123,14 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
        break;

      case HCI_ERR_PAIRING_NOT_ALLOWED:
        if (!bluetooth::shim::is_gd_security_enabled()) {
          is_bonded_device_removed = (btif_storage_remove_bonded_device(
                                          &bd_addr) == BT_STATUS_SUCCESS);
        } else {
          is_bonded_device_removed = true;
        }
        is_bonded_device_removed = false;
        status = BT_STATUS_AUTH_REJECTED;
        break;

      /* map the auth failure codes, so we can retry pairing if necessary */
      case HCI_ERR_AUTH_FAILURE:
      case HCI_ERR_KEY_MISSING:
        is_bonded_device_removed = (bluetooth::shim::is_gd_security_enabled())
                                       ? true
                                       : (btif_storage_remove_bonded_device(
                                              &bd_addr) == BT_STATUS_SUCCESS);
        is_bonded_device_removed = false;
        [[fallthrough]];
      case HCI_ERR_HOST_REJECT_SECURITY:
      case HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE:
@@ -1169,10 +1161,7 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
      /* Remove Device as bonded in nvram as authentication failed */
      BTIF_TRACE_DEBUG("%s(): removing hid pointing device from nvram",
                       __func__);
      is_bonded_device_removed = (bluetooth::shim::is_gd_security_enabled())
                                     ? true
                                     : (btif_storage_remove_bonded_device(
                                            &bd_addr) == BT_STATUS_SUCCESS);
      is_bonded_device_removed = false;
    }
    // Report bond state change to java only if we are bonding to a device or
    // a device is removed from the pairing list.