// Path: core/src/main/java/com/novoda/location/provider/LocationProviderFactory.java
// public class LocationProviderFactory {
// 
//     public LastLocationFinder getLastLocationFinder(LocationManager locationManager, Context context) {
//     	if(ApiLevelDetector.supportsGingerbread()) {
//     		return new GingerbreadLastLocationFinder(locationManager, context);
//     	}
//         return new LegacyLastLocationFinder(locationManager, context);
//     }
// 
//     public LocationUpdateRequester getLocationUpdateRequester(LocationManager locationManager) {
//     	if(ApiLevelDetector.supportsGingerbread()) {
//     		return new GingerbreadLocationUpdateRequester(locationManager);
//     	}
//         return new FroyoLocationUpdateRequester(locationManager); 
//     }
//     
//     public SettingsDao getSettingsDao() {
//     	return new SharedPreferenceSettingsDao();
//     }
// 
// }
// 
// Path: core/src/main/java/com/novoda/location/provider/LocationUpdateRequester.java
// public interface LocationUpdateRequester {
// 
// 	void requestActiveLocationUpdates(long minTime, long minDistance,
// 			Criteria criteria, PendingIntent pendingIntent) throws NoProviderAvailable;
// 
// 	void requestPassiveLocationUpdates(Context context,
// 			PendingIntent pendingIntent);
// 
// 	void requestPassiveLocationUpdates(LocatorSettings settings,
// 			PendingIntent pendingIntent);
// 	
// 	void removeLocationUpdates(PendingIntent pendingIntent);
// }
// 
// Path: core/src/main/java/com/novoda/location/provider/store/SettingsDao.java
// public interface SettingsDao {
// 
// 	long getPassiveLocationInterval(Context context);
// 
// 	int getPassiveLocationDistance(Context context);
// 
// 	void persistSettingsToPreferences(Context context, LocatorSettings settings);
// 
// 	boolean isRunOnce(Context context);
// 
// 	boolean isPassiveLocationChanges(Context context);
// 
// }


import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import com.novoda.location.provider.LocationProviderFactory;
import com.novoda.location.provider.LocationUpdateRequester;
import com.novoda.location.provider.store.SettingsDao;

/**
 * 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.receiver;



public class RestorePassiveListenerBoot extends BroadcastReceiver {

    @Override
    public void onReceive(Context c, Intent intent) {

// Path: core/src/main/java/com/novoda/location/provider/LocationProviderFactory.java
// public class LocationProviderFactory {
// 
//     public LastLocationFinder getLastLocationFinder(LocationManager locationManager, Context context) {
//     	if(ApiLevelDetector.supportsGingerbread()) {
//     		return new GingerbreadLastLocationFinder(locationManager, context);
//     	}
//         return new LegacyLastLocationFinder(locationManager, context);
//     }
// 
//     public LocationUpdateRequester getLocationUpdateRequester(LocationManager locationManager) {
//     	if(ApiLevelDetector.supportsGingerbread()) {
//     		return new GingerbreadLocationUpdateRequester(locationManager);
//     	}
//         return new FroyoLocationUpdateRequester(locationManager); 
//     }
//     
//     public SettingsDao getSettingsDao() {
//     	return new SharedPreferenceSettingsDao();
//     }
// 
// }
// 
// Path: core/src/main/java/com/novoda/location/provider/LocationUpdateRequester.java
// public interface LocationUpdateRequester {
// 
// 	void requestActiveLocationUpdates(long minTime, long minDistance,
// 			Criteria criteria, PendingIntent pendingIntent) throws NoProviderAvailable;
// 
// 	void requestPassiveLocationUpdates(Context context,
// 			PendingIntent pendingIntent);
// 
// 	void requestPassiveLocationUpdates(LocatorSettings settings,
// 			PendingIntent pendingIntent);
// 	
// 	void removeLocationUpdates(PendingIntent pendingIntent);
// }
// 
// Path: core/src/main/java/com/novoda/location/provider/store/SettingsDao.java
// public interface SettingsDao {
// 
// 	long getPassiveLocationInterval(Context context);
// 
// 	int getPassiveLocationDistance(Context context);
// 
// 	void persistSettingsToPreferences(Context context, LocatorSettings settings);
// 
// 	boolean isRunOnce(Context context);
// 
// 	boolean isPassiveLocationChanges(Context context);
// 
// }


// Path: core/src/main/java/com/novoda/location/receiver/RestorePassiveListenerBoot.java
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import com.novoda.location.provider.LocationProviderFactory;
import com.novoda.location.provider.LocationUpdateRequester;
import com.novoda.location.provider.store.SettingsDao;

/**
 * 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.receiver;



public class RestorePassiveListenerBoot extends BroadcastReceiver {

    @Override
    public void onReceive(Context c, Intent intent) {

    	SettingsDao settingsDao = new LocationProviderFactory().getSettingsDao();
