diff --git a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp index d7256e951632..20d20f593516 100644 --- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp +++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp @@ -205,7 +205,22 @@ ClassToIcon(uint32_t aClass, nsAString& aRetIcon) } break; } + + if (aRetIcon.IsEmpty()) { + if (HAS_AUDIO(aClass)) { + /** + * Property 'Icon' may be missed due to CoD of major class is TOY(0x08). + * But we need to assign Icon as audio-card if service class is 'Audio'. + * This is for PTS test case TC_AG_COD_BV_02_I. As HFP specification + * defines that service class is 'Audio' can be considered as HFP HF. + */ + aRetIcon.AssignLiteral("audio-card"); + } else { + BT_LOGR("No icon to match class: %x", aClass); + } + } } + static ControlPlayStatus PlayStatusStringToControlPlayStatus(const nsAString& aPlayStatus) {