mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 909684 - Add enabled and password checking. r=hsinyi
This commit is contained in:
parent
9ce2d5c452
commit
b16be28c24
@ -52,7 +52,8 @@ function testSetCallBarringOptionError(option) {
|
||||
'should not fire onsuccess for invaild call barring option: '
|
||||
+ JSON.stringify(option));
|
||||
};
|
||||
request.onerror = function() {
|
||||
request.onerror = function(event) {
|
||||
is(event.target.error.name, 'InvalidCallBarringOption', JSON.stringify(option));
|
||||
nextTest();
|
||||
};
|
||||
}
|
||||
|
@ -1086,7 +1086,7 @@ RILContentHelper.prototype = {
|
||||
let requestId = this.getRequestId(request);
|
||||
|
||||
if (DEBUG) debug("setCallBarringOption: " + JSON.stringify(option));
|
||||
if (!this._isValidCallBarringOption(option)) {
|
||||
if (!this._isValidCallBarringOption(option, true)) {
|
||||
this.dispatchFireRequestError(requestId, "InvalidCallBarringOption");
|
||||
return request;
|
||||
}
|
||||
@ -2072,10 +2072,20 @@ RILContentHelper.prototype = {
|
||||
/**
|
||||
* Helper for guarding us against invalid option for call barring.
|
||||
*/
|
||||
_isValidCallBarringOption: function _isValidCallBarringOption(option) {
|
||||
return (option
|
||||
&& option.serviceClass != null
|
||||
&& this._isValidCallBarringProgram(option.program));
|
||||
_isValidCallBarringOption:
|
||||
function _isValidCallBarringOption(option, usedForSetting) {
|
||||
if (!option ||
|
||||
option.serviceClass == null ||
|
||||
!this._isValidCallBarringProgram(option.program)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// For setting callbarring option, |enabled| and |password| are required.
|
||||
if (usedForSetting && (option.enabled == null || option.password == null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user