mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-25 10:15:14 +02:00
Port to new adbkit.
This commit is contained in:
@@ -14,7 +14,7 @@ var procutil = require('../util/procutil')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('provider')
|
||||
var client = Promise.promisifyAll(adb.createClient())
|
||||
var client = adb.createClient()
|
||||
var workers = {}
|
||||
var solo = wireutil.makePrivateChannel()
|
||||
var lists = {
|
||||
@@ -81,7 +81,7 @@ module.exports = function(options) {
|
||||
})
|
||||
|
||||
// Track and manage devices
|
||||
client.trackDevicesAsync().then(function(tracker) {
|
||||
client.trackDevices().then(function(tracker) {
|
||||
log.info('Tracking devices')
|
||||
|
||||
// Helper for ignoring unwanted devices
|
||||
@@ -349,6 +349,16 @@ module.exports = function(options) {
|
||||
flippedTracker.emit(device.id, 'remove', device)
|
||||
}))
|
||||
|
||||
tracker.on('error', function(err) {
|
||||
log.fatal('Tracker had an error:', err.stack)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
tracker.on('end', function() {
|
||||
log.fatal('Tracker ended')
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
sub.on('message', wirerouter()
|
||||
.on(wire.DeviceRegisteredMessage, function(channel, message) {
|
||||
flippedTracker.emit(message.serial, 'register')
|
||||
|
||||
Reference in New Issue
Block a user