// Path: ignition-location/ignition-location-lib/src/com/github/ignition/location/IgnitedLocationConstants.java
// public class IgnitedLocationConstants {
//     public static final boolean USE_GPS_DEFAULT = true;
//     public static final boolean REQUEST_LOCATION_UPDATES_DEFAULT = true;
//     // The maximum distance the user should travel between location updates.
//     public static final int LOCATION_UPDATES_DISTANCE_DIFF_DEFAULT = 100; // meters
//     // The maximum time that should pass before the user gets a location update.
//     public static final long LOCATION_UPDATES_INTERVAL_DEFAULT = 5 * 60 * 1000; // 5 minutes
//     // You will generally want passive location updates to occur less frequently
//     // than active updates. You need to balance location freshness with battery
//     // life. The location update distance for passive updates.
//     public static final int PASSIVE_LOCATION_UPDATES_DISTANCE_DIFF_DEFAULT = LOCATION_UPDATES_DISTANCE_DIFF_DEFAULT;
//     // The location update time for passive updates
//     public static final long PASSIVE_LOCATION_UPDATES_INTERVAL_DEFAULT = LOCATION_UPDATES_INTERVAL_DEFAULT * 3;
//     // When the user exits via the back button, do you want to disable passive background updates.
//     public static final boolean ENABLE_PASSIVE_LOCATION_UPDATES_DEFAULT = true;
// 
//     public static final String SHARED_PREFERENCE_FILE = "ignition_location_shared_preference_file";
//     public static final String SP_KEY_RUN_ONCE = "sp_key_run_once";
//     public static final String SP_KEY_ENABLE_LOCATION_UPDATES = "sp_key_enable_location_updates";
//     public static final String SP_KEY_ENABLE_PASSIVE_LOCATION_UPDATES = "sp_key_enable_passive_location_updates";
//     public static final String SP_KEY_LOCATION_UPDATES_USE_GPS = "sp_key_location_updates_use_gps";
//     public static final String SP_KEY_LOCATION_UPDATES_DISTANCE_DIFF = "sp_location_updates_distance_diff";
//     public static final String SP_KEY_LOCATION_UPDATES_INTERVAL = "sp_key_location_updates_interval";
//     public static final String SP_KEY_PASSIVE_LOCATION_UPDATES_DISTANCE_DIFF = "sp_passive_location_updates_distance_diff";
//     public static final String SP_KEY_PASSIVE_LOCATION_UPDATES_INTERVAL = "sp_key_passive_location_updates_interval";
//     public static final String SP_KEY_MIN_BATTERY_LEVEL = "sp_key_min_battery_level";
//     public static final String SP_KEY_WAIT_FOR_GPS_FIX_INTERVAL = "sp_key_wait_for_gps_fix_interval";
//     public static final String SP_KEY_SHOW_WAIT_FOR_LOCATION_DIALOG = "sp_key_show_wait_for_location_dialog";
// 
//     public static final String ACTIVE_LOCATION_UPDATE_PROVIDER_DISABLED_ACTION = "com.github.ignition.location.ACTIVE_LOCATION_UPDATE_PROVIDER_DISABLED_ACTION";
//     public static final String ACTIVE_LOCATION_UPDATE_ACTION = "com.github.ignition.location.ACTIVE_LOCATION_UPDATE_ACTION";
//     public static final String UPDATE_LOCATION_UPDATES_CRITERIA_ACTION = "com.github.ignition.location.UPDATE_LOCATION_UPDATES_CRITERIA_ACTION";
// 
//     public static final String IGNITED_LOCATION_EXTRA = "ignited_location_extra";
//     public static final String IGNITED_LAST_LOCATION_EXTRA = "ignited_last_location_extra";
// 
//     public static final int MIN_BATTERY_LEVEL_FOR_GPS_DEFAULT = 15;
// 
//     public static final long WAIT_FOR_GPS_FIX_INTERVAL_DEFAULT = 30000; // 30s
// 
//     public static final boolean SHOW_WAIT_FOR_LOCATION_DIALOG_DEFAULT = true;
// }
// 
// Path: ignition-location/ignition-location-lib/src/com/github/ignition/location/utils/PlatformSpecificImplementationFactory.java
// public class PlatformSpecificImplementationFactory {
// 
//     /**
//      * Create a new LastLocationFinder instance
//      * 
//      * @param context
//      *            {@link android.content.Context}
//      * @return LastLocationFinder
//      */
//     public static ILastLocationFinder getLastLocationFinder(Context context) {
//         return IgnitedDiagnostics.supportsApiLevel(GINGERBREAD) ? new IgnitedGingerbreadLastLocationFinder(
//                 context) : new IgnitedLegacyLastLocationFinder(context);
//     }
// 
//     /**
//      * Create a new LocationUpdateRequester
//      * 
//      * @param locationManager
//      *            {@link android.location.LocationManager}
//      * @return LocationUpdateRequester
//      */
//     public static IgnitedAbstractLocationUpdateRequester getLocationUpdateRequester(Context context) {
//         LocationManager locationManager = (LocationManager) context
//                 .getSystemService(LOCATION_SERVICE);
//         if (IgnitedDiagnostics.supportsApiLevel(GINGERBREAD)) {
//             return new IgnitedGingerbreadLocationUpdateRequester(locationManager);
//         } else if (IgnitedDiagnostics.supportsApiLevel(FROYO)) {
//             return new IgnitedFroyoLocationUpdateRequester(locationManager);
//         } else {
//             AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE);
//             return new IgnitedLegacyLocationUpdateRequester(locationManager, alarmManager);
//         }
//     }
// }


