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

Commit 319c4bd4 authored by Henri Chataing's avatar Henri Chataing Committed by Automerger Merge Worker
Browse files

Merge "Convert all uses of base::TimeDelta to std::chrono::microseconds" into main am: d1e37cda

parents 43a8b8f5 d1e37cda
Loading
Loading
Loading
Loading
+3 −11
Original line number Original line Diff line number Diff line
@@ -159,12 +159,8 @@ static void bta_av_api_enable(tBTA_AV_DATA* p_data) {
      tBTA_AV_API_ENABLE* p_buf =
      tBTA_AV_API_ENABLE* p_buf =
          (tBTA_AV_API_ENABLE*)osi_malloc(sizeof(tBTA_AV_API_ENABLE));
          (tBTA_AV_API_ENABLE*)osi_malloc(sizeof(tBTA_AV_API_ENABLE));
      memcpy(p_buf, &p_data->api_enable, sizeof(tBTA_AV_API_ENABLE));
      memcpy(p_buf, &p_data->api_enable, sizeof(tBTA_AV_API_ENABLE));
#if BASE_VER < 931007
      bta_sys_sendmsg_delayed(
      bta_sys_sendmsg_delayed(p_buf, base::TimeDelta::FromMilliseconds(
          p_buf, std::chrono::milliseconds(kEnablingAttemptsIntervalMs));
#else
      bta_sys_sendmsg_delayed(p_buf, base::Milliseconds(
#endif
                                         kEnablingAttemptsIntervalMs));
      return;
      return;
    }
    }
    if (bta_av_cb.sdp_a2dp_handle) {
    if (bta_av_cb.sdp_a2dp_handle) {
@@ -465,11 +461,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) {
        (tBTA_AV_API_REG*)osi_malloc(sizeof(tBTA_AV_API_REG));
        (tBTA_AV_API_REG*)osi_malloc(sizeof(tBTA_AV_API_REG));
    memcpy(p_buf, &p_data->api_reg, sizeof(tBTA_AV_API_REG));
    memcpy(p_buf, &p_data->api_reg, sizeof(tBTA_AV_API_REG));
    bta_sys_sendmsg_delayed(
    bta_sys_sendmsg_delayed(
#if BASE_VER < 931007
        p_buf, std::chrono::milliseconds(kEnablingAttemptsIntervalMs));
        p_buf, base::TimeDelta::FromMilliseconds(kEnablingAttemptsIntervalMs));
#else
        p_buf, base::Milliseconds(kEnablingAttemptsIntervalMs));
#endif
    return;
    return;
  }
  }


+3 −8
Original line number Original line Diff line number Diff line
@@ -128,14 +128,9 @@ void start_audio_ticks() {
  }
  }


  wakelock_acquire();
  wakelock_acquire();
  audio_timer.SchedulePeriodic(
  audio_timer.SchedulePeriodic(get_main_thread()->GetWeakPtr(), FROM_HERE,
      get_main_thread()->GetWeakPtr(), FROM_HERE,
                               base::BindRepeating(&send_audio_data),
                               base::BindRepeating(&send_audio_data),
#if BASE_VER < 931007
                               std::chrono::milliseconds(data_interval_ms));
      base::TimeDelta::FromMilliseconds(data_interval_ms));
#else
      base::Milliseconds(data_interval_ms));
#endif
  LOG_INFO("running with data interval: %d", data_interval_ms);
  LOG_INFO("running with data interval: %d", data_interval_ms);
}
}


+1 −5
Original line number Original line Diff line number Diff line
@@ -254,11 +254,7 @@ void SourceImpl::StartAudioTicks() {
  audio_timer_.SchedulePeriodic(
  audio_timer_.SchedulePeriodic(
      worker_thread_->GetWeakPtr(), FROM_HERE,
      worker_thread_->GetWeakPtr(), FROM_HERE,
      base::BindRepeating(&SourceImpl::SendAudioData, base::Unretained(this)),
      base::BindRepeating(&SourceImpl::SendAudioData, base::Unretained(this)),
#if BASE_VER < 931007
      std::chrono::microseconds(source_codec_config_.data_interval_us));
      base::TimeDelta::FromMicroseconds(source_codec_config_.data_interval_us));
#else
      base::Microseconds(source_codec_config_.data_interval_us));
#endif
}
}


