You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/11/24 19:52:55 UTC

[cordova-paramedic] 01/01: manage android permissions (#4)

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch johanlantz-grant_permissions
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git

commit cf175855913d24c2dfd65a3e2e268dc67322eca7
Author: johanlantz <il...@gmail.com>
AuthorDate: Wed Jun 20 14:56:51 2018 +0200

    manage android permissions (#4)
---
 lib/paramedic.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/paramedic.js b/lib/paramedic.js
index a386bb7..591949f 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -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 () {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org