// 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;
		    return msgQueue.size();
		}
	}
		
	private synchronized void processMessageQueue() {
		
		final Iterator<QueueMessage> msgItr = msgQueue.iterator();
		
		while (msgItr.hasNext()) {
			
			final QueueMessage pm = msgItr.next();
			
			boolean sent = false;
			
			synchronized (syncObj) {
				
			    final Iterator<ArHandler> itr = actHandlers.iterator();
				log("processMessageQueue MSG " + cmdStr(pm.id) + " handlers #" + actHandlers.size());
	
				while (itr.hasNext()) {
					try {
						final ArHandler handler = itr.next();
						if (pm.activity < 0 || // send to all
						    handler.actId == pm.activity) {
	
							log("processMessageQueue MSG " + cmdStr(pm.id) + 
							    " to " + anyRemote.getScreenStr(pm.activity) + 
							    " SENT (attempt " + pm.attemptsToSend + ") to "+ 
							    anyRemote.getScreenStr(handler.actId));
													
// 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;

		    return msgQueue.size();
		}
	}
		
	private synchronized void processMessageQueue() {
		
		final Iterator<QueueMessage> msgItr = msgQueue.iterator();
		
		while (msgItr.hasNext()) {
			
			final QueueMessage pm = msgItr.next();
			
			boolean sent = false;
			
			synchronized (syncObj) {
				
			    final Iterator<ArHandler> itr = actHandlers.iterator();
				log("processMessageQueue MSG " + cmdStr(pm.id) + " handlers #" + actHandlers.size());
	
				while (itr.hasNext()) {
					try {
						final ArHandler handler = itr.next();
						if (pm.activity < 0 || // send to all
						    handler.actId == pm.activity) {
	
							log("processMessageQueue MSG " + cmdStr(pm.id) + 
							    " to " + anyRemote.getScreenStr(pm.activity) + 
							    " SENT (attempt " + pm.attemptsToSend + ") to "+ 
							    anyRemote.getScreenStr(handler.actId));
													
							InfoMessage im = new InfoMessage();