Merge avec Nikita
authorDa Risk <darisk972@gmail.com>
Sat, 04 Apr 2009 19:02:11 +0200
changeset 68 0c76c67a2b99
parent 67 8c3870db8e31 (diff)
parent 66 661aa8634e98 (current diff)
child 69 cc06de2dfff0
child 72 cdedc3a25d39
Merge avec Nikita
res/layout/beem.xml
res/layout/beemdialogsettings.xml
res/menu/beemmenu.xml
src/com/beem/project/beem/BeemApplication.java
src/com/beem/project/beem/service/XmppConnectionAdapter.java
src/com/beem/project/beem/service/XmppFacade.java
src/com/beem/project/beem/ui/Beem.java
src/com/beem/project/beem/ui/BeemDialogSettings.java
src/com/beem/project/beem/ui/ContactList.java
--- a/src/com/beem/project/beem/BeemApplication.java	Sat Apr 04 10:13:51 2009 +0200
+++ b/src/com/beem/project/beem/BeemApplication.java	Sat Apr 04 19:02:11 2009 +0200
@@ -18,7 +18,7 @@
 import android.os.IBinder;
 import android.os.Message;
 
-import com.beem.project.beem.service.aidl.IXMPPFacade;
+import com.beem.project.beem.service.aidl.IXmppFacade;
 
 /**
  * The Beem application.
@@ -28,15 +28,12 @@
 public class BeemApplication extends Application {
 
     private static BeemApplication mBeemApp;
-    private IXMPPFacade mFacade;
-
+    private IXmppFacade mFacade;
     private Context mApplicationContext;
     private Resources mPrivateResources;
     private List<Message> mQueue = new LinkedList<Message>();
     private boolean mIsConnected;
 
-
-
     private ServiceConnection mServConn = new ServiceConnection() {
 
 	@Override
@@ -48,7 +45,7 @@
 	@Override
 	public void onServiceConnected(ComponentName name, IBinder service) {
 	    // TODO Auto-generated method stub
-	    mFacade = IXMPPFacade.Stub.asInterface(service);
+	    mFacade = IXmppFacade.Stub.asInterface(service);
 	    synchronized (mQueue) {
 		for (Message msg : mQueue) {
 		    msg.sendToTarget();
@@ -149,7 +146,7 @@
      * Get the facade to use to access the Beem service.
      * @return	the facade or null if the application is not connected to the beem service.
      */
