Merge pull request #1735 from devoncarew/filter_offline_devices

filter offline devices from notifications
This commit is contained in:
Devon Carew 2016-02-09 14:38:39 -08:00
commit 1f0d292079

View File

@ -103,6 +103,9 @@ class Adb {
} else {
List<AdbDevice> devices = devicesText.split('\n').map((String deviceInfo) {
return new AdbDevice(deviceInfo);
}).where((AdbDevice device) {
// Filter unauthorized devices - we can't connect to them.
return !device.isUnauthorized && !device.isOffline;
}).toList();
await _populateDeviceNames(devices);
@ -195,6 +198,10 @@ class AdbDevice {
bool get isAvailable => status == 'device';
bool get isUnauthorized => status == 'unauthorized';
bool get isOffline => status == 'offline';
/// Device model; can be null. `XT1045`, `Nexus_7`
String get modelID => _info['model'];