feat(android): add Bluetooth connectivity type for Android (#6162)

* feat(android): add Bluetooth connectivity type for Android

* Update connectivity.d.ts
This commit is contained in:
Nick Iliev
2018-08-09 10:25:32 +03:00
committed by Alexander Vakrilov
parent 106d417365
commit f1bef481e6
2 changed files with 13 additions and 2 deletions

View File

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

View File

@ -32,7 +32,12 @@ export enum connectionType {
/** /**
* Denotes an ethernet connection * Denotes an ethernet connection
*/ */
ethernet = 3 ethernet = 3,
/**
* Denotes an bluetooth connection
*/
bluetooth = 4
} }
/** /**