-    public IXMPPFacade getXmppFacade() {
+    public IXmppFacade getXmppFacade() {
 	return mFacade;
     }
 
--- a/src/com/beem/project/beem/BeemService.java	Sat Apr 04 10:13:51 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java	Sat Apr 04 19:02:11 2009 +0200
@@ -10,9 +10,9 @@
 import android.os.RemoteException;
 import android.widget.Toast;
 
-import com.beem.project.beem.service.XMPPConnectionAdapter;
-import com.beem.project.beem.service.XMPPFacade;
-import com.beem.project.beem.service.aidl.IXMPPFacade;
+import com.beem.project.beem.service.XmppConnectionAdapter;
+import com.beem.project.beem.service.XmppFacade;
+import com.beem.project.beem.service.aidl.IXmppFacade;
 import com.beem.project.beem.service.aidl.IXmppConnection;
 /**
  * This class is for the Beem service.
@@ -29,7 +29,7 @@
     private String mPassword;
     private String mHost;
 
-    private IXMPPFacade.Stub mBind;
+    private IXmppFacade.Stub mBind;
 
     /**
      * {@inheritDoc}
@@ -55,8 +55,8 @@
 		getString(R.string.PreferencePasswordKey), "");
 	mHost = mSettings.getString(getString(R.string.PreferenceHostKey), "");
 	mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
-	mConnection = new XMPPConnectionAdapter("10.0.2.2", mLogin, mPassword); // address
-	mBind = new XMPPFacade((XMPPConnectionAdapter) mConnection);
+	mConnection = new XmppConnectionAdapter("10.0.2.2", mLogin, mPassword); // address
+	mBind = new XmppFacade((XmppConnectionAdapter) mConnection);
     }
 
     /**
--- a/src/com/beem/project/beem/service/XMPPConnectionAdapter.java	Sat Apr 04 10:13:51 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,319 +0,0 @@
-/**
- *
- */
-package com.beem.project.beem.service;
-
-import org.jivesoftware.smack.ConnectionConfiguration;
-import org.jivesoftware.smack.ConnectionListener;
-import org.jivesoftware.smack.Roster;
-import org.jivesoftware.smack.XMPPConnection;
-import org.jivesoftware.smack.XMPPException;
-import org.jivesoftware.smackx.ServiceDiscoveryManager;
-import org.jivesoftware.smackx.jingle.JingleManager;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-import android.util.Log;
-import com.beem.project.beem.BeemException;
-import com.beem.project.beem.service.aidl.IBeemConnectionListener;
-import com.beem.project.beem.service.aidl.IChatManager;
-import com.beem.project.beem.service.aidl.IRoster;
-import com.beem.project.beem.service.aidl.IXmppConnection;
-
-/**
- * This class implements an adapter for XMPPConnection.
- * @author darisk
- */
-public class XMPPConnectionAdapter extends IXmppConnection.Stub {
-
-	private static final String TAG = "XMPPConnectionAdapter";
-	private XMPPConnection mAdaptee;
-	private IChatManager mChatManager;
-	private String mLogin;
-	private String mPassword;
-	private RosterAdapter mRoster;
-
-	private RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners =
-		new RemoteCallbackList<IBeemConnectionListener>();
-	private ConnexionListenerAdapter mConListener = new ConnexionListenerAdapter();
-	private Object mLastException;
-
-	/**
-	 * Constructor.
-	 * @param con The connection to adapt
-	 * @param login The login to use
-	 * @param password The password to use
-	 */
-	public XMPPConnectionAdapter(final XMPPConnection con, final String login, final String password) {
-		mAdaptee = con;
-		mLogin = login;
-		mPassword = password;
-	}
-
-	/**
-	 * Constructor.
-	 * @param serviceName name of the service to connect to
-	 * @param login login to use on connect
-	 * @param password password to use on connect
-	 */
-	public XMPPConnectionAdapter(final String serviceName, final String login, final String password) {
-		
-		this(new XMPPConnection(serviceName), login, password);
-		XMPPConnection.DEBUG_ENABLED = true;
-	}
-
-	/**
-	 * Constructor.
-	 * @param config Configuration to use in order to connect
-	 * @param login login to use on connect
-	 * @param password password to use on connect
-	 */
-	public XMPPConnectionAdapter(final ConnectionConfiguration config, final String login, final String password) {
-		this(new XMPPConnection(config), login, password);
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public boolean connectSync() throws RemoteException {
-		try {
-			mAdaptee.connect();
-			mAdaptee.addConnectionListener(mConListener);
-			mAdaptee.login(mLogin, mPassword, "BEEM");
-			mChatManager = new BeemChatManager(mAdaptee.getChatManager());
-			// TODO find why this cause a null pointer exception
-			//this.initFeatures(); // pour declarer les features xmpp qu'on supporte
-			mLastException = null;
-			triggerAsynchronousConnectEvent();
-			return true;
-		} catch (XMPPException e) {
-			mLastException = new BeemException(e);
-		}
-		return false;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public boolean disconnect() {
-		mAdaptee.disconnect();
-		mLastException = null;
-		return true;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public IRoster getRoster() throws RemoteException {
-		if (mRoster != null)
-			return mRoster;
-		Roster adap = mAdaptee.getRoster();
-		if (adap == null)
-			return null;
-		mRoster = new RosterAdapter(adap);
-		return mRoster;
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public final void connectAsync() throws RemoteException {
-		Thread t = new Thread(new Runnable() {
-
-			@Override
-			public void run() {
-				try {
-					connectSync();
-				} catch (RemoteException e) {
-					Log.e(TAG, "Error while connecting", e);
-				}
-			}
-		});
-		t.start();
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public void addConnectionListener(IBeemConnectionListener listen) throws RemoteException {
-		if (listen != null)
-			mRemoteConnListeners.register(listen);
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public void removeConnectionListener(IBeemConnectionListener listen) throws RemoteException {
-		if (listen != null)
-			mRemoteConnListeners.unregister(listen);
-	}
-
-	/**
-	 * {@inheritDoc}
-	 */
-	@Override
-	public IChatManager getChatManager() throws RemoteException {
-		return mChatManager;
-	}
-
-	/**
-	 * Trigger Connection event.
-	 */
-	private void triggerAsynchronousConnectEvent() {
-		mConListener.onConnect();
-	}
-	
-	/**
-	 * enregistre les features dispo dans notre version Liste de features que Telepathy supporte.
-	 */
-	private void initFeatures() {
-		JingleManager.setJingleServiceEnabled();
-		ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mAdaptee);
-		sdm.addFeature("http://jabber.org/protocol/disco#info");
-		// sdm.addFeature("http://jabber.org/protocol/nick");
-
-	}
-	
-	/**
-	 * Listener for XMPP connection events.
-	 * It will calls the remote listeners for connexion events.
-	 * @author darisk
-	 */
-	private class ConnexionListenerAdapter implements ConnectionListener {
-
-		/**
-		 * Defaut constructor.
-		 */
-		public ConnexionListenerAdapter() {
-			// TODO Auto-generated constructor stub
-		}
-
-		/**
-		 * Method to execute when a connection event occurs.
-		 */
-		public void onConnect() {
-			final int n = mRemoteConnListeners.beginBroadcast();
-
-			for (int i = 0; i < n; i++) {
-				IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-				try {
-					listener.onConnect();
-				} catch (RemoteException e) {
-					// The RemoteCallbackList will take care of removing the
-					// dead listeners.
-					Log.w(TAG, "Error while triggering remote connection listeners", e);
-				}
-			}
-			mRemoteConnListeners.finishBroadcast();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 */
-		@Override
-		public void connectionClosed() {
-			final int n = mRemoteConnListeners.beginBroadcast();
-
-			for (int i = 0; i < n; i++) {
-				IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-				try {
-					listener.connectionClosed();
-				} catch (RemoteException e) {
-					// The RemoteCallbackList will take care of removing the
-					// dead listeners.
-					Log.w(TAG, "Error while triggering remote connection listeners", e);
-				}
-			}
-			mRemoteConnListeners.finishBroadcast();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 */
-		@Override
-		public void connectionClosedOnError(Exception arg0) {
-			final int n = mRemoteConnListeners.beginBroadcast();
-
-			for (int i = 0; i < n; i++) {
-				IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-				try {
-					listener.connectionClosedOnError();
-				} catch (RemoteException e) {
-					// The RemoteCallbackList will take care of removing the
-					// dead listeners.
-					Log.w(TAG, "Error while triggering remote connection listeners", e);
-				}
-			}
-			mRemoteConnListeners.finishBroadcast();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 */
-		@Override
-		public void reconnectingIn(int arg0) {
-			final int n = mRemoteConnListeners.beginBroadcast();
-
-			for (int i = 0; i < n; i++) {
-				IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-				try {
-					listener.reconnectingIn(arg0);
-				} catch (RemoteException e) {
-					// The RemoteCallbackList will take care of removing the
-					// dead listeners.
-				}
-			}
-			mRemoteConnListeners.finishBroadcast();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 */
-		@Override
-		public void reconnectionFailed(Exception arg0) {
-			final int r = mRemoteConnListeners.beginBroadcast();
-
-			for (int i = 0; i < r; i++) {
-				IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-				try {
-					listener.reconnectionFailed();
-				} catch (RemoteException e) {
-					// The RemoteCallbackList will take care of removing the
-					// dead listeners.
-					Log.w(TAG, "Error while triggering remote connection listeners", e);
-				}
-			}
-			mRemoteConnListeners.finishBroadcast();
-		}
-
-		/**
-		 * {@inheritDoc}
-		 */
-		@Override
-		public void reconnectionSuccessful() {
-			final int n = mRemoteConnListeners.beginBroadcast();
-
-			for (int i = 0; i < n; i++) {
-				IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-				try {
-					listener.reconnectionSuccessful();
-				} catch (RemoteException e) {
-					// The RemoteCallbackList will take care of removing the
-					// dead listeners.
-					Log.w(TAG, "Error while triggering remote connection listeners", e);
-				}
-			}
-			mRemoteConnListeners.finishBroadcast();
-		}
-		 
-	}
-    public boolean isAuthentificated() throws RemoteException {
-		return mAdaptee.isAuthenticated();
-    }
-
-}
--- a/src/com/beem/project/beem/service/XMPPFacade.java	Sat Apr 04 10:13:51 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-package com.beem.project.beem.service;
-import android.os.RemoteException;
-
-import com.beem.project.beem.service.aidl.IChatManager;
-import com.beem.project.beem.service.aidl.IRoster;
-import com.beem.project.beem.service.aidl.IXmppConnection;
-import com.beem.project.beem.service.aidl.IXMPPFacade;
-
-/**
- * This class is a facade for the Beem Service.
- * @author darisk
- */
-public class XMPPFacade extends IXMPPFacade.Stub {
-
-    private XMPPConnectionAdapter mConnexion;
-
-    /**
-     * Constructor for XMPPFacade.
-     * @param connection the connection use by the facade
-     */
-    public XMPPFacade(final XMPPConnectionAdapter connection) {
-	this.mConnexion = connection;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void connectAsync() throws RemoteException {
-	mConnexion.connectAsync();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void connectSync() throws RemoteException {
-	mConnexion.connectSync();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public IXmppConnection createConnection() throws RemoteException {
-	return mConnexion;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void disconnect() throws RemoteException {
-	mConnexion.disconnect();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public IRoster getRoster() throws RemoteException {
-	return mConnexion.getRoster();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public IChatManager getChatManager() throws RemoteException {
-	return mConnexion.getChatManager();
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Sat Apr 04 19:02:11 2009 +0200
@@ -0,0 +1,316 @@
+/**
+ *
+ */
+package com.beem.project.beem.service;
+
+import org.jivesoftware.smack.ConnectionConfiguration;
+import org.jivesoftware.smack.ConnectionListener;
+import org.jivesoftware.smack.Roster;
+import org.jivesoftware.smack.XMPPConnection;
+import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smackx.ServiceDiscoveryManager;
+import org.jivesoftware.smackx.jingle.JingleManager;
+import android.os.RemoteCallbackList;
+import android.os.RemoteException;
+import android.util.Log;
+import com.beem.project.beem.BeemException;
+import com.beem.project.beem.service.aidl.IBeemConnectionListener;
+import com.beem.project.beem.service.aidl.IChatManager;
+import com.beem.project.beem.service.aidl.IRoster;
+import com.beem.project.beem.service.aidl.IXmppConnection;
+
+/**
+ * This class implements an adapter for XMPPConnection.
+ * @author darisk
+ */
+public class XmppConnectionAdapter extends IXmppConnection.Stub {
+
+    private static final String TAG = "XMPPConnectionAdapter";
+    private XMPPConnection mAdaptee;
+    private IChatManager mChatManager;
+    private String mLogin;
+    private String mPassword;
+    private RosterAdapter mRoster;
+    private Object mLastException;
+
+    private RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners = new RemoteCallbackList<IBeemConnectionListener>();
+    private ConnexionListenerAdapter mConListener = new ConnexionListenerAdapter();
+
+    /**
+     * Constructor.
+     * @param con The connection to adapt
+     * @param login The login to use
+     * @param password The password to use
+     */
+    public XmppConnectionAdapter(final XMPPConnection con, final String login, final String password) {
+	mAdaptee = con;
+	mLogin = login;
+	mPassword = password;
+    }
+
+    /**
+     * Constructor.
+     * @param serviceName name of the service to connect to
+     * @param login login to use on connect
+     * @param password password to use on connect
+     */
+    public XmppConnectionAdapter(final String serviceName, final String login, final String password) {
+	this(new XMPPConnection(serviceName), login, password);
+    }
+
+    /**
+     * Constructor.
+     * @param config Configuration to use in order to connect
+     * @param login login to use on connect
+     * @param password password to use on connect
+     */
+    public XmppConnectionAdapter(final ConnectionConfiguration config, final String login, final String password) {
+	this(new XMPPConnection(config), login, password);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean connectSync() throws RemoteException {
+	try {
+	    mAdaptee.connect();
+	    mAdaptee.addConnectionListener(mConListener);
+	    mAdaptee.login(mLogin, mPassword, "BEEM");
+	    mChatManager = new BeemChatManager(mAdaptee.getChatManager());
+	    // TODO find why this cause a null pointer exception
+	    // this.initFeatures(); // pour declarer les features xmpp qu'on supporte
+	    mLastException = null;
+	    triggerAsynchronousConnectEvent();
+	    return true;
+	} catch (XMPPException e) {
+	    mLastException = new BeemException(e);
+	}
+	return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean disconnect() {
+	mAdaptee.disconnect();
+	mLastException = null;
+	return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IRoster getRoster() throws RemoteException {
+	if (mRoster != null)
+	    return mRoster;
+	Roster adap = mAdaptee.getRoster();
+	if (adap == null)
+	    return null;
+	mRoster = new RosterAdapter(adap);
+	return mRoster;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public final void connectAsync() throws RemoteException {
+	Thread t = new Thread(new Runnable() {
+
+	    @Override
+	    public void run() {
+		try {
+		    connectSync();
+		} catch (RemoteException e) {
+		    Log.e(TAG, "Error while connecting", e);
+		}
+	    }
+	});
+	t.start();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void addConnectionListener(IBeemConnectionListener listen) throws RemoteException {
+	if (listen != null)
+	    mRemoteConnListeners.register(listen);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void removeConnectionListener(IBeemConnectionListener listen) throws RemoteException {
+	if (listen != null)
+	    mRemoteConnListeners.unregister(listen);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IChatManager getChatManager() throws RemoteException {
+	return mChatManager;
+    }
+
+    /**
+     * Trigger Connection event.
+     */
+    private void triggerAsynchronousConnectEvent() {
+	mConListener.onConnect();
+    }
+
+    /**
+     * enregistre les features dispo dans notre version Liste de features que Telepathy supporte.
+     */
+    private void initFeatures() {
+	JingleManager.setJingleServiceEnabled();
+	ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(mAdaptee);
+	sdm.addFeature("http://jabber.org/protocol/disco#info");
+	// sdm.addFeature("http://jabber.org/protocol/nick");
+
+    }
+
+    /**
+     * Listener for XMPP connection events. It will calls the remote listeners for connexion events.
+     * @author darisk
+     */
+    private class ConnexionListenerAdapter implements ConnectionListener {
+
+	/**
+	 * Defaut constructor.
+	 */
+	public ConnexionListenerAdapter() {
+	    // TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * Method to execute when a connection event occurs.
+	 */
+	public void onConnect() {
+	    final int n = mRemoteConnListeners.beginBroadcast();
+
+	    for (int i = 0; i < n; i++) {
+		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
+		try {
+		    listener.onConnect();
+		} catch (RemoteException e) {
+		    // The RemoteCallbackList will take care of removing the
+		    // dead listeners.
+		    Log.w(TAG, "Error while triggering remote connection listeners", e);
+		}
+	    }
+	    mRemoteConnListeners.finishBroadcast();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public void connectionClosed() {
+	    final int n = mRemoteConnListeners.beginBroadcast();
+
+	    for (int i = 0; i < n; i++) {
+		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
+		try {
+		    listener.connectionClosed();
+		} catch (RemoteException e) {
+		    // The RemoteCallbackList will take care of removing the
+		    // dead listeners.
+		    Log.w(TAG, "Error while triggering remote connection listeners", e);
+		}
+	    }
+	    mRemoteConnListeners.finishBroadcast();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public void connectionClosedOnError(Exception arg0) {
+	    final int n = mRemoteConnListeners.beginBroadcast();
+
+	    for (int i = 0; i < n; i++) {
+		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
+		try {
+		    listener.connectionClosedOnError();
+		} catch (RemoteException e) {
+		    // The RemoteCallbackList will take care of removing the
+		    // dead listeners.
+		    Log.w(TAG, "Error while triggering remote connection listeners", e);
+		}
+	    }
+	    mRemoteConnListeners.finishBroadcast();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public void reconnectingIn(int arg0) {
+	    final int n = mRemoteConnListeners.beginBroadcast();
+
+	    for (int i = 0; i < n; i++) {
+		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
+		try {
+		    listener.reconnectingIn(arg0);
+		} catch (RemoteException e) {
+		    // The RemoteCallbackList will take care of removing the
+		    // dead listeners.
+		}
+	    }
+	    mRemoteConnListeners.finishBroadcast();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public void reconnectionFailed(Exception arg0) {
+	    final int r = mRemoteConnListeners.beginBroadcast();
+
+	    for (int i = 0; i < r; i++) {
+		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
+		try {
+		    listener.reconnectionFailed();
+		} catch (RemoteException e) {
+		    // The RemoteCallbackList will take care of removing the
+		    // dead listeners.
+		    Log.w(TAG, "Error while triggering remote connection listeners", e);
+		}
+	    }
+	    mRemoteConnListeners.finishBroadcast();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public void reconnectionSuccessful() {
+	    final int n = mRemoteConnListeners.beginBroadcast();
+
+	    for (int i = 0; i < n; i++) {
+		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
+		try {
+		    listener.reconnectionSuccessful();
+		} catch (RemoteException e) {
+		    // The RemoteCallbackList will take care of removing the
+		    // dead listeners.
+		    Log.w(TAG, "Error while triggering remote connection listeners", e);
+		}
+	    }
+	    mRemoteConnListeners.finishBroadcast();
+	}
+
+    }
+
+    public boolean isAuthentificated() throws RemoteException {
+	return mAdaptee.isAuthenticated();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/XmppFacade.java	Sat Apr 04 19:02:11 2009 +0200
@@ -0,0 +1,73 @@
+package com.beem.project.beem.service;
+import android.os.RemoteException;
+
+import com.beem.project.beem.service.aidl.IChatManager;
+import com.beem.project.beem.service.aidl.IRoster;
+import com.beem.project.beem.service.aidl.IXmppConnection;
+import com.beem.project.beem.service.aidl.IXmppFacade;;
+
+/**
+ * This class is a facade for the Beem Service.
+ * @author darisk
+ */
+public class XmppFacade extends IXmppFacade.Stub {
+
+    private XmppConnectionAdapter mConnexion;
+
+    /**
+     * Constructor for XMPPFacade.
+     * @param connection the connection use by the facade
+     */
+    public XmppFacade(final XmppConnectionAdapter connection) {
+	this.mConnexion = connection;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void connectAsync() throws RemoteException {
+	mConnexion.connectAsync();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void connectSync() throws RemoteException {
+	mConnexion.connectSync();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IXmppConnection createConnection() throws RemoteException {
+	return mConnexion;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void disconnect() throws RemoteException {
+	mConnexion.disconnect();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IRoster getRoster() throws RemoteException {
+	return mConnexion.getRoster();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IChatManager getChatManager() throws RemoteException {
+	return mConnexion.getChatManager();
+    }
+
+}
--- a/src/com/beem/project/beem/service/aidl/IXMPPFacade.aidl	Sat Apr 04 10:13:51 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-package com.beem.project.beem.service.aidl;
-
-import  com.beem.project.beem.service.aidl.IXmppConnection;
-import  com.beem.project.beem.service.aidl.IRoster;
-import  com.beem.project.beem.service.aidl.IChatManager;
-
-interface IXMPPFacade {
-
-    IXmppConnection createConnection();
-    
-    IRoster getRoster();
-    
-    void connectSync();
-    
-    void connectAsync();
-    
-    void disconnect();
-
-    IChatManager getChatManager();
-    
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl	Sat Apr 04 19:02:11 2009 +0200
@@ -0,0 +1,21 @@
+package com.beem.project.beem.service.aidl;
+
+import  com.beem.project.beem.service.aidl.IXmppConnection;
+import  com.beem.project.beem.service.aidl.IRoster;
+import  com.beem.project.beem.service.aidl.IChatManager;
+
+interface IXmppFacade {
+
+    IXmppConnection createConnection();
+    
+    IRoster getRoster();
+    
+    void connectSync();
+    
+    void connectAsync();
+    
+    void disconnect();
+
+    IChatManager getChatManager();
+    
+}
--- a/src/com/beem/project/beem/ui/ContactList.java	Sat Apr 04 10:13:51 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java	Sat Apr 04 19:02:11 2009 +0200
@@ -29,14 +29,14 @@
 import com.beem.project.beem.BeemApplication;
 import com.beem.project.beem.R;
 import com.beem.project.beem.service.Contact;
+import com.beem.project.beem.service.aidl.IXmppFacade;
 import com.beem.project.beem.service.aidl.IRoster;
-import com.beem.project.beem.service.aidl.IXMPPFacade;
 
 public class ContactList extends ExpandableListActivity {
 
     private static final String TAG = "CONTACTLIST_ACT";
+    private IXmppFacade mService = null;
     private SharedPreferences mSettings;
-    private IXMPPFacade mService = null;
     private Handler mHandler;
     private BeemApplication mBeemApplication;
     private ContactListDialogSettings mDialog;