merge b2g-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-11-25 12:55:29 +01:00
commit 418515b044
22 changed files with 149 additions and 93 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0870da2b5a71b6f48be8222e3f056498fea66e10"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0870da2b5a71b6f48be8222e3f056498fea66e10"/>
@ -122,7 +122,7 @@
<!-- Flame specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="e8a318f7690092e639ba88891606f4183e846d3f"/>
<project name="device/qcom/common" path="device/qcom/common" revision="878804e0becfe5635bb8ccbf2671333d546c6fb6"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="b04c1a7d96f01a743f23a544870cd5be2c8d172e"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="47f828c8a9a6673bbe05ac8868634d04a1798305"/>
<project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="49417cfc622074daa3c76b345a199f6731375800"/>
<project name="kernel_lk" path="bootable/bootloader/lk" remote="b2g" revision="6f00133ac0f47e90027bd7e263a16b405bfac503"/>
<project name="platform_bootable_recovery" path="bootable/recovery" remote="b2g" revision="e81502511cda303c803e63f049574634bc96f9f2"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "8879d60a0cc3d69720c7335370d29d5a44523d0c",
"revision": "487b237115841c62d1ca385fce8261dedeec2cda",
"repo_path": "integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0870da2b5a71b6f48be8222e3f056498fea66e10"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e5d666d6f62480ced56c6d9352f5e12befb5a862"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="824a61cccec4c69be9a86ad5cb629a1f61fa142f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -305,7 +305,7 @@ MmsConnection.prototype = {
this.hostsToRoute = [];
this.networkInterface = null;
this.radioInterface.deactivateDataCallByType("mms");
this.radioInterface.deactivateDataCallByType(Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS);
};
let promises =
@ -441,7 +441,7 @@ MmsConnection.prototype = {
// Bug 1059110: Ensure all the initialization are done before setup data call.
if (DEBUG) debug("acquire: buffer the MMS request and setup the MMS data call.");
this.radioInterface.setupDataCallByType("mms");
this.radioInterface.setupDataCallByType(Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS);
return false;
}

View File

@ -345,7 +345,8 @@ GonkGPSGeolocationProvider::GetDataConnectionState()
}
int32_t state;
mRadioInterface->GetDataCallStateByType(NS_LITERAL_STRING("supl"), &state);
mRadioInterface->GetDataCallStateByType(
nsINetworkInterface::NETWORK_TYPE_MOBILE_SUPL, &state);
return state;
}
@ -436,7 +437,7 @@ GonkGPSGeolocationProvider::RequestDataConnection()
// We just get supl APN and make AGPS data connection state updated.
RequestSettingValue("ril.supl.apn");
} else {
mRadioInterface->SetupDataCallByType(NS_LITERAL_STRING("supl"));
mRadioInterface->SetupDataCallByType(nsINetworkInterface::NETWORK_TYPE_MOBILE_SUPL);
}
}
@ -449,7 +450,7 @@ GonkGPSGeolocationProvider::ReleaseDataConnection()
return;
}
mRadioInterface->DeactivateDataCallByType(NS_LITERAL_STRING("supl"));
mRadioInterface->DeactivateDataCallByType(nsINetworkInterface::NETWORK_TYPE_MOBILE_SUPL);
}
void

View File

