From c7a3b69936bd1b72aaa191f1c1848b29766431a1 Mon Sep 17 00:00:00 2001
From: Jakub Tyszkowski <tyszkowski@google.com>
Date: Mon, 17 Apr 2023 07:16:26 +0000
Subject: [PATCH] LeAudio: Enable essential audio context logs

This will improve triaging any potential context type related
issues when debug logs are not enabled.

Bug: 295972694
Test: atest bluetooth_le_audio_client_test
Test: manual
Tag: #feature

Change-Id: Ia591e1d32c2efcdef0c29312f316d6004f03ae09
---
 system/bta/le_audio/client.cc         | 10 +++++-----
 system/bta/le_audio/le_audio_utils.cc |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/system/bta/le_audio/client.cc b/system/bta/le_audio/client.cc
index 19f7e409b88..9ed6c57810a 100644
--- a/system/bta/le_audio/client.cc
+++ b/system/bta/le_audio/client.cc
@@ -4734,7 +4734,7 @@ class LeAudioClientImpl : public LeAudioClient {
               group, le_audio::types::kLeAudioDirectionSource) &&
           (group->GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING);
       if (has_audio_source_configured) {
-        LOG_DEBUG(
+        LOG_INFO(
             "Audio source is already available in the current configuration "
             "context in %s. Not switching to %s right now.",
             ToString(configuration_context_type_).c_str(),
@@ -4759,9 +4759,9 @@ class LeAudioClientImpl : public LeAudioClient {
       LeAudioDeviceGroup* group, LeAudioContextType new_configuration_context,
       BidirectionalPair<AudioContexts> remote_contexts) {
     if (new_configuration_context != configuration_context_type_) {
-      LOG_DEBUG("Changing configuration context from %s to %s",
-                ToString(configuration_context_type_).c_str(),
-                ToString(new_configuration_context).c_str());
+      LOG_INFO("Checking whether to change configuration context from %s to %s",
+               ToString(configuration_context_type_).c_str(),
+               ToString(new_configuration_context).c_str());
 
       LeAudioLogHistory::Get()->AddLogHistory(
           kLogAfCallBt, active_group_id_, RawAddress::kEmpty,
@@ -4776,7 +4776,7 @@ class LeAudioClientImpl : public LeAudioClient {
     }
 
     if (group->GetTargetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) {
-      LOG_DEBUG(
+      LOG_INFO(
           "The %s configuration did not change. Updating the metadata to "
           "sink=%s, source=%s",
           ToString(configuration_context_type_).c_str(),
diff --git a/system/bta/le_audio/le_audio_utils.cc b/system/bta/le_audio/le_audio_utils.cc
index 50edab6972c..76698ee6999 100644
--- a/system/bta/le_audio/le_audio_utils.cc
+++ b/system/bta/le_audio/le_audio_utils.cc
@@ -211,9 +211,9 @@ AudioContexts GetAudioContextsFromSinkMetadata(
         "sink device. This may result in voice back channel malfunction.");
   }
 
-  LOG_DEBUG("Allowed contexts from sink metadata: %s (0x%08hx)",
-            bluetooth::common::ToString(all_track_contexts).c_str(),
-            all_track_contexts.value());
+  LOG_INFO("Allowed contexts from sink metadata: %s (0x%08hx)",
+           bluetooth::common::ToString(all_track_contexts).c_str(),
+           all_track_contexts.value());
   return all_track_contexts;
 }
 
-- 
GitLab