// Path: core/src/main/java/com/novoda/location/LocatorSettings.java
// public class LocatorSettings {
// 
//     private final String packageName;
//     private final String updateAction;
// 
//     private boolean useGps = Constants.USE_GPS;
//     private boolean updateOnLocationChange = Constants.REFRESH_DATA_ON_LOCATION_CHANGED;
//     private long updatesInterval = Constants.UPDATES_MAX_TIME;
//     private int updatesDistance = Constants.UPDATES_MAX_DISTANCE;
//     private long passiveUpdatesInterval = Constants.DEFAULT_INTERVAL_PASSIVE;
//     private int passiveUpdatesDistance = Constants.DEFAULT_DISTANCE_PASSIVE;
//     private boolean enablePassiveUpdates = Constants.ENABLE_PASSIVE_UPDATES;
// 
//     public LocatorSettings(String packageName, String updateAction) {
//         this.packageName = packageName;
//         this.updateAction = updateAction;
//     }
//     
//     public String getPackageName() {
//         return packageName;
//     }
// 
//     public String getUpdateAction() {
//         return updateAction;
//     }
//     
//     public boolean shouldUseGps() {
//         return useGps;
//     }
// 
//     public void setUseGps(boolean useGps) {
//         this.useGps = useGps;
//     }
// 
//     public boolean shouldUpdateLocation() {
//         return updateOnLocationChange;
//     }
// 
//     public void setUpdateOnLocationChange(boolean updateOnLocationChange) {
//         this.updateOnLocationChange = updateOnLocationChange;
//     }
// 
//     public boolean shouldEnablePassiveUpdates() {
//         return enablePassiveUpdates;
//     }
// 
//     public void setEnablePassiveUpdates(boolean enablePassiveUpdates) {
//         this.enablePassiveUpdates = enablePassiveUpdates;
//     }
// 
//     public long getUpdatesInterval() {
//         return updatesInterval;
//     }
// 
//     public void setUpdatesInterval(long updatesInterval) {
//         this.updatesInterval = updatesInterval;
//     }
// 
//     public int getUpdatesDistance() {
//         return updatesDistance;
//     }
// 
//     public void setUpdatesDistance(int updatesDistance) {
//         this.updatesDistance = updatesDistance;
//     }
// 
//     public long getPassiveUpdatesInterval() {
//         return passiveUpdatesInterval;
//     }
// 
//     public void setPassiveUpdatesInterval(long passiveUpdatesInterval) {
//         this.passiveUpdatesInterval = passiveUpdatesInterval;
//     }
// 
//     public int getPassiveUpdatesDistance() {
//         return passiveUpdatesDistance;
//     }
// 
//     public void setPassiveUpdatesDistance(int passiveUpdatesDistance) {
//         this.passiveUpdatesDistance = passiveUpdatesDistance;
//     }
// 
// }


import android.app.AlarmManager;
import android.app.PendingIntent;
import android.location.Criteria;
import android.location.LocationManager;
import com.novoda.location.LocatorSettings;
/**
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * Code modified by Novoda Ltd, 2011.
 */
package com.novoda.location.provider.requester;



/**
 * Provides support for initiating active and passive location updates for all
 * Android platforms from Android 1.6.
 * 
 * Uses broadcast Intents to notify the app of location changes.
 */
public class LegacyLocationUpdateRequester extends BaseLocationUpdateRequester {

    protected final AlarmManager alarmManager;
    private final LocatorSettings settings;

    protected LegacyLocationUpdateRequester(LocationManager locationManager, AlarmManager alarmManager, LocatorSettings settings) {
        super(locationManager);
        this.alarmManager = alarmManager;
        this.settings = settings;
    }