import android.app.IntentService;
import android.content.Context;
import android.location.Location;
import android.os.AsyncTask;
import android.os.Bundle;
import com.github.ignition.location.IgnitedLocationConstants;
import com.github.ignition.location.annotations.IgnitedLocation;
import com.github.ignition.location.templates.ILastLocationFinder;
import com.github.ignition.location.utils.PlatformSpecificImplementationFactory;
package com.github.ignition.location.tasks;



public class IgnitedLastKnownLocationAsyncTask extends AsyncTask<Boolean, Void, Location> {
    private final int locationUpdateDistanceDiff;
    private final long locationUpdateInterval;
    @SuppressWarnings("unused")
    @IgnitedLocation
    private Location currentLocation;
    private ILastLocationFinder lastLocationFinder;

    /**
     * 
     * @param context
     * @param locationUpdateDistanceDiff
     * @param locationUpdateInterval
     */
    public IgnitedLastKnownLocationAsyncTask(Context context, int locationUpdateDistanceDiff,
            long locationUpdateInterval) {
        this.locationUpdateDistanceDiff = locationUpdateDistanceDiff;
        this.locationUpdateInterval = locationUpdateInterval;
// Path: ignition-location/ignition-location-lib/src/com/github/ignition/location/IgnitedLocationConstants.java
// public class IgnitedLocationConstants {
//     public static final boolean USE_GPS_DEFAULT = true;
//     public static final boolean REQUEST_LOCATION_UPDATES_DEFAULT = true;
//     // The maximum distance the user should travel between location updates.
//     public static final int LOCATION_UPDATES_DISTANCE_DIFF_DEFAULT = 100; // meters
//     // The maximum time that should pass before the user gets a location update.
//     public static final long LOCATION_UPDATES_INTERVAL_DEFAULT = 5 * 60 * 1000; // 5 minutes
//     // You will generally want passive location updates to occur less frequently
//     // than active updates. You need to balance location freshness with battery
//     // life. The location update distance for passive updates.
//     public static final int PASSIVE_LOCATION_UPDATES_DISTANCE_DIFF_DEFAULT = LOCATION_UPDATES_DISTANCE_DIFF_DEFAULT;
//     // The location update time for passive updates
//     public static final long PASSIVE_LOCATION_UPDATES_INTERVAL_DEFAULT = LOCATION_UPDATES_INTERVAL_DEFAULT * 3;
//     // When the user exits via the back button, do you want to disable passive background updates.
//     public static final boolean ENABLE_PASSIVE_LOCATION_UPDATES_DEFAULT = true;
// 
//     public static final String SHARED_PREFERENCE_FILE = "ignition_location_shared_preference_file";
//     public static final String SP_KEY_RUN_ONCE = "sp_key_run_once";
//     public static final String SP_KEY_ENABLE_LOCATION_UPDATES = "sp_key_enable_location_updates";
//     public static final String SP_KEY_ENABLE_PASSIVE_LOCATION_UPDATES = "sp_key_enable_passive_location_updates";
//     public static final String SP_KEY_LOCATION_UPDATES_USE_GPS = "sp_key_location_updates_use_gps";
//     public static final String SP_KEY_LOCATION_UPDATES_DISTANCE_DIFF = "sp_location_updates_distance_diff";
//     public static final String SP_KEY_LOCATION_UPDATES_INTERVAL = "sp_key_location_updates_interval";
//     public static final String SP_KEY_PASSIVE_LOCATION_UPDATES_DISTANCE_DIFF = "sp_passive_location_updates_distance_diff";
//     public static final String SP_KEY_PASSIVE_LOCATION_UPDATES_INTERVAL = "sp_key_passive_location_updates_interval";
//     public static final String SP_KEY_MIN_BATTERY_LEVEL = "sp_key_min_battery_level";
//     public static final String SP_KEY_WAIT_FOR_GPS_FIX_INTERVAL = "sp_key_wait_for_gps_fix_interval";
//     public static final String SP_KEY_SHOW_WAIT_FOR_LOCATION_DIALOG = "sp_key_show_wait_for_location_dialog";
// 
//     public static final String ACTIVE_LOCATION_UPDATE_PROVIDER_DISABLED_ACTION = "com.github.ignition.location.ACTIVE_LOCATION_UPDATE_PROVIDER_DISABLED_ACTION";
//     public static final String ACTIVE_LOCATION_UPDATE_ACTION = "com.github.ignition.location.ACTIVE_LOCATION_UPDATE_ACTION";
//     public static final String UPDATE_LOCATION_UPDATES_CRITERIA_ACTION = "com.github.ignition.location.UPDATE_LOCATION_UPDATES_CRITERIA_ACTION";
// 
//     public static final String IGNITED_LOCATION_EXTRA = "ignited_location_extra";
//     public static final String IGNITED_LAST_LOCATION_EXTRA = "ignited_last_location_extra";
// 
//     public static final int MIN_BATTERY_LEVEL_FOR_GPS_DEFAULT = 15;
// 
//     public static final long WAIT_FOR_GPS_FIX_INTERVAL_DEFAULT = 30000; // 30s
// 
//     public static final boolean SHOW_WAIT_FOR_LOCATION_DIALOG_DEFAULT = true;
// }
// 
// Path: ignition-location/ignition-location-lib/src/com/github/ignition/location/utils/PlatformSpecificImplementationFactory.java
// public class PlatformSpecificImplementationFactory {
// 
//     /**
//      * Create a new LastLocationFinder instance
//      * 
//      * @param context
//      *            {@link android.content.Context}
//      * @return LastLocationFinder
//      */
//     public static ILastLocationFinder getLastLocationFinder(Context context) {
//         return IgnitedDiagnostics.supportsApiLevel(GINGERBREAD) ? new IgnitedGingerbreadLastLocationFinder(
//                 context) : new IgnitedLegacyLastLocationFinder(context);
//     }
// 
//     /**
//      * Create a new LocationUpdateRequester
//      * 
//      * @param locationManager
//      *            {@link android.location.LocationManager}
//      * @return LocationUpdateRequester
//      */
//     public static IgnitedAbstractLocationUpdateRequester getLocationUpdateRequester(Context context) {
//         LocationManager locationManager = (LocationManager) context
//                 .getSystemService(LOCATION_SERVICE);
//         if (IgnitedDiagnostics.supportsApiLevel(GINGERBREAD)) {
//             return new IgnitedGingerbreadLocationUpdateRequester(locationManager);
//         } else if (IgnitedDiagnostics.supportsApiLevel(FROYO)) {
//             return new IgnitedFroyoLocationUpdateRequester(locationManager);
//         } else {
//             AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE);
//             return new IgnitedLegacyLocationUpdateRequester(locationManager, alarmManager);
//         }
//     }
// }


// Path: ignition-location/ignition-location-lib/src/com/github/ignition/location/tasks/IgnitedLastKnownLocationAsyncTask.java
import android.app.IntentService;
import android.content.Context;
import android.location.Location;
import android.os.AsyncTask;
import android.os.Bundle;
import com.github.ignition.location.IgnitedLocationConstants;
import com.github.ignition.location.annotations.IgnitedLocation;
import com.github.ignition.location.templates.ILastLocationFinder;
import com.github.ignition.location.utils.PlatformSpecificImplementationFactory;

package com.github.ignition.location.tasks;



public class IgnitedLastKnownLocationAsyncTask extends AsyncTask<Boolean, Void, Location> {
    private final int locationUpdateDistanceDiff;
    private final long locationUpdateInterval;
    @SuppressWarnings("unused")
    @IgnitedLocation
    private Location currentLocation;
    private ILastLocationFinder lastLocationFinder;

    /**
     * 
     * @param context
     * @param locationUpdateDistanceDiff
     * @param locationUpdateInterval
     */
    public IgnitedLastKnownLocationAsyncTask(Context context, int locationUpdateDistanceDiff,
            long locationUpdateInterval) {
        this.locationUpdateDistanceDiff = locationUpdateDistanceDiff;
        this.locationUpdateInterval = locationUpdateInterval;
        this.lastLocationFinder = PlatformSpecificImplementationFactory