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

Commit 118a8a1f authored by Eric Miao's avatar Eric Miao Committed by Gerrit Code Review
Browse files

Revert "gd/hci: enable erroneous data reporting in controller"

Revert submission 2494418

Reason for revert: CLs are causing test failures on some platforms where it failed at 'assertion complete_view.IsValid()'. See b/275596201.

Reverted changes: /q/submissionid:2494418

Change-Id: If6c724490d43b2fa99dbec507abb8f16e47caa92
parent 63a9fce1
Loading
Loading
Loading
Loading
+0 −36
Original line number Original line Diff line number Diff line
@@ -178,13 +178,6 @@ struct Controller::impl {
          handler->BindOnceOn(this, &Controller::impl::le_set_host_feature_handler));
          handler->BindOnceOn(this, &Controller::impl::le_set_host_feature_handler));
    }
    }


    if (is_supported(OpCode::READ_DEFAULT_ERRONEOUS_DATA_REPORTING)) {
      hci_->EnqueueCommand(
          ReadDefaultErroneousDataReportingBuilder::Create(),
          handler->BindOnceOn(
              this, &Controller::impl::read_default_erroneous_data_reporting_handler));
    }

    // Skip vendor capabilities check if configured.
    // Skip vendor capabilities check if configured.
    if (os::GetSystemPropertyBool(
    if (os::GetSystemPropertyBool(
            kPropertyVendorCapabilitiesEnabled, kDefaultVendorCapabilitiesEnabled)) {
            kPropertyVendorCapabilitiesEnabled, kDefaultVendorCapabilitiesEnabled)) {
@@ -388,35 +381,6 @@ struct Controller::impl {
    ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
    ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
  }
  }


  void read_default_erroneous_data_reporting_handler(CommandCompleteView view) {
    auto complete_view = ReadDefaultErroneousDataReportingCompleteView::Create(view);
    ASSERT(complete_view.IsValid());
    ErrorCode status = complete_view.GetStatus();
    ASSERT_LOG(
        status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
    Enable erroneous_data_reporting = complete_view.GetErroneousDataReporting();
    LOG_INFO("read default erroneous data reporting: %hhu", erroneous_data_reporting);

    // Enable Erroneous Data Reporting if it is disabled and the write command is supported.
    if (erroneous_data_reporting == Enable::DISABLED &&
        is_supported(OpCode::WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING)) {
      std::unique_ptr<WriteDefaultErroneousDataReportingBuilder> packet =
          WriteDefaultErroneousDataReportingBuilder::Create(Enable::ENABLED);
      hci_->EnqueueCommand(
          std::move(packet),
          module_.GetHandler()->BindOnceOn(
              this, &Controller::impl::write_default_erroneous_data_reporting_handler));
    }
  }

  void write_default_erroneous_data_reporting_handler(CommandCompleteView view) {
    auto complete_view = WriteDefaultErroneousDataReportingCompleteView::Create(view);
    ASSERT(complete_view.IsValid());
    ErrorCode status = complete_view.GetStatus();
    ASSERT_LOG(
        status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
  }

  void le_read_local_supported_features_handler(CommandCompleteView view) {
  void le_read_local_supported_features_handler(CommandCompleteView view) {
    auto complete_view = LeReadLocalSupportedFeaturesCompleteView::Create(view);
    auto complete_view = LeReadLocalSupportedFeaturesCompleteView::Create(view);
    ASSERT(complete_view.IsValid());
    ASSERT(complete_view.IsValid());