You can't easily abstract out this variable because this can crash Cordova due to the plugin design.

This commit is contained in:
Joe Bowser 2015-10-06 12:57:01 -07:00
parent 013ad94af0
commit 4db1fecba8

View File

@ -42,7 +42,6 @@ public class CordovaPlugin {
public CordovaInterface cordova; public CordovaInterface cordova;
protected CordovaPreferences preferences; protected CordovaPreferences preferences;
private String serviceName; private String serviceName;
protected String [] permissions;
/** /**
* Call this after constructing to initialize the plugin. * Call this after constructing to initialize the plugin.
@ -372,7 +371,6 @@ public class CordovaPlugin {
*/ */
public void requestPermissions(int requestCode) { public void requestPermissions(int requestCode) {
cordova.requestPermissions(this, requestCode, permissions);
} }
/* /*
@ -383,18 +381,6 @@ public class CordovaPlugin {
*/ */
public boolean hasPermisssion() { 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; return true;
} }