Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

manage android permissions #4

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/paramedic.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,20 @@ ParamedicRunner.prototype.setPermissions = function () {
paramediciOSPermissions.updatePermissions(applicationsToGrantPermission);
}
}

if(this.config.getPlatformId() === util.ANDROID) {
var self = this;
self.server.on('jasmineStarted', function (data) {
logger.info('cordova-paramedic: Jasmine started');
logger.warn('Requesting permissions');
cp.exec("adb shell pm grant " + util.PARAMEDIC_DEFAULT_APP_NAME + " android.permission.READ_PHONE_STATE");
cp.exec("adb shell pm grant " + util.PARAMEDIC_DEFAULT_APP_NAME + " android.permission.READ_SMS");
cp.exec("adb shell pm grant " + util.PARAMEDIC_DEFAULT_APP_NAME + " android.permission.READ_CALL_LOG");
cp.exec("adb shell pm grant " + util.PARAMEDIC_DEFAULT_APP_NAME + " android.permission.ACCESS_FINE_LOCATION");
cp.exec("adb shell pm grant " + util.PARAMEDIC_DEFAULT_APP_NAME + " android.permission.ACCESS_COARSE_LOCATION");
cp.exec("adb shell pm grant " + util.PARAMEDIC_DEFAULT_APP_NAME + " android.permission.RECORD_AUDIO");
});
}
};

ParamedicRunner.prototype.injectReporters = function () {
Expand Down