mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
You can't easily abstract out this variable because this can crash Cordova due to the plugin design.
This commit is contained in:
parent
013ad94af0
commit
4db1fecba8
@ -42,7 +42,6 @@ public class CordovaPlugin {
|
||||
public CordovaInterface cordova;
|
||||
protected CordovaPreferences preferences;
|
||||
private String serviceName;
|
||||
protected String [] permissions;
|
||||
|
||||
/**
|
||||
* Call this after constructing to initialize the plugin.
|
||||
@ -372,7 +371,6 @@ public class CordovaPlugin {
|
||||
*/
|
||||
|
||||
public void requestPermissions(int requestCode) {
|
||||
cordova.requestPermissions(this, requestCode, permissions);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -383,18 +381,6 @@ public class CordovaPlugin {
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user