    @Override
    public void requestActiveLocationUpdates(long minTime, long minDistance, Criteria criteria, PendingIntent pendingIntent) {
        // Prior to Gingerbread we needed to find the best provider manually.
        // Note that we aren't monitoring this provider to check if it becomes
        // disabled - this is handled by the calling Activity.
// Path: core/src/main/java/com/novoda/location/LocatorSettings.java
// public class LocatorSettings {
// 
//     private final String packageName;
//     private final String updateAction;
// 
//     private boolean useGps = Constants.USE_GPS;
//     private boolean updateOnLocationChange = Constants.REFRESH_DATA_ON_LOCATION_CHANGED;
//     private long updatesInterval = Constants.UPDATES_MAX_TIME;
//     private int updatesDistance = Constants.UPDATES_MAX_DISTANCE;
//     private long passiveUpdatesInterval = Constants.DEFAULT_INTERVAL_PASSIVE;
//     private int passiveUpdatesDistance = Constants.DEFAULT_DISTANCE_PASSIVE;
//     private boolean enablePassiveUpdates = Constants.ENABLE_PASSIVE_UPDATES;
// 
//     public LocatorSettings(String packageName, String updateAction) {
//         this.packageName = packageName;
//         this.updateAction = updateAction;
//     }
//     
//     public String getPackageName() {
//         return packageName;
//     }
// 
//     public String getUpdateAction() {
//         return updateAction;
//     }
//     
//     public boolean shouldUseGps() {
//         return useGps;
//     }
// 
//     public void setUseGps(boolean useGps) {
//         this.useGps = useGps;
//     }
// 
//     public boolean shouldUpdateLocation() {
//         return updateOnLocationChange;
//     }
// 
//     public void setUpdateOnLocationChange(boolean updateOnLocationChange) {
//         this.updateOnLocationChange = updateOnLocationChange;
//     }
// 
//     public boolean shouldEnablePassiveUpdates() {
//         return enablePassiveUpdates;
//     }
// 
//     public void setEnablePassiveUpdates(boolean enablePassiveUpdates) {
//         this.enablePassiveUpdates = enablePassiveUpdates;
//     }
// 
//     public long getUpdatesInterval() {
//         return updatesInterval;
//     }
// 
//     public void setUpdatesInterval(long updatesInterval) {
//         this.updatesInterval = updatesInterval;
//     }
// 
//     public int getUpdatesDistance() {
//         return updatesDistance;
//     }
// 
//     public void setUpdatesDistance(int updatesDistance) {
//         this.updatesDistance = updatesDistance;
//     }
// 
//     public long getPassiveUpdatesInterval() {
//         return passiveUpdatesInterval;
//     }
// 
//     public void setPassiveUpdatesInterval(long passiveUpdatesInterval) {
//         this.passiveUpdatesInterval = passiveUpdatesInterval;
//     }
// 
//     public int getPassiveUpdatesDistance() {
//         return passiveUpdatesDistance;
//     }
// 
//     public void setPassiveUpdatesDistance(int passiveUpdatesDistance) {
//         this.passiveUpdatesDistance = passiveUpdatesDistance;
//     }
// 
// }


// Path: core/src/main/java/com/novoda/location/provider/requester/LegacyLocationUpdateRequester.java
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.location.Criteria;
import android.location.LocationManager;
import com.novoda.location.LocatorSettings;

/**
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * Code modified by Novoda Ltd, 2011.
 */
package com.novoda.location.provider.requester;



/**
 * Provides support for initiating active and passive location updates for all
 * Android platforms from Android 1.6.
 * 
 * Uses broadcast Intents to notify the app of location changes.
 */
public class LegacyLocationUpdateRequester extends BaseLocationUpdateRequester {

    protected final AlarmManager alarmManager;
    private final LocatorSettings settings;

    protected LegacyLocationUpdateRequester(LocationManager locationManager, AlarmManager alarmManager, LocatorSettings settings) {
        super(locationManager);
        this.alarmManager = alarmManager;
        this.settings = settings;
    }

    @Override
    public void requestActiveLocationUpdates(long minTime, long minDistance, Criteria criteria, PendingIntent pendingIntent) {
        // Prior to Gingerbread we needed to find the best provider manually.
        // Note that we aren't monitoring this provider to check if it becomes
        // disabled - this is handled by the calling Activity.
        String provider = locationManager.getBestProvider(criteria, true);