@ -888,7 +888,7 @@ NetworkManager.prototype = {
let data = connection && connection.data;
if (data && data.state === "registered") {
this.dunRetryTimes = 0;
ril.setupDataCallByType("dun");
ril.setupDataCallByType(Ci.nsINetworkInterface.NETWORK_TYPE_DUN);
this.dunConnectTimer.cancel();
this.dunConnectTimer.
initWithCallback(this.onDunConnectTimerTimeout.bind(this),
@ -931,7 +931,7 @@ NetworkManager.prototype = {
if (dun && (dun.state == Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED)) {
this.mRil.getRadioInterface(this._dataDefaultServiceId)
.deactivateDataCallByType("dun");
.deactivateDataCallByType(Ci.nsINetworkInterface.NETWORK_TYPE_DUN);
}
return;
}

View File

@ -89,6 +89,14 @@ const HW_DEFAULT_CLIENT_ID = 0;
const INT32_MAX = 2147483647;
const NETWORK_TYPE_UNKNOWN = Ci.nsINetworkInterface.NETWORK_TYPE_UNKNOWN;
const NETWORK_TYPE_WIFI = Ci.nsINetworkInterface.NETWORK_TYPE_WIFI;
const NETWORK_TYPE_MOBILE = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE;
const NETWORK_TYPE_MOBILE_MMS = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS;
const NETWORK_TYPE_MOBILE_SUPL = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL;
const NETWORK_TYPE_MOBILE_IMS = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_IMS;
const NETWORK_TYPE_MOBILE_DUN = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_DUN;
const RIL_IPC_ICCMANAGER_MSG_NAMES = [
"RIL:GetRilContext",
"RIL:SendStkResponse",
@ -1008,17 +1016,17 @@ DataConnectionHandler.prototype = {
_convertApnType: function(apnType) {
switch(apnType) {
case "default":
return Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE;
return NETWORK_TYPE_MOBILE;
case "mms":
return Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS;
return NETWORK_TYPE_MOBILE_MMS;
case "supl":
return Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL;
return NETWORK_TYPE_MOBILE_SUPL;
case "ims":
return Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_IMS;
return NETWORK_TYPE_MOBILE_IMS;
case "dun":
return Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_DUN;
return NETWORK_TYPE_MOBILE_DUN;
default:
return Ci.nsINetworkInterface.NETWORK_TYPE_UNKNOWN;
return NETWORK_TYPE_UNKNOWN;
}
},
@ -1094,7 +1102,7 @@ DataConnectionHandler.prototype = {
for (let i = 0; i < inputApnSetting.types.length; i++) {
let apnType = inputApnSetting.types[i];
let networkType = this._convertApnType(apnType);
if (networkType === Ci.nsINetworkInterface.NETWORK_TYPE_UNKNOWN) {
if (networkType === NETWORK_TYPE_UNKNOWN) {
if (DEBUG) this.debug("Invalid apn type: " + apnType);
continue;
}
@ -1121,7 +1129,7 @@ DataConnectionHandler.prototype = {
inputApnSetting,
dataCall);
gNetworkManager.registerNetworkInterface(networkInterface);
this.dataNetworkInterfaces.set(apnType, networkInterface);
this.dataNetworkInterfaces.set(networkType, networkInterface);
} catch (e) {
if (DEBUG) {
this.debug("Error setting up RILNetworkInterface for type " +
@ -1174,7 +1182,7 @@ DataConnectionHandler.prototype = {
},
updateRILNetworkInterface: function() {
let networkInterface = this.dataNetworkInterfaces.get("default");
let networkInterface = this.dataNetworkInterfaces.get(NETWORK_TYPE_MOBILE);
if (!networkInterface) {
if (DEBUG) {
this.debug("No network interface for default data.");
@ -1223,7 +1231,7 @@ DataConnectionHandler.prototype = {
}
let wifi_active = false;
if (gNetworkManager.active &&
gNetworkManager.active.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
gNetworkManager.active.type == NETWORK_TYPE_WIFI) {
wifi_active = true;
}
@ -1283,22 +1291,45 @@ DataConnectionHandler.prototype = {
networkInterface.connect();
},
getDataCallStateByType: function(apnType) {
let networkInterface = this.dataNetworkInterfaces.get(apnType);
_isMobileNetworkType: function(networkType) {
if (networkType === NETWORK_TYPE_MOBILE ||
networkType === NETWORK_TYPE_MOBILE_MMS ||
networkType === NETWORK_TYPE_MOBILE_SUPL ||
networkType === NETWORK_TYPE_MOBILE_IMS ||
networkType === NETWORK_TYPE_MOBILE_DUN) {
return true;
}
return false;
},
getDataCallStateByType: function(networkType) {
if (!this._isMobileNetworkType(networkType)) {
if (DEBUG) this.debug(networkType + " is not a mobile network type!");
throw Cr.NS_ERROR_INVALID_ARG;
}
let networkInterface = this.dataNetworkInterfaces.get(networkType);
if (!networkInterface) {
return RIL.GECKO_NETWORK_STATE_UNKNOWN;
}
return networkInterface.state;
},
setupDataCallByType: function(apnType) {
setupDataCallByType: function(networkType) {
if (DEBUG) {
this.debug("setupDataCallByType: " + apnType);
this.debug("setupDataCallByType: " + networkType);
}
let networkInterface = this.dataNetworkInterfaces.get(apnType);
if (!this._isMobileNetworkType(networkType)) {
if (DEBUG) this.debug(networkType + " is not a mobile network type!");
throw Cr.NS_ERROR_INVALID_ARG;
}
let networkInterface = this.dataNetworkInterfaces.get(networkType);
if (!networkInterface) {
if (DEBUG) {
this.debug("No network interface for type: " + apnType);
this.debug("No network interface for type: " + networkType);
}
return;
}
@ -1306,14 +1337,20 @@ DataConnectionHandler.prototype = {
networkInterface.connect();
},
deactivateDataCallByType: function(apnType) {
deactivateDataCallByType: function(networkType) {
if (DEBUG) {
this.debug("deactivateDataCallByType: " + apnType);
this.debug("deactivateDataCallByType: " + networkType);
}
let networkInterface = this.dataNetworkInterfaces.get(apnType);
if (!this._isMobileNetworkType(networkType)) {
if (DEBUG) this.debug(networkType + " is not a mobile network type!");
throw Cr.NS_ERROR_INVALID_ARG;
}
let networkInterface = this.dataNetworkInterfaces.get(networkType);
if (!networkInterface) {
if (DEBUG) {
this.debug("No network interface for type: " + apnType);
this.debug("No network interface for type: " + networkType);
}
return;
}
@ -1346,7 +1383,7 @@ DataConnectionHandler.prototype = {
*/
handleDataCallError: function(message) {
// Notify data call error only for data APN
let networkInterface = this.dataNetworkInterfaces.get("default");
let networkInterface = this.dataNetworkInterfaces.get(NETWORK_TYPE_MOBILE);
if (networkInterface && networkInterface.enabled) {
let dataCall = networkInterface.dataCall;
// If there is a cid, compare cid; otherwise it is probably an error on
@ -2893,8 +2930,8 @@ RadioInterface.prototype = {
}
// SNTP can only update when we have mobile or Wifi connections.
if (network.type != Ci.nsINetworkInterface.NETWORK_TYPE_WIFI &&
network.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) {
if (network.type != NETWORK_TYPE_WIFI &&
network.type != NETWORK_TYPE_MOBILE) {
return;
}
@ -3721,22 +3758,22 @@ RadioInterface.prototype = {
// TODO: Bug 928861 - B2G NetworkManager: Provide a more generic function
// for connecting
setupDataCallByType: function(apntype) {
setupDataCallByType: function(networkType) {
let connHandler = gDataConnectionManager.getConnectionHandler(this.clientId);
connHandler.setupDataCallByType(apntype);
connHandler.setupDataCallByType(networkType);
},
// TODO: Bug 928861 - B2G NetworkManager: Provide a more generic function
// for connecting
deactivateDataCallByType: function(apntype) {
deactivateDataCallByType: function(networkType) {
let connHandler = gDataConnectionManager.getConnectionHandler(this.clientId);
connHandler.deactivateDataCallByType(apntype);
connHandler.deactivateDataCallByType(networkType);
},
// TODO: Bug 904514 - [meta] NetworkManager enhancement
getDataCallStateByType: function(apntype) {
getDataCallStateByType: function(networkType) {
let connHandler = gDataConnectionManager.getConnectionHandler(this.clientId);
return connHandler.getDataCallStateByType(apntype);
return connHandler.getDataCallStateByType(networkType);
},
sendWorkerMessage: function(rilMessageType, message, callback) {
@ -4271,7 +4308,7 @@ RILNetworkInterface.prototype = {
},
get mmsc() {
if (this.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) {
if (this.type != NETWORK_TYPE_MOBILE_MMS) {
if (DEBUG) this.debug("Error! Only MMS network can get MMSC.");
throw Cr.NS_ERROR_UNEXPECTED;
}
@ -4289,7 +4326,7 @@ RILNetworkInterface.prototype = {
},
get mmsProxy() {
if (this.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) {
if (this.type != NETWORK_TYPE_MOBILE_MMS) {
if (DEBUG) this.debug("Error! Only MMS network can get MMS proxy.");
throw Cr.NS_ERROR_UNEXPECTED;
}
@ -4307,7 +4344,7 @@ RILNetworkInterface.prototype = {
},
get mmsPort() {
if (this.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) {
if (this.type != NETWORK_TYPE_MOBILE_MMS) {
if (DEBUG) this.debug("Error! Only MMS network can get MMS port.");
throw Cr.NS_ERROR_UNEXPECTED;
}

View File

@ -40,17 +40,21 @@ interface nsIRilSendWorkerMessageCallback : nsISupports
boolean handleResponse(in jsval response);
};
[scriptable, uuid(622e8809-1a89-45f7-9b35-7e49b5aaa69f)]
[scriptable, uuid(dc874da3-5f74-49d4-8e1c-a58ed9a1c0ef)]
interface nsIRadioInterface : nsISupports
{
readonly attribute nsIRilContext rilContext;
/**
* PDP APIs
*
* @param networkType
* Mobile network type, that is, nsINetworkInterface.NETWORK_TYPE_MOBILE
* or one of the nsINetworkInterface.NETWORK_TYPE_MOBILE_* values.
*/
void setupDataCallByType(in DOMString apntype);
void deactivateDataCallByType(in DOMString apntype);
long getDataCallStateByType(in DOMString apntype);
void setupDataCallByType(in long networkType);
void deactivateDataCallByType(in long networkType);
long getDataCallStateByType(in long networkType);
void updateRILNetworkInterface();

View File

@ -9,6 +9,20 @@ const SETTINGS_KEY_DATA_APN_SETTINGS = "ril.data.apnSettings";
const TOPIC_CONNECTION_STATE_CHANGED = "network-connection-state-changed";
const TOPIC_NETWORK_ACTIVE_CHANGED = "network-active-changed";
const NETWORK_TYPE_MOBILE = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE;
const NETWORK_TYPE_MOBILE_MMS = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS;
const NETWORK_TYPE_MOBILE_SUPL = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL;
const NETWORK_TYPE_MOBILE_IMS = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_IMS;
const NETWORK_TYPE_MOBILE_DUN = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_DUN;
const networkTypes = [
NETWORK_TYPE_MOBILE,
NETWORK_TYPE_MOBILE_MMS,
NETWORK_TYPE_MOBILE_SUPL,
NETWORK_TYPE_MOBILE_IMS,
NETWORK_TYPE_MOBILE_DUN
];
let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
let ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
@ -107,14 +121,6 @@ function waitForObserverEvent(aTopic) {
return deferred.promise;
}
let mobileTypeMapping = {
"default": Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE,
"mms": Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS,
"supl": Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL,
"ims": Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_IMS,
"dun": Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_DUN
};
/**
* Set the default data connection enabling state, wait for
* "network-connection-state-changed" event and verify state.
@ -132,8 +138,8 @@ function setDataEnabledAndWait(aEnabled) {
.then(function(aSubject) {
ok(aSubject instanceof Ci.nsIRilNetworkInterface,
"subject should be an instance of nsIRILNetworkInterface");
is(aSubject.type, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE,
"subject.type should be " + Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE);
is(aSubject.type, NETWORK_TYPE_MOBILE,
"subject.type should be " + NETWORK_TYPE_MOBILE);
is(aSubject.state,
aEnabled ? Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED
: Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED,
@ -150,26 +156,25 @@ function setDataEnabledAndWait(aEnabled) {
*
* Fulfill params: (none)
*
* @param aType
* The string of the type of data connection to setup.
* @param aNetworkType
* The mobile network type to setup.
*
* @return A deferred promise.
*/
function setupDataCallAndWait(aType) {
log("setupDataCallAndWait: " + aType);
function setupDataCallAndWait(aNetworkType) {
log("setupDataCallAndWait: " + aNetworkType);
let promises = [];
promises.push(waitForObserverEvent(TOPIC_CONNECTION_STATE_CHANGED)
.then(function(aSubject) {
let networkType = mobileTypeMapping[aType];
ok(aSubject instanceof Ci.nsIRilNetworkInterface,
"subject should be an instance of nsIRILNetworkInterface");
is(aSubject.type, networkType,
"subject.type should be " + networkType);
is(aSubject.type, aNetworkType,
"subject.type should be " + aNetworkType);
is(aSubject.state, Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED,
"subject.state should be CONNECTED");
}));
promises.push(radioInterface.setupDataCallByType(aType));
promises.push(radioInterface.setupDataCallByType(aNetworkType));
return Promise.all(promises);
}
@ -180,26 +185,25 @@ function setupDataCallAndWait(aType) {
*
* Fulfill params: (none)
*
* @param aType
* The string of the type of data connection to deactivate.
* @param aNetworkType
* The mobile network type to deactivate.
*
* @return A deferred promise.
*/
function deactivateDataCallAndWait(aType) {
log("deactivateDataCallAndWait: " + aType);
function deactivateDataCallAndWait(aNetworkType) {
log("deactivateDataCallAndWait: " + aNetworkType);
let promises = [];
promises.push(waitForObserverEvent(TOPIC_CONNECTION_STATE_CHANGED)
.then(function(aSubject) {
let networkType = mobileTypeMapping[aType];
ok(aSubject instanceof Ci.nsIRilNetworkInterface,
"subject should be an instance of nsIRILNetworkInterface");
is(aSubject.type, networkType,
"subject.type should be " + networkType);
is(aSubject.type, aNetworkType,
"subject.type should be " + aNetworkType);
is(aSubject.state, Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED,
"subject.state should be DISCONNECTED");
}));
promises.push(radioInterface.deactivateDataCallByType(aType));
promises.push(radioInterface.deactivateDataCallByType(aNetworkType));
return Promise.all(promises);
}

View File

@ -53,10 +53,10 @@ function testNonDefaultDataConnection() {
currentApn = value;
})
.then(setEmulatorAPN)
.then(() => doTestNonDefaultDataConnection("mms"))
.then(() => doTestNonDefaultDataConnection("supl"))
.then(() => doTestNonDefaultDataConnection("ims"))
.then(() => doTestNonDefaultDataConnection("dun"))
.then(() => doTestNonDefaultDataConnection(NETWORK_TYPE_MOBILE_MMS))
.then(() => doTestNonDefaultDataConnection(NETWORK_TYPE_MOBILE_SUPL))
.then(() => doTestNonDefaultDataConnection(NETWORK_TYPE_MOBILE_IMS))
.then(() => doTestNonDefaultDataConnection(NETWORK_TYPE_MOBILE_DUN))
// Restore APN settings
.then(() => setSettings(SETTINGS_KEY_DATA_APN_SETTINGS, currentApn));
}

View File

@ -44,10 +44,9 @@ function testSetupConcurrentDataCalls() {
log("= testSetupConcurrentDataCalls =");
let promise = Promise.resolve();
let types = Object.keys(mobileTypeMapping);
// Skip default mobile type.
for (let i = 1; i < MAX_DATA_CONTEXTS; i++) {
let type = types[i];
let type = networkTypes[i];
promise = promise.then(() => setupDataCallAndWait(type));
}
return promise;
@ -57,10 +56,9 @@ function testDeactivateConcurrentDataCalls() {
log("= testDeactivateConcurrentDataCalls =");
let promise = Promise.resolve();
let types = Object.keys(mobileTypeMapping);
// Skip default mobile type.
for (let i = 1; i < MAX_DATA_CONTEXTS; i++) {
let type = types[i];
let type = networkTypes[i];
promise = promise.then(() => deactivateDataCallAndWait(type));
}
return promise;

View File

@ -33,7 +33,7 @@ function testActiveNetworkChangedBySwitchingDataCall(aDataCallEnabled) {
"subject should be an instance of nsINetworkInterface");
ok(subject instanceof Ci.nsIRilNetworkInterface,
"subject should be an instance of nsIRILNetworkInterface");
is(subject.type, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE,
is(subject.type, NETWORK_TYPE_MOBILE,
"subject.type should be NETWORK_TYPE_MOBILE");
}

View File

@ -69,7 +69,13 @@ public:
virtual int64_t getmtime(const String16& name) {return 0;}
virtual int32_t duplicate(const String16& srcKey, int32_t srcUid, const String16& destKey, int32_t destUid) {return 0;}
virtual int32_t clear_uid(int64_t uid) {return 0;}
#if ANDROID_VERSION == 18
#if ANDROID_VERSION >= 21
virtual int32_t generate(const String16& name, int32_t uid, int32_t keyType, int32_t keySize, int32_t flags, Vector<sp<KeystoreArg> >* args) {return 0;}
virtual int32_t is_hardware_backed(const String16& keyType) {return 0;}
virtual int32_t reset_uid(int32_t uid) {return 0;}
virtual int32_t sync_uid(int32_t sourceUid, int32_t targetUid) {return 0;}
virtual int32_t password_uid(const String16& password, int32_t uid) {return 0;}
#elif ANDROID_VERSION == 18
virtual int32_t generate(const String16& name, int uid, int32_t flags) {return 0;}
virtual int32_t is_hardware_backed() {return 0;}
#else
@ -156,7 +162,13 @@ public:
int64_t getmtime(const String16& name) {return ::UNDEFINED_ACTION;}
int32_t duplicate(const String16& srcKey, int32_t srcUid, const String16& destKey, int32_t destUid) {return ::UNDEFINED_ACTION;}
int32_t clear_uid(int64_t uid) {return ::UNDEFINED_ACTION;}
#if ANDROID_VERSION == 18
#if ANDROID_VERSION >= 21
virtual int32_t generate(const String16& name, int32_t uid, int32_t keyType, int32_t keySize, int32_t flags, Vector<sp<KeystoreArg> >* args) {return ::UNDEFINED_ACTION;}
virtual int32_t is_hardware_backed(const String16& keyType) {return ::UNDEFINED_ACTION;}
virtual int32_t reset_uid(int32_t uid) {return ::UNDEFINED_ACTION;;}
virtual int32_t sync_uid(int32_t sourceUid, int32_t targetUid) {return ::UNDEFINED_ACTION;}
virtual int32_t password_uid(const String16& password, int32_t uid) {return ::UNDEFINED_ACTION;}
#elif ANDROID_VERSION == 18
virtual int32_t generate(const String16& name, int uid, int32_t flags) {return ::UNDEFINED_ACTION;}
virtual int32_t is_hardware_backed() {return ::UNDEFINED_ACTION;}
#else