Bug 870304: Fix misssing icon when getting paired/connected list, r=echou

This commit is contained in:
Shawn Huang 2013-05-11 00:03:55 +08:00
parent 35f8a21258
commit 743e52c6ec

View File

@ -1945,6 +1945,27 @@ public:
v.get_ArrayOfBluetoothNamedValue().AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Path"), objectPath)
);
const InfallibleTArray<BluetoothNamedValue>& deviceProperties =
v.get_ArrayOfBluetoothNamedValue();
uint32_t length = deviceProperties.Length();
// It is possible that property Icon missed due to CoD of major
// class is TOY but service class is "Audio", we need to assign
// Icon as audio-card. This is for PTS test TC_AG_COD_BV_02_I.
// As HFP specification defined that
// service class is "Audio" can be considered as HFP AG.
if (!ContainsIcon(deviceProperties)) {
for (uint32_t p = 0; p < length; ++p) {
if (deviceProperties[p].name().EqualsLiteral("Class")) {
if (HasAudioService(deviceProperties[p].value().get_uint32_t())) {
v.get_ArrayOfBluetoothNamedValue()
.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("Icon"),
NS_LITERAL_STRING("audio-card")));
}
break;
}
}
}
if (mFilterFunc(v)) {
values.get_ArrayOfBluetoothNamedValue().AppendElement(