Moving navigator.connection to navigator.device.connection

Android 2.2 introduces the navigation.connection interface but it does not work properly in WebView.  So in order to get the proper connection information we had to implement our own connection interface which is accessible at navigator.network.connection.
This commit is contained in:
macdonst 2011-05-18 03:02:45 +08:00
parent 6618015151
commit 2177cd0a39

View File

@ -105,13 +105,8 @@ PhoneGap.addConstructor(function() {
if (typeof navigator.network === "undefined") {
navigator.network = new Network();
}
// No native connection object for Android 2.1 or earlier, so use PhoneGap connection
if (typeof navigator.connection === "undefined") {
navigator.connection = new Connection();
if (typeof navigator.network.connection === "undefined") {
navigator.network.connection = new Connection();
}
// If Android 2.2+ then fire the connection ready event
else {
PhoneGap.onPhoneGapConnectionReady.fire();
}
});
};