Commit 36b6210c authored by Devon Carew's avatar Devon Carew

filter offline devices from notifications

parent 33885a3c
...@@ -103,6 +103,9 @@ class Adb { ...@@ -103,6 +103,9 @@ class Adb {
} else { } else {
List<AdbDevice> devices = devicesText.split('\n').map((String deviceInfo) { List<AdbDevice> devices = devicesText.split('\n').map((String deviceInfo) {
return new AdbDevice(deviceInfo); return new AdbDevice(deviceInfo);
}).where((AdbDevice device) {
// Filter unauthorized devices - we can't connect to them.
return !device.isUnauthorized && !device.isOffline;
}).toList(); }).toList();
await _populateDeviceNames(devices); await _populateDeviceNames(devices);
...@@ -195,6 +198,10 @@ class AdbDevice { ...@@ -195,6 +198,10 @@ class AdbDevice {
bool get isAvailable => status == 'device'; bool get isAvailable => status == 'device';
bool get isUnauthorized => status == 'unauthorized';
bool get isOffline => status == 'offline';
/// Device model; can be null. `XT1045`, `Nexus_7` /// Device model; can be null. `XT1045`, `Nexus_7`
String get modelID => _info['model']; String get modelID => _info['model'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment