# HG changeset patch # User Nikita Kozlov # Date 1253813936 -7200 # Node ID 9416b5711edd5750bc35584478e0aabf64216b13 # Parent 5f60caa9f85c796b065fd88374a6ade634e85ebb petit commit pour bundle diff -r 5f60caa9f85c -r 9416b5711edd AndroidManifest.xml --- a/AndroidManifest.xml Thu Sep 24 17:35:59 2009 +0200 +++ b/AndroidManifest.xml Thu Sep 24 19:38:56 2009 +0200 @@ -2,7 +2,8 @@ - + @@ -18,7 +19,11 @@ + android:launchMode="singleTask"> + + + + diff -r 5f60caa9f85c -r 9416b5711edd default.properties --- a/default.properties Thu Sep 24 17:35:59 2009 +0200 +++ b/default.properties Thu Sep 24 19:38:56 2009 +0200 @@ -8,7 +8,7 @@ # project structure. # Project target. -target=android-3 +target=android-4 # apk configurations. This property allows creation of APK files with limited # resources. For example, if your application contains many locales and # you wish to release multiple smaller apks instead of a large one, you can diff -r 5f60caa9f85c -r 9416b5711edd src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Sep 24 17:35:59 2009 +0200 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Sep 24 19:38:56 2009 +0200 @@ -35,6 +35,7 @@ public class XmppConnectionAdapter extends IXmppConnection.Stub { private static final String TAG = "XMPPConnectionAdapter"; + public static final String BEEM_CONNECTION_CLOSED = "BeemConnectionClosed"; private XMPPConnection mAdaptee; private IChatManager mChatManager; private String mLogin; @@ -253,6 +254,8 @@ */ private class ConnexionListenerAdapter implements ConnectionListener { + + /** * Defaut constructor. */ @@ -280,6 +283,8 @@ } } mRemoteConnListeners.finishBroadcast(); + Intent closedIntent = new Intent(BEEM_CONNECTION_CLOSED); + mService.sendBroadcast(closedIntent); } /** diff -r 5f60caa9f85c -r 9416b5711edd src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Thu Sep 24 17:35:59 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Thu Sep 24 19:38:56 2009 +0200 @@ -7,9 +7,11 @@ import org.jivesoftware.smack.util.StringUtils; import android.app.Activity; +import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.content.ServiceConnection; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -25,7 +27,6 @@ import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; -import android.widget.Button; import android.widget.Gallery; import android.widget.ImageView; import android.widget.ListView; @@ -37,10 +38,10 @@ import com.beem.project.beem.R; import com.beem.project.beem.service.Contact; import com.beem.project.beem.service.PresenceAdapter; +import com.beem.project.beem.service.XmppConnectionAdapter; import com.beem.project.beem.service.aidl.IBeemRosterListener; import com.beem.project.beem.service.aidl.IRoster; import com.beem.project.beem.service.aidl.IXmppFacade; -import com.beem.project.beem.utils.PresenceType; import com.beem.project.beem.utils.Status; /** @@ -72,6 +73,7 @@ setContentView(R.layout.contactlist); mAdapter = new BeemContactList(this); mHandler = new Handler(); + this.registerReceiver(new BeemBroadcastReceiver(), new IntentFilter(XmppConnectionAdapter.BEEM_CONNECTION_CLOSED)); } @@ -426,13 +428,13 @@ public void onEntriesUpdated(List addresses) throws RemoteException { mHandler.post(new RunnableChange()); } - + @Override - public void onEntryDeleteFromGroup(String group, String jid) - throws RemoteException { + public void onEntryDeleteFromGroup(String group, String jid) + throws RemoteException { // TODO Auto-generated method stub - - } + + } /** * {@inheritDoc} */ @@ -445,11 +447,11 @@ if (curContact.getJID().equals(StringUtils.parseBareAddress(from))) { String pres = StringUtils.parseResource(from); for (String res : curContact.getMRes()) { - if (res.equals(pres)) { - resfound = true; - break; - } - } + if (res.equals(pres)) { + resfound = true; + break; + } + } curContact.setStatus(mRoster.getPresence(StringUtils.parseBareAddress(presence.getFrom()))); int status = presence.getStatus(); if (!resfound && (status != Status.CONTACT_STATUS_DISCONNECT && status != Status.CONTACT_STATUS_UNAVAILABLE)) @@ -462,7 +464,7 @@ } } - + } /** @@ -652,6 +654,7 @@ } catch (RemoteException e) { e.printStackTrace(); } + } @Override @@ -665,4 +668,14 @@ mRoster = null; } } + + private class BeemBroadcastReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + Log.d(TAG, "broadcast received"); + + } + + } }