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,
wifi = 1,
mobile = 2,
ethernet = 3
ethernet = 3,
bluetooth = 4
}
const wifi = "wifi";
const mobile = "mobile";
const ethernet = "ethernet";
const bluetooth = "bluetooth";
// Get Connection Type
function getConnectivityManager(): android.net.ConnectivityManager {
@ -43,6 +45,10 @@ export function getConnectionType(): number {
if (type.indexOf(ethernet) !== -1) {
return connectionType.ethernet;
}
if (type.indexOf(bluetooth) !== -1) {
return connectionType.bluetooth;
}
return connectionType.none;
}

View File

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