void SourceImpl::StopAudioTicks() {
void SourceImpl::StopAudioTicks() {
+5 −30
Original line number Original line Diff line number Diff line
@@ -2211,12 +2211,7 @@ class LeAudioClientImpl : public LeAudioClient {
        base::BindOnce(
        base::BindOnce(
            &LeAudioClientImpl::checkGroupConnectionStateAfterMemberDisconnect,
            &LeAudioClientImpl::checkGroupConnectionStateAfterMemberDisconnect,
            weak_factory_.GetWeakPtr(), group_id),
            weak_factory_.GetWeakPtr(), group_id),
#if BASE_VER < 931007
        std::chrono::milliseconds(kGroupConnectedWatchDelayMs));
        base::TimeDelta::FromMilliseconds(kGroupConnectedWatchDelayMs)
#else
        base::Milliseconds(kDeviceAttachDelayMs)
#endif
    );
  }
  }


  void autoConnect(RawAddress address) {
  void autoConnect(RawAddress address) {
@@ -2236,12 +2231,7 @@ class LeAudioClientImpl : public LeAudioClient {
        FROM_HERE,
        FROM_HERE,
        base::BindOnce(&LeAudioClientImpl::autoConnect,
        base::BindOnce(&LeAudioClientImpl::autoConnect,
                       weak_factory_.GetWeakPtr(), address),
                       weak_factory_.GetWeakPtr(), address),
#if BASE_VER < 931007
        std::chrono::milliseconds(kAutoConnectAfterOwnDisconnectDelayMs));
        base::TimeDelta::FromMilliseconds(kAutoConnectAfterOwnDisconnectDelayMs)
#else
        base::Milliseconds(kDeviceAttachDelayMs)
#endif
    );
  }
  }


  void recoveryReconnect(RawAddress address) {
  void recoveryReconnect(RawAddress address) {
@@ -2275,12 +2265,7 @@ class LeAudioClientImpl : public LeAudioClient {
        FROM_HERE,
        FROM_HERE,
        base::BindOnce(&LeAudioClientImpl::recoveryReconnect,
        base::BindOnce(&LeAudioClientImpl::recoveryReconnect,
                       weak_factory_.GetWeakPtr(), address),
                       weak_factory_.GetWeakPtr(), address),
#if BASE_VER < 931007
        std::chrono::milliseconds(kRecoveryReconnectDelayMs));
        base::TimeDelta::FromMilliseconds(kRecoveryReconnectDelayMs)
#else
        base::Milliseconds(kDeviceAttachDelayMs)
#endif
    );
  }
  }


  void checkIfGroupMember(RawAddress address) {
  void checkIfGroupMember(RawAddress address) {
@@ -2316,12 +2301,7 @@ class LeAudioClientImpl : public LeAudioClient {
        FROM_HERE,
        FROM_HERE,
        base::BindOnce(&LeAudioClientImpl::checkIfGroupMember,
        base::BindOnce(&LeAudioClientImpl::checkIfGroupMember,
                       weak_factory_.GetWeakPtr(), address),
                       weak_factory_.GetWeakPtr(), address),
#if BASE_VER < 931007
        std::chrono::milliseconds(kCsisGroupMemberDelayMs));
        base::TimeDelta::FromMilliseconds(kCsisGroupMemberDelayMs)
#else
        base::Milliseconds(kCsisGroupMemberDelayMs)
#endif
    );
  }
  }


  void OnGattDisconnected(uint16_t conn_id, tGATT_IF client_if,
  void OnGattDisconnected(uint16_t conn_id, tGATT_IF client_if,
@@ -3127,12 +3107,7 @@ class LeAudioClientImpl : public LeAudioClient {
        FROM_HERE,
        FROM_HERE,
        base::BindOnce(&LeAudioClientImpl::restartAttachToTheStream,
        base::BindOnce(&LeAudioClientImpl::restartAttachToTheStream,
                       weak_factory_.GetWeakPtr(), addr),
                       weak_factory_.GetWeakPtr(), addr),
#if BASE_VER < 931007
        std::chrono::milliseconds(kDeviceAttachDelayMs));
        base::TimeDelta::FromMilliseconds(kDeviceAttachDelayMs)
#else
        base::Milliseconds(kDeviceAttachDelayMs)
#endif
    );
  }
  }


  void SendAudioGroupSelectableCodecConfigChanged(LeAudioDeviceGroup* group) {
  void SendAudioGroupSelectableCodecConfigChanged(LeAudioDeviceGroup* group) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -144,7 +144,7 @@ bt_status_t do_in_main_thread(const base::Location& from_here,


bt_status_t do_in_main_thread_delayed(const base::Location& from_here,
bt_status_t do_in_main_thread_delayed(const base::Location& from_here,
                                      base::OnceClosure task,
                                      base::OnceClosure task,
                                      const base::TimeDelta& delay) {
                                      std::chrono::microseconds delay) {
  /* For testing purpose it is ok to just skip delay */
  /* For testing purpose it is ok to just skip delay */
  return do_in_main_thread(from_here, std::move(task));
  return do_in_main_thread(from_here, std::move(task));
}
}
Loading