Improve AudioProvider logging

Bug: 245009140
Test: looked at some beautiful log when bluetooth is killed (RIP)
(cherry picked from https://android-review.googlesource.com/q/commit:fb6dd74b2c84bf6ab0238760e06bcd3d078011c4)
Merged-In: If33bee4e875812ce3710d41014cae8bd54d840f2
Change-Id: If33bee4e875812ce3710d41014cae8bd54d840f2
This commit is contained in:
William Escande
2023-05-09 16:38:23 -07:00
committed by Cherrypicker Worker
parent 01d65e01d0
commit d1de935e1d

View File

@@ -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) {
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
<< ", status=" << toString(status);
if (stack_iface_ != nullptr) {
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
<< ", status=" << toString(status);
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";