// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/bridge/AutoRefresh.java
// public enum RequestType {
// 	CLIENT_MODE,
// 	PROJECTS,
// 	TASKS,
// 	TRANSFERS,
// 	MESSAGES
// }
// 
// Path: BoincRpc/src/main/java/edu/berkeley/boinc/NetStats.java
// public interface NetStats {
//     public abstract void connectionOpened();
//     public abstract void bytesReceived(int numBytes);
//     public abstract void bytesTransferred(int numBytes);
//     public abstract void connectionClosed();
// }


import sk.boinc.androboinc.BuildConfig;
import sk.boinc.androboinc.bridge.AutoRefresh.RequestType;
import sk.boinc.androboinc.clientconnection.ClientReplyReceiver;
import sk.boinc.androboinc.clientconnection.ClientRequestHandler;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.DisconnectCause;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.ProgressInd;
import sk.boinc.androboinc.clientconnection.HostInfo;
import sk.boinc.androboinc.clientconnection.MessageInfo;
import sk.boinc.androboinc.clientconnection.ModeInfo;
import sk.boinc.androboinc.clientconnection.ProjectInfo;
import sk.boinc.androboinc.clientconnection.TaskInfo;
import sk.boinc.androboinc.clientconnection.TransferInfo;
import sk.boinc.androboinc.clientconnection.VersionInfo;
import edu.berkeley.boinc.NetStats;
import sk.boinc.androboinc.util.ClientId;
import android.content.Context;
import android.os.ConditionVariable;
import android.util.Log;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;
			}
		}

		public void notifyDisconnected() {
			mConnected = false;
			Iterator<ClientReplyReceiver> it = mReceivers.iterator();
			while (it.hasNext()) {
				ClientReplyReceiver receiver = it.next();
				receiver.clientDisconnected();
				if (BuildConfig.DEBUG) Log.d(TAG, "Detached receiver: " + receiver.toString()); // see below clearing of all receivers
			}
			mReceivers.clear();
		}

		public void updatedClientMode(final ClientReplyReceiver callback, final ModeInfo modeInfo) {
			if (callback == null) {
				// No specific callback - broadcast to all receivers
				// This is used for early notification after connect
				Iterator<ClientReplyReceiver> it = mReceivers.iterator();
				while (it.hasNext()) {
					ClientReplyReceiver receiver = it.next();
					receiver.updatedClientMode(modeInfo);
				}
				return;
			}
			// Check whether callback is still present in receivers
			if (mReceivers.contains(callback)) {
				// Observer is still present, so we can call it back with data
				boolean periodicAllowed = callback.updatedClientMode(modeInfo);
				if (periodicAllowed) {
// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/bridge/AutoRefresh.java
// public enum RequestType {
// 	CLIENT_MODE,
// 	PROJECTS,
// 	TASKS,
// 	TRANSFERS,
// 	MESSAGES
// }
// 
// Path: BoincRpc/src/main/java/edu/berkeley/boinc/NetStats.java
// public interface NetStats {
//     public abstract void connectionOpened();
//     public abstract void bytesReceived(int numBytes);
//     public abstract void bytesTransferred(int numBytes);
//     public abstract void connectionClosed();
// }


// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/bridge/ClientBridge.java
import sk.boinc.androboinc.BuildConfig;
import sk.boinc.androboinc.bridge.AutoRefresh.RequestType;
import sk.boinc.androboinc.clientconnection.ClientReplyReceiver;
import sk.boinc.androboinc.clientconnection.ClientRequestHandler;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.DisconnectCause;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.ProgressInd;
import sk.boinc.androboinc.clientconnection.HostInfo;
import sk.boinc.androboinc.clientconnection.MessageInfo;
import sk.boinc.androboinc.clientconnection.ModeInfo;
import sk.boinc.androboinc.clientconnection.ProjectInfo;
import sk.boinc.androboinc.clientconnection.TaskInfo;
import sk.boinc.androboinc.clientconnection.TransferInfo;
import sk.boinc.androboinc.clientconnection.VersionInfo;
import edu.berkeley.boinc.NetStats;
import sk.boinc.androboinc.util.ClientId;
import android.content.Context;
import android.os.ConditionVariable;
import android.util.Log;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;

			}
		}

		public void notifyDisconnected() {
			mConnected = false;
			Iterator<ClientReplyReceiver> it = mReceivers.iterator();
			while (it.hasNext()) {
				ClientReplyReceiver receiver = it.next();
				receiver.clientDisconnected();
				if (BuildConfig.DEBUG) Log.d(TAG, "Detached receiver: " + receiver.toString()); // see below clearing of all receivers
			}
			mReceivers.clear();
		}

		public void updatedClientMode(final ClientReplyReceiver callback, final ModeInfo modeInfo) {
			if (callback == null) {
				// No specific callback - broadcast to all receivers
				// This is used for early notification after connect
				Iterator<ClientReplyReceiver> it = mReceivers.iterator();
				while (it.hasNext()) {
					ClientReplyReceiver receiver = it.next();
					receiver.updatedClientMode(modeInfo);
				}
				return;
			}
			// Check whether callback is still present in receivers
			if (mReceivers.contains(callback)) {
				// Observer is still present, so we can call it back with data
				boolean periodicAllowed = callback.updatedClientMode(modeInfo);
				if (periodicAllowed) {
					mAutoRefresh.scheduleAutomaticRefresh(callback, RequestType.CLIENT_MODE);