/* Copyright 2009 Palm, Inc.  All rights reserved. */

var LocationService = Class.create( {
	initialize: function() {
		
	},
	
	acceptTermsOfUse: function (useBackgroundDataCollection, successCallback, errorCallback, sceneController) {
		return sceneController.serviceRequest(LocationService.identifier, {
			method: 'acceptTermsOfUse',
			parameters: {"useBackgroundDataCollection": useBackgroundDataCollection},
			onSuccess: successCallback,
			onFailure: errorCallback
		});
	},
	
	rejectTermsOfUse: function(sceneController) {
		return sceneController.serviceRequest(LocationService.identifier, {
			method: 'rejectTermsOfUse',
			parameters: {}
		});
	},
	
	setAutoLocatePrefs: function (autoLocate, sceneController) {
		return sceneController.serviceRequest(LocationService.identifier, {
			method: 'setAutoLocate',
			parameters: {"autoLocate": autoLocate},
			onSuccess: function (response) {
				Mojo.Log.info("Set Auto locate prefs successful");
			},
			onFailure: function (response) {
				Mojo.Log.error("Set Auto locate prefs failed");
			}
		});
	}
	
	
});

LocationService.identifier = 'palm://com.palm.location'; 