Suppression beemapplication + modif connection
authorMarseille
Tue, 23 Jun 2009 17:19:29 +0200
changeset 282 ee754b3043a8
parent 275 5a07bf00b2f8
child 283 ecd2cb5f618e
Suppression beemapplication + modif connection
AndroidManifest.xml
src/com/beem/project/beem/service/RosterAdapter.java
src/com/beem/project/beem/service/XmppConnectionAdapter.java
src/com/beem/project/beem/ui/ContactList.java
src/com/beem/project/beem/ui/Login.java
--- a/AndroidManifest.xml	Tue Jun 23 15:43:49 2009 +0200
+++ b/AndroidManifest.xml	Tue Jun 23 17:19:29 2009 +0200
@@ -2,8 +2,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	package="com.beem.project.beem" android:versionCode="1"
 	android:versionName="1.0">
-	<application android:label="@string/app_name" android:name="BeemApplication"
-		android:icon="@drawable/signal" android:theme="@style/Theme.BEEM.Default">
+	<application android:label="@string/app_name" android:icon="@drawable/signal" android:theme="@style/Theme.BEEM.Default">
 		<activity android:name=".ui.Login" android:label="@string/app_name"
 			android:launchMode="singleTask">
 			<intent-filter>
--- a/src/com/beem/project/beem/service/RosterAdapter.java	Tue Jun 23 15:43:49 2009 +0200
+++ b/src/com/beem/project/beem/service/RosterAdapter.java	Tue Jun 23 17:19:29 2009 +0200
@@ -129,7 +129,11 @@
     public void deleteContact(Contact contact, String group) throws RemoteException {
 	mContacts.get(contact.getJID()).delGroup(group);
 	try {
-	    mAdaptee.getGroup(group).removeEntry(mAdaptee.getEntry(contact.getJID()));
+	    if (mAdaptee != null) {
+		RosterEntry entry = mAdaptee.getEntry(contact.getJID());
+		if (entry != null)
+		    mAdaptee.getGroup(group).removeEntry(entry);
+	    }
 	} catch (XMPPException e) {
 	    e.printStackTrace();
 	}
--- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Tue Jun 23 15:43:49 2009 +0200
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Tue Jun 23 17:19:29 2009 +0200
@@ -113,7 +113,7 @@
 	try {
 	    try {
 		PrivacyListManager.getInstanceFor(mAdaptee);
-	    } catch (NullPointerException e){
+	    } catch (NullPointerException e) {
 		Log.e(TAG, "pas normal", e);
 	    }
 	    mAdaptee.connect();
@@ -130,7 +130,10 @@
 	    return true;
 	} catch (XMPPException e) {
 	    Log.e(TAG, "Error while connecting", e);
-	    mConListener.connectionFailed("Error On Connection");
+	    if (e.getXMPPError().getMessage() != null)
+		mConListener.connectionFailed(e.getXMPPError().getMessage());
+	    else
+		mConListener.connectionFailed("Error On Connection");
 	}
 	return false;
     }
@@ -171,7 +174,7 @@
 	Roster adap = mAdaptee.getRoster();
 	if (adap == null)
 	    return null;
-	mRoster = new RosterAdapter(adap);	
+	mRoster = new RosterAdapter(adap);
 	return mRoster;
     }
 
@@ -210,6 +213,7 @@
     private void triggerAsynchronousConnectEvent() {
 	mConListener.onConnect();
     }
+
     /**
      * @param mPrivacyList the mPrivacyList to set
      */
@@ -223,6 +227,7 @@
     public PrivacyListManagerAdapter getPrivacyList() {
 	return mPrivacyList;
     }
+
     /**
      * Listener for XMPP connection events. It will calls the remote listeners for connexion events.
      * @author darisk
--- a/src/com/beem/project/beem/ui/ContactList.java	Tue Jun 23 15:43:49 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java	Tue Jun 23 17:19:29 2009 +0200
@@ -94,6 +94,7 @@
 	if (requestCode == REQUEST_CODE) {
 	    if (resultCode == 69) {
 		stopService(new Intent(this, BeemService.class));
+		Log.e("CONTACTLIST", "STOPSERVICE");
 		finish();
 		startActivity(new Intent(this, Login.class));
 	    }
@@ -117,6 +118,7 @@
     @Override
     protected void onStop() {
 	super.onStop();
+	Log.e("CONTACTLIST", "UNBINDSERVICE");
 	unbindService(mServConn);
 	groupName.clear();