Repository: cordova-plugin-geolocation
Updated Branches:
  refs/heads/master bf8a37341 -> 3f0c06368


Scoping errors with permissions variables, temporary fix


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/cc7e3cbe
Tree: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/cc7e3cbe
Diff: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/cc7e3cbe

Branch: refs/heads/master
Commit: cc7e3cbe42b951d835ca81d4e9c68ea2d542a95a
Parents: b9426e9
Author: Joe Bowser <[email protected]>
Authored: Fri Oct 2 14:47:18 2015 -0700
Committer: Joe Bowser <[email protected]>
Committed: Wed Oct 28 12:00:26 2015 -0700

----------------------------------------------------------------------
 src/android/Geolocation.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/cc7e3cbe/src/android/Geolocation.java
----------------------------------------------------------------------
diff --git a/src/android/Geolocation.java b/src/android/Geolocation.java
index a04e949..3db8a56 100644
--- a/src/android/Geolocation.java
+++ b/src/android/Geolocation.java
@@ -77,5 +77,21 @@ public class Geolocation extends CordovaPlugin {
         context.sendPluginResult(result);
     }
 
+    public boolean hasPermisssion() {
+        if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
+        {
+            return true;
+        }
+        for(String p : permissions)
+        {
+            if(PackageManager.PERMISSION_DENIED == 
cordova.getActivity().checkSelfPermission(p))
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
 
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to