<commit_before>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;
	}
}<commit_msg>Fix missing imports and extends<commit_after>package com.josenaves.plugin;

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

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

public class CheckGps extends CordovaPlugin {

	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) Context.getSystemService(Context.LOCATION_SERVICE);
		boolean enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
		Log.d(TAG, String.format("CheckGps.isGpsEnabled() = %s", enabled) );
		return enabled;
	}
}
{'fraction_non_alphanumeric': 0.09489666807254322, 'fraction_numerical': 0.0, 'mean_word_length': 3.6418786692759295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7557017', 'n_tokens_mistral': 679, 'n_tokens_neox': 661, 'n_words': 154}