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

var SystemMojoService = Class.create( {
  initialize: function() {
  },
	
	getTimeFormat: function(callback) {
		if(Mojo.Host.current === Mojo.Host.mojoHost) {
			// Mock service response.
			callback.defer({timeFormat:'HH24'});
			return;
		}
		
		return new Mojo.Service.Request(SystemMojoService.identifier, {
			method: 'getPreferences',
			parameters: {
				keys: ["timeFormat"],
				subscribe: true
			},
			onSuccess: callback
		});
	},
	getSystemTime: function(callback) {
		if(Mojo.Host.current === Mojo.Host.mojoHost) {
			// Mock service response.
			callback.defer({unused:true});
			return;
		}
		
		return new Mojo.Service.Request(SystemMojoService.identifier, {
			method: 'time/getSystemTime',
			parameters: {
				subscribe: true
			},
			onSuccess: callback
		});
	}
	
});

SystemMojoService.identifier = 'palm://com.palm.systemservice';
