// Path: java/anyremote/client/android/util/Address.java
// public class Address {
// 	public String name;
// 	public String URL;
// 	public String pass;	
// 	public boolean autoconnect;	
// }
// 
// Path: java/anyremote/client/android/util/InfoMessage.java
// public class InfoMessage {
// 	public int id;
// 	public int stage;
// }
// 
// Path: java/anyremote/client/android/util/ListItem.java
// public class ListItem {
// 	public String text;
//     public String icon;
// }
// 
// Path: java/anyremote/client/android/util/ProtocolMessage.java
// public class ProtocolMessage {
// 	public static final int FULL     = 0;
// 	public static final int FIRST    = 1;
// 	public static final int INTERMED = 2;
// 	public static final int LAST     = 3;
// 	
// 	public int id;
// 	public int stage;
// 	public Vector tokens;
// }


import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.TimerTask;
import java.util.Vector;
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;
import anyremote.client.android.util.Address;
import anyremote.client.android.util.InfoMessage;
import anyremote.client.android.util.ListItem;
import anyremote.client.android.util.ProtocolMessage;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
					resp = "CoverExists(,"+name+")";
				} else {
					resp = "CoverNotExists(,"+name+")";
				}
				queueCommand(resp);
			}
			break;

		default:
			
			log("handleCommand: Command or handler unknown");
		}
	}
	
	public synchronized void sendToActivity(int activity, int id, int stage) {
		
		log("sendToActivity to "+anyRemote.getScreenStr(activity)+" "+cmdStr(id));
		
		QueueMessage pm = new QueueMessage();
		pm.activity       = activity;
		pm.id             = id;
		pm.stage          = stage;
		pm.attemptsToSend = 0;
		
		synchronized (syncObj) {
		    msgQueue.add(0,pm);
		}
		processMessageQueue();
	}
	
// Path: java/anyremote/client/android/util/Address.java
// public class Address {
// 	public String name;
// 	public String URL;
// 	public String pass;	
// 	public boolean autoconnect;	
// }
// 
// Path: java/anyremote/client/android/util/InfoMessage.java
// public class InfoMessage {
// 	public int id;
// 	public int stage;
// }
// 
// Path: java/anyremote/client/android/util/ListItem.java
// public class ListItem {
// 	public String text;
//     public String icon;
// }
// 
// Path: java/anyremote/client/android/util/ProtocolMessage.java
// public class ProtocolMessage {
// 	public static final int FULL     = 0;
// 	public static final int FIRST    = 1;
// 	public static final int INTERMED = 2;
// 	public static final int LAST     = 3;
// 	
// 	public int id;
// 	public int stage;
// 	public Vector tokens;
// }


// Path: java/anyremote/client/android/Dispatcher.java
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.TimerTask;
import java.util.Vector;
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;
import anyremote.client.android.util.Address;
import anyremote.client.android.util.InfoMessage;
import anyremote.client.android.util.ListItem;
import anyremote.client.android.util.ProtocolMessage;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;

					resp = "CoverExists(,"+name+")";
				} else {
					resp = "CoverNotExists(,"+name+")";
				}
				queueCommand(resp);
			}
			break;

		default:
			
			log("handleCommand: Command or handler unknown");
		}
	}
	
	public synchronized void sendToActivity(int activity, int id, int stage) {
		
		log("sendToActivity to "+anyRemote.getScreenStr(activity)+" "+cmdStr(id));
		
		QueueMessage pm = new QueueMessage();
		pm.activity       = activity;
		pm.id             = id;
		pm.stage          = stage;
		pm.attemptsToSend = 0;
		
		synchronized (syncObj) {
		    msgQueue.add(0,pm);
		}
		processMessageQueue();
	}
	
	public int messageQueueSize() {