Use 'am stopservice' to stop the input service.

This commit is contained in:
Simo Kinnunen
2014-03-23 22:16:14 +09:00
parent f44822e744
commit 2683f36390

View File

@@ -85,9 +85,10 @@ module.exports = syrup.serial()
)
}
function callService(intent) {
function callService(cmd, intent) {
return adb.shell(options.serial, util.format(
'am startservice --user 0 %s'
'am %s --user 0 %s'
, cmd
, intent
))
.then(function(out) {
@@ -137,7 +138,10 @@ module.exports = syrup.serial()
return devutil.waitForPortToFree(adb, options.serial, service.port)
})
.then(function() {
return callService(util.format("-a '%s'", service.startAction))
return callService(
'startservice'
, util.format("-a '%s'", service.startAction)
)
})
.then(function() {
return devutil.waitForPort(adb, options.serial, service.port)
@@ -156,7 +160,10 @@ module.exports = syrup.serial()
}
function stopService() {
return callService(util.format("-a '%s'", service.stopAction))
return callService(
'stopservice'
, util.format("-a '%s'", service.stopAction)
)
}
function sendInputEvent(event) {