title: Geofence Plugin -Crash throwing Security exception
body: <p>I am using geofence plugin to get the location. I am facing location permission exception though all the permission are maintained in manifest and also requested  same permission at runtime also.</p>
  <blockquote>
  <p>java.lang.SecurityException: &quot;gps&quot; location provider requires ACCESS_FINE_LOCATION permission.</p>
  </blockquote>
  <p>Strange is the crash is happening only in Android 10 and below versions. In Android 11, its working fine.</p>
  <p>I have been using background location access permission from Android 10 which is on API Level 29.</p>
  <p>Below is my code:</p>
  <pre><code>private void askAuthorization(Action action, boolean authorizeOnly) {
          this.executedAction = action;
          this.authorizeOnly = authorizeOnly;
          String[] permissions = getPermissions();
  
          if (!hasPermissions(permissions)) {
              ExLOG.e(TAG, &quot;hasPermissions == false, asked for permissions&quot;);
              if (Build.VERSION.SDK_INT &gt;= 29) {
                  showPermissionReasonDialog();
              } else
                  PermissionHelper.requestPermissions(this, 101, permissions);
          } else {
  
              if (!isLocationModeHighAccuracy()) {
                  gotoPhoneLocationSettings();
              }
  
              executedAction.callbackContext.success();
              executedAction = null;
          }
  
      }
  
      private String[] getPermissions() {
  
          if (Build.VERSION.SDK_INT &gt;= 29)
              return new String[]{
                      Manifest.permission.ACCESS_COARSE_LOCATION,
                      Manifest.permission.ACCESS_FINE_LOCATION,
                      &quot;android.permission.ACCESS_BACKGROUND_LOCATION&quot;
              };
  
          return new String[]{
                  Manifest.permission.ACCESS_COARSE_LOCATION,
                  Manifest.permission.ACCESS_FINE_LOCATION
          };
  
      }
  
  
  
  private void addOrUpdate(final Action action) {
          ExLOG.d(TAG, &quot;addOrUpdate is called&quot;);
          final Context context = super.cordova.getActivity();
  
          try {
              final GeoNotification geoNotification = GeoNotification.fromJson(action.args.getJSONObject(0).toString());
              geoNotification.user = action.args.getString(1);
              geoNotification.tenant = action.args.getString(2);
  
              // add another check here just in case the askAuthorization action was not called
              if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                  askAuthorization(action, false);
                  return;
              }
  
              // add location to log
              LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
              Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
              String lastKnownLocation = (location == null) ? &quot;null&quot;
                      : location.getLatitude() + &quot;, &quot; + location.getLongitude();
              ExLOG.d(TAG, &quot;check in -&gt; addOrUpdate location: &quot; + lastKnownLocation);
  </code></pre>