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

Commit f74910d4 authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge "system: Migrate CHECK to log::assert_that" into main

parents 57032ee2 4d715ed0
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
    log::fatal("BluetoothAudioHal::openProvider failure: {}",
               aidl_retval.getDescription());
  }
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  binder_status_t binder_status = AIBinder_linkToDeath(
      provider_factory->asBinder().get(), death_recipient_.get(), this);
@@ -642,7 +642,7 @@ size_t BluetoothAudioSourceClientInterface::WriteAudioData(const uint8_t* p_buf,

void BluetoothAudioClientInterface::SetCodecPriority(CodecId codec_id,
                                                     int32_t priority) {
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");
  auto aidl_retval = provider_->setCodecPriority(codec_id, priority);
  if (!aidl_retval.isOk()) {
    log::fatal("BluetoothAudioHal::setCodecPriority failure: {}",
@@ -660,7 +660,7 @@ BluetoothAudioClientInterface::GetLeAudioAseConfiguration(
        remoteSourceAudioCapabilities,
    std::vector<IBluetoothAudioProvider::LeAudioConfigurationRequirement>&
        requirements) {
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>
      configurations;
@@ -684,7 +684,7 @@ IBluetoothAudioProvider::LeAudioAseQosConfigurationPair
BluetoothAudioClientInterface::getLeAudioAseQosConfiguration(
    IBluetoothAudioProvider::LeAudioAseQosConfigurationRequirement&
        qosRequirement) {
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  IBluetoothAudioProvider::LeAudioAseQosConfigurationPair qos_configuration;
  auto aidl_retval = provider_->getLeAudioAseQosConfiguration(
@@ -700,7 +700,7 @@ BluetoothAudioClientInterface::getLeAudioAseQosConfiguration(
void BluetoothAudioClientInterface::onSinkAseMetadataChanged(
    IBluetoothAudioProvider::AseState state, int32_t cigId, int32_t cisId,
    std::optional<std::vector<std::optional<MetadataLtv>>>& metadata) {
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  auto aidl_retval =
      provider_->onSinkAseMetadataChanged(state, cigId, cisId, metadata);
@@ -714,7 +714,7 @@ void BluetoothAudioClientInterface::onSinkAseMetadataChanged(
void BluetoothAudioClientInterface::onSourceAseMetadataChanged(
    IBluetoothAudioProvider::AseState state, int32_t cigId, int32_t cisId,
    std::optional<std::vector<std::optional<MetadataLtv>>>& metadata) {
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  auto aidl_retval =
      provider_->onSourceAseMetadataChanged(state, cigId, cisId, metadata);
@@ -732,7 +732,7 @@ BluetoothAudioClientInterface::getLeAudioBroadcastConfiguration(
        remoteSinkAudioCapabilities,
    const IBluetoothAudioProvider::LeAudioBroadcastConfigurationRequirement&
        requirement) {
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  IBluetoothAudioProvider::LeAudioBroadcastConfigurationSetting setting;
  auto aidl_retval = provider_->getLeAudioBroadcastConfiguration(
+8 −5
Original line number Diff line number Diff line
@@ -116,8 +116,9 @@ HalVersionManager::GetProvidersFactory_2_1() {
  }
  android::sp<IBluetoothAudioProvidersFactory_2_1> providers_factory =
      IBluetoothAudioProvidersFactory_2_1::getService();
  CHECK(providers_factory)
      << "V2_1::IBluetoothAudioProvidersFactory::getService() failed";
  log::assert_that(
      providers_factory != nullptr,
      "V2_1::IBluetoothAudioProvidersFactory::getService() failed");

  log::info("V2_1::IBluetoothAudioProvidersFactory::getService() returned {}{}",
            fmt::ptr(providers_factory.get()),
@@ -134,8 +135,9 @@ HalVersionManager::GetProvidersFactory_2_0() {
  }
  android::sp<IBluetoothAudioProvidersFactory_2_0> providers_factory =
      IBluetoothAudioProvidersFactory_2_0::getService();
  CHECK(providers_factory)
      << "V2_0::IBluetoothAudioProvidersFactory::getService() failed";
  log::assert_that(
      providers_factory != nullptr,
      "V2_0::IBluetoothAudioProvidersFactory::getService() failed");

  log::info("V2_0::IBluetoothAudioProvidersFactory::getService() returned {}{}",
            fmt::ptr(providers_factory.get()),
@@ -154,7 +156,8 @@ HalVersionManager::HalVersionManager() {
  }

  auto service_manager = android::hardware::defaultServiceManager1_2();
  CHECK(service_manager != nullptr);
  log::assert_that(service_manager != nullptr,
                   "assert failed: service_manager != nullptr");
  size_t instance_count = 0;
  auto listManifestByInterface_cb =
      [&instance_count](
+11 −10
Original line number Diff line number Diff line
@@ -227,8 +227,8 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) {

  android::sp<IBluetoothAudioProvidersFactory_2_0> providersFactory =
      HalVersionManager::GetProvidersFactory_2_0();
  CHECK(providersFactory != nullptr)
      << "IBluetoothAudioProvidersFactory::getService() failed";
  log::assert_that(providersFactory != nullptr,
                   "IBluetoothAudioProvidersFactory::getService() failed");

  auto getProviderCapabilities_cb =
      [&capabilities](const hidl_vec<AudioCapabilities>& audioCapabilities) {
@@ -257,8 +257,8 @@ BluetoothAudioClientInterface::GetAudioCapabilities_2_1(

  android::sp<IBluetoothAudioProvidersFactory_2_1> providersFactory =
      HalVersionManager::GetProvidersFactory_2_1();
  CHECK(providersFactory != nullptr)
      << "IBluetoothAudioProvidersFactory::getService() failed";
  log::assert_that(providersFactory != nullptr,
                   "IBluetoothAudioProvidersFactory::getService() failed");

  auto getProviderCapabilities_cb =
      [&capabilities_2_1](
@@ -283,8 +283,8 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {

  android::sp<IBluetoothAudioProvidersFactory_2_0> providersFactory =
      HalVersionManager::GetProvidersFactory_2_0();
  CHECK(providersFactory != nullptr)
      << "IBluetoothAudioProvidersFactory::getService() failed";
  log::assert_that(providersFactory != nullptr,
                   "IBluetoothAudioProvidersFactory::getService() failed");

  auto getProviderCapabilities_cb =
      [&capabilities = this->capabilities_](
@@ -331,7 +331,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() {
    log::fatal("BluetoothAudioHal::openProvider failure: {}",
               hidl_retval.description());
  }
  CHECK(provider_ != nullptr);
  log::assert_that(provider_ != nullptr, "assert failed: provider_ != nullptr");

  if (!provider_->linkToDeath(death_recipient_, 0).isOk()) {
    log::fatal("BluetoothAudioDeathRecipient failure: {}",
@@ -350,8 +350,8 @@ void BluetoothAudioClientInterface::FetchAudioProvider_2_1() {

  android::sp<IBluetoothAudioProvidersFactory_2_1> providersFactory =
      HalVersionManager::GetProvidersFactory_2_1();
  CHECK(providersFactory != nullptr)
      << "IBluetoothAudioProvidersFactory_2_1::getService() failed";
  log::assert_that(providersFactory != nullptr,
                   "IBluetoothAudioProvidersFactory_2_1::getService() failed");

  auto getProviderCapabilities_cb =
      [&capabilities_2_1 = this->capabilities_2_1_](
@@ -399,7 +399,8 @@ void BluetoothAudioClientInterface::FetchAudioProvider_2_1() {
    log::fatal("BluetoothAudioHal::openProvider failure: {}",
               hidl_retval.description());
  }
  CHECK(provider_2_1_ != nullptr);
  log::assert_that(provider_2_1_ != nullptr,
                   "assert failed: provider_2_1_ != nullptr");

  if (!provider_2_1_->linkToDeath(death_recipient_, 0).isOk()) {
    log::fatal("BluetoothAudioDeathRecipient failure: {}",
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ cc_library {
        "com.android.btservices",
    ],
    shared_libs: [
        "libbase",
        "liblog",
    ],
    static_libs: [
@@ -52,6 +53,7 @@ cc_test {
        "test/audio_hearing_aid_hw_test.cc",
    ],
    shared_libs: [
        "libbase",
        "liblog",
    ],
    static_libs: [
+2 −1
Original line number Diff line number Diff line
@@ -2280,7 +2280,8 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    // The RTP Header marker bit for the A2DP Source encoder
    A2dpCodecConfig* codec_config =
        bta_av_get_a2dp_peer_current_codec(p_scb->PeerAddress());
    CHECK(codec_config != nullptr);
    log::assert_that(codec_config != nullptr,
                     "assert failed: codec_config != nullptr");
    p_scb->use_rtp_header_marker_bit = codec_config->useRtpHeaderMarkerBit();
  }

Loading