fix(android-connectivity): add ethernet connection type (#5670)

Add "ethernet" connection type to getConnectionType to correctly return a connection type when the type is "ethernet"
This commit is contained in:
Michael Crowe
2018-04-19 06:09:33 -04:00
committed by Manol Donev
parent a616dbb9bb
commit 1536d15ecf
2 changed files with 12 additions and 1 deletions

View File

@@ -4,10 +4,12 @@ export enum connectionType {
none = 0,
wifi = 1,
mobile = 2,
ethernet = 3
}
const wifi = "wifi";
const mobile = "mobile";
const ethernet = "ethernet";
// Get Connection Type
function getConnectivityManager(): android.net.ConnectivityManager {
@@ -37,6 +39,10 @@ export function getConnectionType(): number {
if (type.indexOf(mobile) !== -1){
return connectionType.mobile;
}
if (type.indexOf(ethernet) !== -1){
return connectionType.ethernet;
}
return connectionType.none;
}

View File

@@ -27,7 +27,12 @@ export enum connectionType {
/**
* Denotes a mobile connection, i.e. cellular network or WAN.
*/
mobile = 2
mobile = 2,
/**
* Denotes an ethernet connection
*/
ethernet = 3
}
/**