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

Commit 3bc8d77f authored by Jacky Cheung's avatar Jacky Cheung Committed by android-build-merger
Browse files

Fix issue with BLE advertising not started when local privacy is not enabled

am: 78484ff4

Change-Id: I22817c79ffc0d7749261b18bcbd608fad70c20d3
parents e7e322cd 78484ff4
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -98,9 +98,7 @@ struct AdvertisingInstance {
  }
};

#if (BLE_PRIVACY_SPT == TRUE)
void btm_ble_adv_raddr_timer_timeout(void* data);
#endif

void DoNothing(uint8_t) {}
void DoNothing2(uint8_t, uint8_t) {}
@@ -267,7 +265,6 @@ class BleAdvertisingManagerImpl

      p_inst->in_use = true;

#if (BLE_PRIVACY_SPT == TRUE)
      // set up periodic timer to update address.
      if (BTM_BleLocalPrivacyEnabled()) {
        p_inst->own_address_type = BLE_ADDR_RANDOM;
@@ -285,14 +282,13 @@ class BleAdvertisingManagerImpl
              cb.Run(p_inst->inst_id, BTM_BLE_MULTI_ADV_SUCCESS);
            },
            p_inst, cb));
      }
#else
      } else {
        p_inst->own_address_type = BLE_ADDR_PUBLIC;
        memcpy(p_inst->own_address,
               controller_get_interface()->get_address()->address, BD_ADDR_LEN);

        cb.Run(p_inst->inst_id, BTM_BLE_MULTI_ADV_SUCCESS);
#endif
      }
      return;
    }

@@ -806,12 +802,10 @@ class BleAdvertisingManagerImpl
      return;
    }

#if (BLE_PRIVACY_SPT == TRUE)
    if (BTM_BleLocalPrivacyEnabled() &&
        advertising_handle <= BTM_BLE_MULTI_ADV_MAX) {
      btm_acl_update_conn_addr(connection_handle, p_inst->own_address);
    }
#endif

    VLOG(1) << "reneabling advertising";

@@ -839,12 +833,10 @@ class BleAdvertisingManagerImpl

BleAdvertisingManager* instance;

#if (BLE_PRIVACY_SPT == TRUE)
void btm_ble_adv_raddr_timer_timeout(void* data) {
  ((BleAdvertisingManagerImpl*)BleAdvertisingManager::Get())
      ->ConfigureRpa((AdvertisingInstance*)data, base::Bind(DoNothing));
}
#endif
}  // namespace

void BleAdvertisingManager::Initialize(BleAdvertiserHciInterface* interface) {