OSDN Git Service

BTA_AV: Simplify flush timeout parameter
authorHansong Zhang <hsz@google.com>
Wed, 30 Sep 2020 23:24:09 +0000 (16:24 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 1 Oct 2020 06:02:15 +0000 (23:02 -0700)
Always 0.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ibd66605d65a421386b2b48766808b5be3f3c8e4e

bta/av/bta_av_aact.cc
bta/av/bta_av_act.cc
bta/av/bta_av_cfg.cc
bta/av/bta_av_main.cc
bta/include/bta_av_api.h

index 9b3de08..c640389 100644 (file)
@@ -2164,7 +2164,6 @@ void bta_av_data_path(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {
 void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
   bool initiator = false;
   bool suspend = false;
-  uint16_t flush_to;
   uint8_t new_role = p_scb->role;
   BT_HDR hdr;
   uint8_t cur_role;
@@ -2273,11 +2272,9 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      * to be changed
      */
     p_scb->co_started = bta_av_cb.audio_open_cnt;
-    flush_to = p_bta_av_cfg->p_audio_flush_to[p_scb->co_started - 1];
   } else {
-    flush_to = 0;
   }
-  L2CA_SetFlushTimeout(p_scb->PeerAddress(), flush_to);
+  L2CA_SetFlushTimeout(p_scb->PeerAddress(), 0);
 
   /* clear the congestion flag */
   p_scb->cong = false;
@@ -2877,9 +2874,7 @@ void bta_av_chk_2nd_start(tBTA_AV_SCB* p_scb,
           // May need to update the flush timeout of this already started stream
           if (p_scbi->co_started != bta_av_cb.audio_open_cnt) {
             p_scbi->co_started = bta_av_cb.audio_open_cnt;
-            L2CA_SetFlushTimeout(
-                p_scbi->PeerAddress(),
-                p_bta_av_cfg->p_audio_flush_to[p_scbi->co_started - 1]);
+            L2CA_SetFlushTimeout(p_scbi->PeerAddress(), 0);
           }
         }
       }
index 8ebc76b..11b66eb 100644 (file)
@@ -1280,9 +1280,7 @@ void bta_av_conn_chg(tBTA_AV_DATA* p_data) {
            */
           if (p_scbi->co_started != bta_av_cb.audio_open_cnt) {
             p_scbi->co_started = bta_av_cb.audio_open_cnt;
-            L2CA_SetFlushTimeout(
-                p_scbi->PeerAddress(),
-                p_bta_av_cfg->p_audio_flush_to[p_scbi->co_started - 1]);
+            L2CA_SetFlushTimeout(p_scbi->PeerAddress(), 0);
           }
         }
       }
index 1842af8..f91586b 100644 (file)
@@ -63,15 +63,6 @@ const uint32_t bta_av_meta_caps_co_ids[] = {AVRC_CO_METADATA, AVRC_CO_BROADCOM};
  *     3. GetCapabilities supported event_ids list
  *     4. GetCapabilities supported event_ids count
 */
-/* Flushing partial avdtp packets can cause some headsets to disconnect the link
-   if receiving partial a2dp frames */
-const uint16_t bta_av_audio_flush_to[] = {
-    0, /* 1 stream */
-    0, /* 2 streams */
-    0, /* 3 streams */
-    0, /* 4 streams */
-    0  /* 5 streams */
-};     /* AVDTP audio transport channel flush timeout */
 
 /* Note: Android doesnt support AVRC_SUPF_TG_GROUP_NAVI  */
 /* Note: if AVRC_SUPF_TG_GROUP_NAVI is set, bta_av_cfg.avrc_group should be true
@@ -129,8 +120,6 @@ const tBTA_AV_CFG bta_av_cfg = {
     BTA_AV_RC_COMP_ID,     /* AVRCP Company ID */
     BTA_AV_RC_SUPF_CT,     /* AVRCP controller categories */
     BTA_AV_RC_SUPF_TG,     /* AVRCP target categories */
-    bta_av_audio_flush_to, /* AVDTP audio transport channel flush
-                              timeout */
     6,                     /* AVDTP audio channel max data queue size */
     false, /* true, to accept AVRC 1.3 group nevigation command */
     2,     /* company id count in p_meta_co_ids */
@@ -151,7 +140,6 @@ const tBTA_AV_CFG bta_avk_cfg = {
     AVRC_CO_METADATA,      /* AVRCP Company ID */
     BTA_AVK_RC_SUPF_CT,    /* AVRCP controller categories */
     BTA_AVK_RC_SUPF_TG,    /* AVRCP target categories */
-    bta_av_audio_flush_to, /* AVDTP audio transport channel flush timeout */
     6,                     /* AVDTP audio channel max data queue size */
     false, /* true, to accept AVRC 1.3 group nevigation command */
     2,     /* company id count in p_meta_co_ids */
@@ -171,7 +159,6 @@ const tBTA_AV_CFG bta_av_cfg_compatibility = {
     BTA_AV_RC_COMP_ID,     /* AVRCP Company ID */
     BTA_AV_RC_SUPF_CT,     /* AVRCP controller categories */
     AVRC_SUPF_TG_CAT1,     /* Only support CAT1 for AVRCP1.3 */
-    bta_av_audio_flush_to, /* AVDTP audio transport channel flush timeout */
     6,                     /* AVDTP audio channel max data queue size */
     false, /* true, to accept AVRC 1.3 group nevigation command */
     2,     /* company id count in p_meta_co_ids */
index 577eee4..b19ea16 100644 (file)
@@ -757,9 +757,7 @@ bool bta_av_chk_start(tBTA_AV_SCB* p_scb) {
         // May need to update the flush timeout of this already started stream
         if (p_scbi->co_started != bta_av_cb.audio_open_cnt) {
           p_scbi->co_started = bta_av_cb.audio_open_cnt;
-          L2CA_SetFlushTimeout(
-              p_scbi->PeerAddress(),
-              p_bta_av_cfg->p_audio_flush_to[p_scbi->co_started - 1]);
+          L2CA_SetFlushTimeout(p_scbi->PeerAddress(), 0);
         }
       }
     }
index 1066211..420dc80 100644 (file)
@@ -378,8 +378,6 @@ typedef struct {
   uint32_t company_id;  /* AVRCP Company ID */
   uint16_t avrc_ct_cat; /* AVRCP controller categories */
   uint16_t avrc_tg_cat; /* AVRCP target categories */
-  const uint16_t*
-      p_audio_flush_to;    /* AVDTP audio transport channel flush timeout */
   uint16_t audio_mqs;      /* AVDTP audio channel max data queue size */
   bool avrc_group;     /* true, to accept AVRC 1.3 group nevigation command */
   uint8_t num_co_ids;  /* company id count in p_meta_co_ids */