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

var OtaspService = Class.create( {
	
	initialize: function() {
		
	},
	
	activateDevice: function(carrierName, activationNumber) {
		return new Mojo.Service.Request("palm://com.palm.applicationManager/open", {
			parameters: {
				id: 'com.palm.app.phone',
				params: {
					"number": activationNumber,
					"firstuse":true,
					"otasp": true,
					"name": carrierName,
					"locale": Account.language + '_' + Account.country
				}
			}
		});
	},
	
	subscribeToOtaspEvent: function (successCallback, errorCallback) {
		return new Mojo.Service.Request(NovaAccountService.telephonyServiceIdentifier, {
			method: 'subscribe',
			parameters: {"events":"otasp", "subscribe": true},
			onSuccess: successCallback,
			onFailure: errorCallback
		});
	},
	
	disconnectCalls: function() {
		return new Mojo.Service.Request("palm://com.palm.applicationManager/open", {
			parameters: {
				id: 'com.palm.app.phone',
				params: {
					"firstuse":true,
					"action":"disconnect",					
					"locale": Account.language + '_' + Account.country
				}
			}
		});
	}
}); 