cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [3/4] cordova-plugin-network-information git commit: CB-8384 Fixes the way we detect online status on Windows
Date Fri, 30 Jan 2015 19:49:22 GMT
CB-8384 Fixes the way we detect online status on Windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/commit/d8a71475
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/d8a71475
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/d8a71475

Branch: refs/heads/master
Commit: d8a714757fae0ac615224a7a0daabaa88c8e2581
Parents: c828153
Author: sgrebnov <v-segreb@microsoft.com>
Authored: Fri Jan 30 15:37:16 2015 +0300
Committer: sgrebnov <v-segreb@microsoft.com>
Committed: Fri Jan 30 15:37:16 2015 +0300

----------------------------------------------------------------------
 src/windows/NetworkInfoProxy.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/d8a71475/src/windows/NetworkInfoProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/NetworkInfoProxy.js b/src/windows/NetworkInfoProxy.js
index 1f11aad..a536db2 100644
--- a/src/windows/NetworkInfoProxy.js
+++ b/src/windows/NetworkInfoProxy.js
@@ -43,11 +43,13 @@ module.exports = {
             var conLevel = profile.getNetworkConnectivityLevel();
             var interfaceType = profile.networkAdapter.ianaInterfaceType;
 
-            if (conLevel == Windows.Networking.Connectivity.NetworkConnectivityLevel.none)
{
+            // since we use this to detect whether we are online or offline we do check agains
InternetAccess
+            // localAccess (airplane mode as an example) or constrainedInternetAccess mean
there is no access to the internet available
+            // https://msdn.microsoft.com/library/windows/apps/windows.networking.connectivity.networkconnectivitylevel.aspx
+            if (conLevel != Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess)
{
                 connectionType = Connection.NONE;
             }
             else {
-                // https://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.networkadapter.ianainterfacetype
                 switch (interfaceType) {
                     case 71:
                         connectionType = Connection.WIFI;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message