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

Commit fb6dd74b authored by William Escande's avatar William Escande
Browse files

Improve AudioProvider logging

Bug: 245009140
Test: looked at some beautiful log when bluetooth is killed (RIP)
Change-Id: If33bee4e875812ce3710d41014cae8bd54d840f2
parent f3faab08
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ ndk::ScopedAStatus BluetoothAudioProvider::startSession(
    DataMQDesc* _aidl_return) {
  if (host_if == nullptr) {
    *_aidl_return = DataMQDesc();
    LOG(ERROR) << __func__ << " - SessionType=" << toString(session_type_)
               << " Illegal argument";
    return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
  }

@@ -73,6 +75,7 @@ ndk::ScopedAStatus BluetoothAudioProvider::startSession(
  AIBinder_linkToDeath(stack_iface_->asBinder().get(), death_recipient_.get(),
                       cookie);

  LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);
  onSessionReady(_aidl_return);
  return ndk::ScopedAStatus::ok();
}
@@ -98,10 +101,9 @@ ndk::ScopedAStatus BluetoothAudioProvider::endSession() {

ndk::ScopedAStatus BluetoothAudioProvider::streamStarted(
    BluetoothAudioStatus status) {
  if (stack_iface_ != nullptr) {
    LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
              << ", status=" << toString(status);

  if (stack_iface_ != nullptr) {
    BluetoothAudioSessionReport::ReportControlStatus(session_type_, true,
                                                     status);
  } else {
@@ -129,8 +131,6 @@ ndk::ScopedAStatus BluetoothAudioProvider::streamSuspended(

ndk::ScopedAStatus BluetoothAudioProvider::updateAudioConfiguration(
    const AudioConfiguration& audio_config) {
  LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);

  if (stack_iface_ == nullptr || audio_config_ == nullptr) {
    LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
              << " has NO session";
@@ -146,13 +146,13 @@ ndk::ScopedAStatus BluetoothAudioProvider::updateAudioConfiguration(
  audio_config_ = std::make_unique<AudioConfiguration>(audio_config);
  BluetoothAudioSessionReport::ReportAudioConfigChanged(session_type_,
                                                        *audio_config_);
  LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
            << " | audio_config=" << audio_config.toString();
  return ndk::ScopedAStatus::ok();
}

ndk::ScopedAStatus BluetoothAudioProvider::setLowLatencyModeAllowed(
    bool allowed) {
  LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);

  if (stack_iface_ == nullptr) {
    LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
              << " has NO session";