diff --git a/lib/roles/device/plugins/connect.js b/lib/roles/device/plugins/connect.js index 63d918d8..e8f96352 100644 --- a/lib/roles/device/plugins/connect.js +++ b/lib/roles/device/plugins/connect.js @@ -35,6 +35,9 @@ module.exports = syrup.serial() server.on('connection', function(conn) { log.info('New remote ADB connection from %s', conn.remoteAddress) + conn.on('userActivity', function() { + group.keepalive() + }) }) server.on('error', reject) diff --git a/lib/roles/device/plugins/group.js b/lib/roles/device/plugins/group.js index 5ebcc471..77b94b1e 100644 --- a/lib/roles/device/plugins/group.js +++ b/lib/roles/device/plugins/group.js @@ -66,6 +66,12 @@ module.exports = syrup.serial() }) } + plugin.keepalive = function() { + if (currentGroup) { + channels.keepalive(currentGroup.group) + } + } + plugin.leave = function() { return plugin.get() .then(function(group) {