1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 19:42:01 +02:00

Port to new adbkit.

This commit is contained in:
Simo Kinnunen 2014-03-12 12:42:10 +09:00
parent ca401d7b9c
commit d90d450400
4 changed files with 38 additions and 32 deletions

View file

@ -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')