From 9041eabfc1aa3fe21c02da805bc39e64574872c8 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Thu, 1 May 2014 17:45:37 +0900 Subject: [PATCH] Rename "input" plugin to "service". It does many more things than just input. --- lib/roles/device.js | 2 +- lib/roles/device/plugins/browser.js | 6 +++--- lib/roles/device/plugins/clipboard.js | 8 ++++---- lib/roles/device/plugins/group.js | 12 ++++++------ lib/roles/device/plugins/phone.js | 6 +++--- lib/roles/device/plugins/{input.js => service.js} | 14 +++++++------- 6 files changed, 24 insertions(+), 24 deletions(-) rename lib/roles/device/plugins/{input.js => service.js} (97%) diff --git a/lib/roles/device.js b/lib/roles/device.js index eb157ac3..c5202935 100644 --- a/lib/roles/device.js +++ b/lib/roles/device.js @@ -20,7 +20,7 @@ module.exports = function(options) { .dependency(require('./device/plugins/heartbeat')) .dependency(require('./device/plugins/display')) .dependency(require('./device/plugins/http')) - .dependency(require('./device/plugins/input')) + .dependency(require('./device/plugins/service')) .dependency(require('./device/plugins/clipboard')) .dependency(require('./device/plugins/logcat')) .dependency(require('./device/plugins/shell')) diff --git a/lib/roles/device/plugins/browser.js b/lib/roles/device/plugins/browser.js index 90e60d84..2c1813c2 100644 --- a/lib/roles/device/plugins/browser.js +++ b/lib/roles/device/plugins/browser.js @@ -8,8 +8,8 @@ module.exports = syrup.serial() .dependency(require('../support/router')) .dependency(require('../support/push')) .dependency(require('../support/adb')) - .dependency(require('./input')) - .define(function(options, router, push, adb, input) { + .dependency(require('./service')) + .define(function(options, router, push, adb, service) { var log = logger.createLogger('device:plugins:browsers') function pkg(component) { @@ -17,7 +17,7 @@ module.exports = syrup.serial() } log.info('Fetching browser list') - return input.getBrowsers() + return service.getBrowsers() .timeout(15000) .then(function(browsers) { browsers.apps.forEach(function(app) { diff --git a/lib/roles/device/plugins/clipboard.js b/lib/roles/device/plugins/clipboard.js index 5bef74d7..9e645beb 100644 --- a/lib/roles/device/plugins/clipboard.js +++ b/lib/roles/device/plugins/clipboard.js @@ -7,14 +7,14 @@ var wireutil = require('../../../wire/util') module.exports = syrup.serial() .dependency(require('../support/router')) .dependency(require('../support/push')) - .dependency(require('./input')) - .define(function(options, router, push, input) { + .dependency(require('./service')) + .define(function(options, router, push, service) { var log = logger.createLogger('device:plugins:clipboard') router.on(wire.PasteMessage, function(channel, message) { log.info('Pasting "%s" to clipboard', message.text) var reply = wireutil.reply(options.serial) - input.paste(message.text) + service.paste(message.text) .then(function() { push.send([ channel @@ -33,7 +33,7 @@ module.exports = syrup.serial() router.on(wire.CopyMessage, function(channel) { log.info('Copying clipboard contents') var reply = wireutil.reply(options.serial) - input.copy() + service.copy() .then(function(content) { push.send([ channel diff --git a/lib/roles/device/plugins/group.js b/lib/roles/device/plugins/group.js index 08b7098f..007368ab 100644 --- a/lib/roles/device/plugins/group.js +++ b/lib/roles/device/plugins/group.js @@ -11,12 +11,12 @@ var lifecycle = require('../../../util/lifecycle') module.exports = syrup.serial() .dependency(require('./identity')) - .dependency(require('./input')) + .dependency(require('./service')) .dependency(require('../support/router')) .dependency(require('../support/push')) .dependency(require('../support/sub')) .dependency(require('../support/channels')) - .define(function(options, identity, input, router, push, sub, channels) { + .define(function(options, identity, service, router, push, sub, channels) { var log = logger.createLogger('device:plugins:group') , currentGroup = null , plugin = new events.EventEmitter() @@ -86,13 +86,13 @@ module.exports = syrup.serial() } plugin.on('join', function() { - input.acquireWakeLock() - input.unlock() + service.acquireWakeLock() + service.unlock() }) plugin.on('leave', function() { - input.releaseWakeLock() - input.lock() + service.releaseWakeLock() + service.lock() }) router diff --git a/lib/roles/device/plugins/phone.js b/lib/roles/device/plugins/phone.js index cf6a3d70..aa8d4fc2 100644 --- a/lib/roles/device/plugins/phone.js +++ b/lib/roles/device/plugins/phone.js @@ -3,13 +3,13 @@ var syrup = require('syrup') var logger = require('../../../util/logger') module.exports = syrup.serial() - .dependency(require('./input')) - .define(function(options, input) { + .dependency(require('./service')) + .define(function(options, service) { var log = logger.createLogger('device:plugins:phone') function fetch() { log.info('Fetching phone info') - return input.getProperties([ + return service.getProperties([ 'imei' , 'phoneNumber' , 'iccid' diff --git a/lib/roles/device/plugins/input.js b/lib/roles/device/plugins/service.js similarity index 97% rename from lib/roles/device/plugins/input.js rename to lib/roles/device/plugins/service.js index d2ef889d..d1a22369 100644 --- a/lib/roles/device/plugins/input.js +++ b/lib/roles/device/plugins/service.js @@ -35,7 +35,7 @@ module.exports = syrup.serial() .dependency(require('../support/push')) .dependency(require('../resources/service')) .define(function(options, adb, router, push, apk) { - var log = logger.createLogger('device:plugins:input') + var log = logger.createLogger('device:plugins:service') var messageResolver = new MessageResolver() var agent = { @@ -52,7 +52,7 @@ module.exports = syrup.serial() } function openAgent() { - log.info('Launching input agent') + log.info('Launching agent') return stopAgent() .timeout(15000) .then(function() { @@ -68,8 +68,8 @@ module.exports = syrup.serial() .timeout(10000) }) .then(function(out) { - lifecycle.share('InputAgent shell', out) - streamutil.talk(log, 'InputAgent says: "%s"', out) + lifecycle.share('Agent shell', out) + streamutil.talk(log, 'Agent says: "%s"', out) }) .then(function() { return devutil.waitForPort(adb, options.serial, agent.port) @@ -79,7 +79,7 @@ module.exports = syrup.serial() agent.socket = conn agent.writer = new ms.DelimitingStream() agent.writer.pipe(conn) - lifecycle.share('InputAgent connection', conn) + lifecycle.share('Agent connection', conn) }) } @@ -142,7 +142,7 @@ module.exports = syrup.serial() } function openService() { - log.info('Launching input service') + log.info('Launching service') return stopService() .timeout(15000) .then(function() { @@ -162,7 +162,7 @@ module.exports = syrup.serial() service.reader.on('data', handleEnvelope) service.writer = new ms.DelimitingStream() service.writer.pipe(conn) - lifecycle.share('InputService connection', conn) + lifecycle.share('Service connection', conn) }) }