Bug 1101397 - Clear up unnecessary checking of "undefined" DOMString attribute. r=echen

This commit is contained in:
Bevis Tseng 2014-12-22 15:53:25 +08:00
parent e97d5b2d88
commit 975ef5d363
3 changed files with 8 additions and 65 deletions

View File

@ -114,21 +114,6 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
// =================== RIL ====================
(function RILSettingsToPrefs() {
let strPrefs = ['ril.mms.mmsc', 'ril.mms.mmsproxy'];
strPrefs.forEach(function(key) {
SettingsListener.observe(key, "", function(value) {
Services.prefs.setCharPref(key, value);
});
});
['ril.mms.mmsport'].forEach(function(key) {
SettingsListener.observe(key, null, function(value) {
if (value != null) {
Services.prefs.setIntPref(key, value);
}
});
});
// DSDS default service IDs
['mms', 'sms', 'telephony', 'voicemail'].forEach(function(key) {
SettingsListener.observe('ril.' + key + '.defaultServiceId', 0,

View File

@ -225,11 +225,8 @@ MmsConnection.prototype = {
mmsPort: -1,
setApnSetting: function(network) {
// Workaround an xpconnect issue with undefined string objects. See bug 808220.
this.mmsc =
(network.mmsc === "undefined") ? undefined : network.mmsc;
this.mmsProxy =
(network.mmsProxy === "undefined") ? undefined : network.mmsProxy;
this.mmsc = network.mmsc;
this.mmsProxy = network.mmsProxy;
this.mmsPort = network.mmsPort;
},
@ -366,12 +363,6 @@ MmsConnection.prototype = {
return null;
}
// Workaround an xpconnect issue with undefined string objects.
// See bug 808220
if (number === undefined || number === "undefined") {
return null;
}
return number;
},
@ -385,15 +376,7 @@ MmsConnection.prototype = {
return null;
}
let iccId = iccInfo.iccid;
// Workaround an xpconnect issue with undefined string objects.
// See bug 808220
if (iccId === undefined || iccId === "undefined") {
return null;
}
return iccId;
return iccInfo.iccid;
},
/**

View File

@ -3147,16 +3147,7 @@ RILNetworkInterface.prototype = {
throw Cr.NS_ERROR_UNEXPECTED;
}
let mmsc = this.apnSetting.mmsc;
if (!mmsc) {
try {
mmsc = Services.prefs.getCharPref("ril.mms.mmsc");
} catch (e) {
mmsc = "";
}
}
return mmsc;
return this.apnSetting.mmsc || "";
},
get mmsProxy() {
@ -3165,16 +3156,7 @@ RILNetworkInterface.prototype = {
throw Cr.NS_ERROR_UNEXPECTED;
}
let proxy = this.apnSetting.mmsproxy;
if (!proxy) {
try {
proxy = Services.prefs.getCharPref("ril.mms.mmsproxy");
} catch (e) {
proxy = "";
}
}
return proxy;
return this.apnSetting.mmsproxy || "";
},
get mmsPort() {
@ -3183,16 +3165,9 @@ RILNetworkInterface.prototype = {
throw Cr.NS_ERROR_UNEXPECTED;
}
let port = this.apnSetting.mmsport;
if (!port) {
try {
port = Services.prefs.getIntPref("ril.mms.mmsport");
} catch (e) {
port = -1;
}
}
return port;
// Note: Port 0 is reserved, so we treat it as invalid as well.
// See http://www.iana.org/assignments/port-numbers
return this.apnSetting.mmsport || -1;
},
// Helpers