Loading flags/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ aconfig_declarations { package: "com.android.bluetooth.flags", srcs: [ "a2dp.aconfig", "asha.aconfig", "audio_routing.aconfig", "bta_dm.aconfig", "framework.aconfig", Loading flags/asha.aconfig 0 → 100644 +8 −0 Original line number Diff line number Diff line package: "com.android.bluetooth.flags" flag { name: "higher_l2cap_flush_threshold" namespace: "bluetooth" description: "Use a higher threshold for flushing L2CAP packets" bug: "315500864" } system/bta/hearing_aid/hearing_aid.cc +8 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #define LOG_TAG "bluetooth" #include <android_bluetooth_flags.h> #include <base/functional/bind.h> #include <base/functional/callback.h> #include <base/logging.h> Loading Loading @@ -1410,6 +1411,11 @@ class HearingAidImpl : public HearingAid { } } uint16_t l2cap_flush_threshold = 0; if (IS_FLAG_ENABLED(higher_l2cap_flush_threshold)) { l2cap_flush_threshold = 1; } // TODO: monural, binarual check // divide encoded data into packets, add header, send. Loading @@ -1430,7 +1436,7 @@ class HearingAidImpl : public HearingAid { uint16_t cid = GAP_ConnGetL2CAPCid(left->gap_handle); uint16_t packets_in_chans = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET); if (packets_in_chans) { if (packets_in_chans > l2cap_flush_threshold) { // Compare the two sides LE CoC credit value to confirm need to drop or // skip audio packet. if (NeedToDropPacket(left, right) && IsBelowDropFrequency(time_point)) { Loading Loading @@ -1464,7 +1470,7 @@ class HearingAidImpl : public HearingAid { uint16_t cid = GAP_ConnGetL2CAPCid(right->gap_handle); uint16_t packets_in_chans = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET); if (packets_in_chans) { if (packets_in_chans > l2cap_flush_threshold) { // Compare the two sides LE CoC credit value to confirm need to drop or // skip audio packet. if (NeedToDropPacket(right, left) && IsBelowDropFrequency(time_point)) { Loading Loading
flags/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ aconfig_declarations { package: "com.android.bluetooth.flags", srcs: [ "a2dp.aconfig", "asha.aconfig", "audio_routing.aconfig", "bta_dm.aconfig", "framework.aconfig", Loading
flags/asha.aconfig 0 → 100644 +8 −0 Original line number Diff line number Diff line package: "com.android.bluetooth.flags" flag { name: "higher_l2cap_flush_threshold" namespace: "bluetooth" description: "Use a higher threshold for flushing L2CAP packets" bug: "315500864" }
system/bta/hearing_aid/hearing_aid.cc +8 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #define LOG_TAG "bluetooth" #include <android_bluetooth_flags.h> #include <base/functional/bind.h> #include <base/functional/callback.h> #include <base/logging.h> Loading Loading @@ -1410,6 +1411,11 @@ class HearingAidImpl : public HearingAid { } } uint16_t l2cap_flush_threshold = 0; if (IS_FLAG_ENABLED(higher_l2cap_flush_threshold)) { l2cap_flush_threshold = 1; } // TODO: monural, binarual check // divide encoded data into packets, add header, send. Loading @@ -1430,7 +1436,7 @@ class HearingAidImpl : public HearingAid { uint16_t cid = GAP_ConnGetL2CAPCid(left->gap_handle); uint16_t packets_in_chans = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET); if (packets_in_chans) { if (packets_in_chans > l2cap_flush_threshold) { // Compare the two sides LE CoC credit value to confirm need to drop or // skip audio packet. if (NeedToDropPacket(left, right) && IsBelowDropFrequency(time_point)) { Loading Loading @@ -1464,7 +1470,7 @@ class HearingAidImpl : public HearingAid { uint16_t cid = GAP_ConnGetL2CAPCid(right->gap_handle); uint16_t packets_in_chans = L2CA_FlushChannel(cid, L2CAP_FLUSH_CHANS_GET); if (packets_in_chans) { if (packets_in_chans > l2cap_flush_threshold) { // Compare the two sides LE CoC credit value to confirm need to drop or // skip audio packet. if (NeedToDropPacket(right, left) && IsBelowDropFrequency(time_point)) { Loading