cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [1/6] cordova-plugin-geolocation git commit: Scoping errors with permissions variables, temporary fix
Date Wed, 28 Oct 2015 19:00:44 GMT
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 <bowserj@apache.org>
Authored: Fri Oct 2 14:47:18 2015 -0700
Committer: Joe Bowser <bowserj@apache.org>
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message