package com.josenaves.plugin;

import android.util.Log;
import android.location.LocationManager;
import android.content.Context;

import org.apache.cordova.CallbackContext;
import org.json.JSONArray;
import org.json.JSONException;

public class CheckGps {

	private static final String TAG = CheckGps.class.getSimpleName();

    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        if ("isGpsEnabled".equals(action)) {

        	if (isGpsEnabled()) {
        		callbackContext.success("GPS is enabled");	
        	} else  {
        		callbackContext.error("GPS is not enabled");
        	}
            
            return true;
        }
        return false;  // Returning false results in a "MethodNotFound" error.
    }	

	private boolean isGpsEnabled() {
		LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
		boolean enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
		Log.d(TAG, String.format("CheckGps.isGpsEnabled() = %s", enabled) );
		return enabled;
	}
}
@@ -123,16 +123,57 @@
 ntext;%0A%0A
+import org.apache.cordova.CordovaPlugin;%0A
 import o
@@ -288,16 +288,38 @@
 heckGps 
+extends CordovaPlugin 
 %7B%0A%0A%09priv
@@ -948,16 +948,24 @@
 anager) 
+Context.
 getSyste

Fix missing imports and extends