mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 03:53:28 +02:00
Implement get SD card status (if it's mounted or not).
This commit is contained in:
@@ -565,6 +565,21 @@ module.exports = syrup.serial()
|
||||
})
|
||||
}
|
||||
|
||||
plugin.getSdStatus = function () {
|
||||
return runServiceCommand(
|
||||
apk.wire.MessageType.GET_SD_STATUS
|
||||
, new apk.wire.GetSdStatusRequest()
|
||||
)
|
||||
.timeout(10000)
|
||||
.then(function(data) {
|
||||
var response = apk.wire.GetSdStatusResponse.decode(data)
|
||||
if (response.success) {
|
||||
return response.mounted
|
||||
}
|
||||
throw new Error('Unable to get SD card status')
|
||||
})
|
||||
}
|
||||
|
||||
plugin.pressKey = function(key) {
|
||||
keyEvent({event: apk.wire.KeyEvent.PRESS, keyCode: keyutil.namedKey(key)})
|
||||
return Promise.resolve(true)
|
||||
|
||||
Reference in New Issue
Block a user