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

Implement account removal.

This commit is contained in:
Valverde Antonio 2014-06-25 17:47:45 +09:00
parent a8da19472d
commit 3a3937ec2f
9 changed files with 78 additions and 1 deletions

View file

@ -490,6 +490,21 @@ module.exports = syrup.serial()
})
}
plugin.removeAccount = function() {
return runServiceCommand(
apk.wire.MessageType.REMOVE_ACCOUNT
, new apk.wire.RemoveAccountRequest()
)
.timeout(15000)
.then(function(data) {
var response = apk.wire.RemoveAccountResponse.decode(data)
if (response.success) {
return true
}
throw new Error('Unable to remove account')
})
}
function runServiceCommand(type, cmd) {
var resolver = Promise.defer()
var id = Math.floor(Math.random() * 0xFFFFFF)