// Path: src/com/bridgewalkerapp/androidclient/apidata/WebsocketRequest.java
// public abstract class WebsocketRequest {
// 	public enum AmountType { AMOUNT_BASED_ON_BTC
// 						   , AMOUNT_BASED_ON_USD_BEFORE_FEES
// 						   , AMOUNT_BASED_ON_USD_AFTER_FEES
// 	   					   }
// 
// 	public static final int TYPE_REQUEST_VERSION = 0;
// 	public static final int TYPE_CREATE_GUEST_ACCOUNT = 1;
// 	public static final int TYPE_LOGIN = 2;
// 	public static final int TYPE_REQUEST_STATUS = 3;
// 	public static final int TYPE_PING = 4;
// 	public static final int TYPE_REQUEST_QUOTE = 5;
// 	public static final int TYPE_SEND_PAYMENT = 6;
// 	
// 	abstract public int getRequestType();
// }
// 
// Path: src/com/bridgewalkerapp/androidclient/data/ParameterizedRunnable.java
// public interface ParameterizedRunnable {
// 	public void run(WebsocketReply reply);
// }
// 
// Path: src/com/bridgewalkerapp/androidclient/data/RequestAndRunnable.java
// public class RequestAndRunnable {
// 	private WebsocketRequest request;
// 	private ParameterizedRunnable runnable;
// 	
// 	public RequestAndRunnable(WebsocketRequest request, ParameterizedRunnable runnable) {
// 		this.request = request;
// 		this.runnable = runnable;
// 	}
// 
// 	public WebsocketRequest getRequest() {
// 		return request;
// 	}
// 
// 	public ParameterizedRunnable getRunnable() {
// 		return runnable;
// 	}
// }


import java.util.LinkedList;
import java.util.List;
import com.bridgewalkerapp.androidclient.apidata.WebsocketRequest;
import com.bridgewalkerapp.androidclient.data.ParameterizedRunnable;
import com.bridgewalkerapp.androidclient.data.RequestAndRunnable;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.os.Handler.Callback;
import android.os.Messenger;
	}
	
	public void unbindService() {
		if (this.isServiceBound) {
			try {
				Message msg = Message.obtain(null, BackendService.MSG_UNREGISTER_CLIENT);
				msg.replyTo = myMessenger;
				serviceMessenger.send(msg);
			} catch (RemoteException e) { /* can be ignored */ }
			
			this.context.unbindService(serviceConnection);
			isServiceBound = false;
		}
	}
	
	public void sendCommand(int what) {
		Message msg = Message.obtain(null, what);
		msg.replyTo = this.myMessenger;
		
		if (this.serviceMessenger != null) {
			try {
				this.serviceMessenger.send(msg);
			} catch (RemoteException e) {
				this.commandQueue.add(msg);
			}
		} else {
			this.commandQueue.add(msg);
		}
	}
	
// Path: src/com/bridgewalkerapp/androidclient/apidata/WebsocketRequest.java
// public abstract class WebsocketRequest {
// 	public enum AmountType { AMOUNT_BASED_ON_BTC
// 						   , AMOUNT_BASED_ON_USD_BEFORE_FEES
// 						   , AMOUNT_BASED_ON_USD_AFTER_FEES
// 	   					   }
// 
// 	public static final int TYPE_REQUEST_VERSION = 0;
// 	public static final int TYPE_CREATE_GUEST_ACCOUNT = 1;
// 	public static final int TYPE_LOGIN = 2;
// 	public static final int TYPE_REQUEST_STATUS = 3;
// 	public static final int TYPE_PING = 4;
// 	public static final int TYPE_REQUEST_QUOTE = 5;
// 	public static final int TYPE_SEND_PAYMENT = 6;
// 	
// 	abstract public int getRequestType();
// }
// 
// Path: src/com/bridgewalkerapp/androidclient/data/ParameterizedRunnable.java
// public interface ParameterizedRunnable {
// 	public void run(WebsocketReply reply);
// }
// 
// Path: src/com/bridgewalkerapp/androidclient/data/RequestAndRunnable.java
// public class RequestAndRunnable {
// 	private WebsocketRequest request;
// 	private ParameterizedRunnable runnable;
// 	
// 	public RequestAndRunnable(WebsocketRequest request, ParameterizedRunnable runnable) {
// 		this.request = request;
// 		this.runnable = runnable;
// 	}
// 
// 	public WebsocketRequest getRequest() {
// 		return request;
// 	}
// 
// 	public ParameterizedRunnable getRunnable() {
// 		return runnable;
// 	}
// }


// Path: src/com/bridgewalkerapp/androidclient/ServiceUtils.java
import java.util.LinkedList;
import java.util.List;
import com.bridgewalkerapp.androidclient.apidata.WebsocketRequest;
import com.bridgewalkerapp.androidclient.data.ParameterizedRunnable;
import com.bridgewalkerapp.androidclient.data.RequestAndRunnable;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.os.Handler.Callback;
import android.os.Messenger;

	}
	
	public void unbindService() {
		if (this.isServiceBound) {
			try {
				Message msg = Message.obtain(null, BackendService.MSG_UNREGISTER_CLIENT);
				msg.replyTo = myMessenger;
				serviceMessenger.send(msg);
			} catch (RemoteException e) { /* can be ignored */ }
			
			this.context.unbindService(serviceConnection);
			isServiceBound = false;
		}
	}
	
	public void sendCommand(int what) {
		Message msg = Message.obtain(null, what);
		msg.replyTo = this.myMessenger;
		
		if (this.serviceMessenger != null) {
			try {
				this.serviceMessenger.send(msg);
			} catch (RemoteException e) {
				this.commandQueue.add(msg);
			}
		} else {
			this.commandQueue.add(msg);
		}
	}
	
	public void sendCommand(WebsocketRequest request, ParameterizedRunnable runnable) {