mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-17 15:43:25 +02:00
add required permissions for new sdk:s to be able to use "find me" and bluetooth features (#765)
Signed-off-by: Jussi Vatjus-Anttila <jussiva@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b5b3f910ca
commit
b39bac2c8f
@@ -8,6 +8,7 @@ var pathutil = require('../../../util/pathutil')
|
||||
var streamutil = require('../../../util/streamutil')
|
||||
var promiseutil = require('../../../util/promiseutil')
|
||||
var logger = require('../../../util/logger')
|
||||
const adbkit = require('@devicefarmer/adbkit')
|
||||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('../support/adb'))
|
||||
@@ -96,7 +97,19 @@ module.exports = syrup.serial()
|
||||
})
|
||||
}
|
||||
|
||||
function setPermission(path) {
|
||||
return adb.shell(options.serial, [
|
||||
'pm', 'grant', resource.pkg
|
||||
, 'android.permission.BLUETOOTH_CONNECT'
|
||||
, 'android.permission.SYSTEM_ALERT_WINDOW'])
|
||||
.then(adbkit.util.readAll)
|
||||
.then(function(out) {
|
||||
log.debug('output of granting permissions to STFService: ' + out.toString())
|
||||
return path
|
||||
})
|
||||
}
|
||||
return install()
|
||||
.then(setPermission)
|
||||
.then(function(path) {
|
||||
log.info('STFService up to date')
|
||||
resource.path = path
|
||||
|
||||
Reference in New Issue
Block a user