VRFS-1336 utils changes for this bug fix
This commit is contained in:
parent
a8a7ecea7d
commit
c6e660dac2
|
|
@ -641,9 +641,22 @@
|
|||
};
|
||||
|
||||
context.JK.getGoodAudioConfigs = function() {
|
||||
return context.jamClient.FTUEGetGoodAudioConfigurations();
|
||||
var result = context.jamClient.FTUEGetGoodAudioConfigurations();
|
||||
console.log("goodAudioConfigs=%o", result);
|
||||
return result;
|
||||
};
|
||||
|
||||
context.JK.getGoodConfigMap = function() {
|
||||
var goodConfigMap = [];
|
||||
var goodConfigs = context.JK.getGoodAudioConfigs();
|
||||
$.each(goodConfigs, function(index, profileKey) {
|
||||
var friendlyName = context.jamClient.FTUEGetConfigurationDevice(profileKey);
|
||||
goodConfigMap.push({key: profileKey, name: friendlyName});
|
||||
});
|
||||
|
||||
return goodConfigMap;
|
||||
}
|
||||
|
||||
context.JK.getBadAudioConfigs = function() {
|
||||
var badAudioConfigs = [];
|
||||
var allAudioConfigs = context.jamClient.FTUEGetAllAudioConfigurations();
|
||||
|
|
@ -655,9 +668,56 @@
|
|||
}
|
||||
}
|
||||
|
||||
console.log("badAudioConfigs=%o", badAudioConfigs);
|
||||
|
||||
return badAudioConfigs;
|
||||
};
|
||||
|
||||
context.JK.getBadConfigMap = function() {
|
||||
var badConfigMap = [];
|
||||
var badConfigs = context.JK.getBadAudioConfigs();
|
||||
$.each(badConfigs, function(index, profileKey) {
|
||||
var friendlyName = context.jamClient.FTUEGetConfigurationDevice(profileKey);
|
||||
badConfigMap.push({key: profileKey, name: friendlyName});
|
||||
});
|
||||
|
||||
return badConfigMap;
|
||||
}
|
||||
|
||||
context.JK.getFirstGoodDevice = function(preferredDeviceId) {
|
||||
var badConfigs = context.JK.getBadAudioConfigs();
|
||||
console.log("badConfigs=%o", badConfigs);
|
||||
|
||||
function getGoodDevice() {
|
||||
var goodConfigs = context.JK.getGoodAudioConfigs();
|
||||
console.log("goodConfigs = %o", goodConfigs);
|
||||
if (goodConfigs && goodConfigs.length > 0) {
|
||||
deviceId = goodConfigs[0];
|
||||
}
|
||||
else {
|
||||
deviceId = null;
|
||||
}
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
var deviceId = null;
|
||||
|
||||
if (preferredDeviceId) {
|
||||
|
||||
// if the preferred device is not in the list of invalid configs, use it
|
||||
if ($.inArray(preferredDeviceId, badConfigs) === -1) {
|
||||
console.log("preferred device is good");
|
||||
deviceId = preferredDeviceId;
|
||||
}
|
||||
else {
|
||||
deviceId = getGoodDevice();
|
||||
}
|
||||
}
|
||||
else {
|
||||
deviceId = getGoodDevice();
|
||||
}
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
/*
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
|
|
|
|||
Loading…
Reference in New Issue