mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 07:53:28 +02:00
Implement get account names function.
This commit is contained in:
@@ -490,6 +490,21 @@ module.exports = syrup.serial()
|
||||
})
|
||||
}
|
||||
|
||||
plugin.getAccounts = function(type) {
|
||||
return runServiceCommand(
|
||||
apk.wire.MessageType.GET_ACCOUNTS
|
||||
, new apk.wire.GetAccountsRequest(type)
|
||||
)
|
||||
.timeout(15000)
|
||||
.then(function(data) {
|
||||
var response = apk.wire.GetAccountsResponse.decode(data)
|
||||
if (response.success) {
|
||||
return response.accounts
|
||||
}
|
||||
throw new Error('No accounts returned')
|
||||
})
|
||||
}
|
||||
|
||||
plugin.removeAccount = function(data) {
|
||||
return runServiceCommand(
|
||||
apk.wire.MessageType.DO_REMOVE_ACCOUNT
|
||||
|
||||
Reference in New Issue
Block a user