# HG changeset patch # User Nikita Kozlov # Date 1302904247 -7200 # Node ID 98d8df89c3d207b93552ce447662718bd569a5d9 # Parent 244d0cb7d8cb083fd118d83841fc6be70ed38fd7 fix the merge diff -r 244d0cb7d8cb -r 98d8df89c3d2 AndroidManifest.xml --- a/AndroidManifest.xml Fri Apr 15 19:02:37 2011 +0200 +++ b/AndroidManifest.xml Fri Apr 15 23:50:47 2011 +0200 @@ -4,7 +4,7 @@ android:versionName="0.1.5"> + android:name=".BeemApplication"> @@ -30,7 +30,7 @@ android:launchMode="singleTask" /> - + - diff -r 244d0cb7d8cb -r 98d8df89c3d2 libs/junit-4.6.jar Binary file libs/junit-4.6.jar has changed diff -r 244d0cb7d8cb -r 98d8df89c3d2 src/com/beem/project/beem/service/BeemChatManager.java --- a/src/com/beem/project/beem/service/BeemChatManager.java Fri Apr 15 19:02:37 2011 +0200 +++ b/src/com/beem/project/beem/service/BeemChatManager.java Fri Apr 15 23:50:47 2011 +0200 @@ -65,7 +65,6 @@ import com.beem.project.beem.BeemApplication; import com.beem.project.beem.BeemService; -import com.beem.project.beem.R; import com.beem.project.beem.service.aidl.IChat; import com.beem.project.beem.service.aidl.IChatManager; import com.beem.project.beem.service.aidl.IChatManagerListener; @@ -269,7 +268,7 @@ private PendingIntent makeChatIntent(IChat chat) { Intent chatIntent = new Intent(mService, com.beem.project.beem.ui.Chat.class); chatIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP - | Intent.FLAG_ACTIVITY_NEW_TASK); + | Intent.FLAG_ACTIVITY_NEW_TASK); try { chatIntent.setData(chat.getParticipant().toUri()); } catch (RemoteException e) { @@ -283,17 +282,17 @@ /** * Set a notification of a new chat. * @param chat The chat to access by the notification + * @param msgBody the body of the new message */ - private void notifyNewChat(IChat chat) { + private void notifyNewChat(IChat chat, String msgBody) { SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mService); try { CharSequence tickerText = mService.getBind().getRoster().getContact(chat.getParticipant().getJID()) - .getName(); + .getName(); Notification notification = new Notification(android.R.drawable.stat_notify_chat, tickerText, System .currentTimeMillis()); notification.flags = Notification.FLAG_AUTO_CANCEL; - notification.setLatestEventInfo(mService, tickerText, mService - .getString(R.string.BeemChatManagerNewMessage), makeChatIntent(chat)); + notification.setLatestEventInfo(mService, tickerText, msgBody, makeChatIntent(chat)); mService.sendNotification(chat.getParticipant().getJID().hashCode(), notification); } catch (RemoteException e) { Log.e(TAG, e.getMessage()); @@ -306,11 +305,12 @@ @Override public void processMessage(final IChat chat, Message message) { try { - if (!chat.isOpen() && message.getBody() != null) { + String body = message.getBody(); + if (!chat.isOpen() && body != null) { if (chat instanceof ChatAdapter) { mChats.put(chat.getParticipant().getJID(), (ChatAdapter) chat); } - notifyNewChat(chat); + notifyNewChat(chat, body); } } catch (RemoteException e) { Log.e(TAG, e.getMessage()); diff -r 244d0cb7d8cb -r 98d8df89c3d2 src/com/beem/project/beem/service/ChatAdapter.java --- a/src/com/beem/project/beem/service/ChatAdapter.java Fri Apr 15 19:02:37 2011 +0200 +++ b/src/com/beem/project/beem/service/ChatAdapter.java Fri Apr 15 23:50:47 2011 +0200 @@ -40,7 +40,7 @@ Flavien Astraud, November 26, 2009 Head of the EIP Laboratory. - */ +*/ package com.beem.project.beem.service; import java.io.File; @@ -91,23 +91,23 @@ private String mAccountUser; /** - * Constructor. - * @param chat The chat to adapt - */ - public ChatAdapter(final Chat chat) { - mAdaptee = chat; - mParticipant = new Contact(chat.getParticipant()); - mMessages = new LinkedList(); - mAdaptee.addMessageListener(mMsgListener); - } + * Constructor. + * @param chat The chat to adapt + */ + public ChatAdapter(final Chat chat) { + mAdaptee = chat; + mParticipant = new Contact(chat.getParticipant()); + mMessages = new LinkedList(); + mAdaptee.addMessageListener(mMsgListener); + } - /** - * {@inheritDoc} - */ - @Override - public Contact getParticipant() throws RemoteException { - return mParticipant; - } + /** + * {@inheritDoc} + */ + @Override + public Contact getParticipant() throws RemoteException { + return mParticipant; + } /** * {@inheritDoc}