petites majs sur le TimeOut
authornikita@nikita-rack
Thu, 09 Apr 2009 19:03:23 +0200
changeset 97 58622a0f9485
parent 96 e0eabd2266fe
child 98 4d6ff785605d
child 105 c6e4728ac9f7
petites majs sur le TimeOut
src/com/beem/project/beem/BeemApplication.java
src/com/beem/project/beem/BeemService.java
src/com/beem/project/beem/service/XmppConnectionAdapter.java
src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl
--- a/src/com/beem/project/beem/BeemApplication.java	Thu Apr 09 17:58:19 2009 +0200
+++ b/src/com/beem/project/beem/BeemApplication.java	Thu Apr 09 19:03:23 2009 +0200
@@ -167,7 +167,7 @@
 
 	@Override
 	public void run() {
-	    mBeemApp.mProgressDialog.setMessage("Connection failed");	    
+	    mBeemApp.mProgressDialog.setMessage(mErrorMsg);	    
 	}
 
 	/**
@@ -264,9 +264,9 @@
 	}
 
 	@Override
-	public void connectionFailed() throws RemoteException {
+	public void connectionFailed(String errorMsg) throws RemoteException {
 	    Log.i(TAG, "Connection Failed");
-	    ConnectionRunnable cRun = new ConnectionRunnable("Connection failed");
+	    ConnectionRunnable cRun = new ConnectionRunnable(errorMsg);
 	    mBeemApp.mActivity.runOnUiThread(cRun);
 	}
 
--- a/src/com/beem/project/beem/BeemService.java	Thu Apr 09 17:58:19 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java	Thu Apr 09 19:03:23 2009 +0200
@@ -220,9 +220,11 @@
 
 		}
 
+
 		@Override
-		public void connectionFailed() throws RemoteException {
-		    Log.d("TEST", "Connection Failed");
+		public void connectionFailed(String errorMsg) throws RemoteException {
+		    // TODO Auto-generated method stub
+		    
 		}
 	    });
 	} catch (RemoteException e) {
--- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Thu Apr 09 17:58:19 2009 +0200
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Thu Apr 09 19:03:23 2009 +0200
@@ -87,8 +87,7 @@
 	    return true;
 	} catch (XMPPException e) {
 	    Log.e(TAG, "Error while connecting", e);
-	    mConListener.connectionFailed();
-	    mLastException = new BeemException(e);
+	    mConListener.connectionFailed(e.getXMPPError().getMessage()); //
 	}
 	return false;
     }
@@ -314,14 +313,14 @@
 	    mRemoteConnListeners.finishBroadcast();
 	}
 	
-	public void connectionFailed() {
+	public void connectionFailed(String errorMsg) {
 	    Log.i(TAG, "Connection Failed");
 	    final int n = mRemoteConnListeners.beginBroadcast();
 
 	    for (int i = 0; i < n; i++) {
 		IBeemConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
 		try {
-		    listener.connectionFailed();
+		    listener.connectionFailed(errorMsg);
 		} catch (RemoteException e) {
 		    // The RemoteCallbackList will take care of removing the
 		    // dead listeners.
--- a/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl	Thu Apr 09 17:58:19 2009 +0200
+++ b/src/com/beem/project/beem/service/aidl/IBeemConnectionListener.aidl	Thu Apr 09 19:03:23 2009 +0200
@@ -40,5 +40,5 @@
     /**
      *  Callback to call when the connection Failed
      */ 
-    void connectionFailed();
+    void connectionFailed(in String errorMsg);
 }