--- 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">
<application android:label="@string/app_name"
android:icon="@drawable/beem_launcher_icon_silver" android:theme="@style/Theme.BEEM.Default"
- android:name="BeemApplication">
+ android:name=".BeemApplication">
<activity android:name=".ui.Login" android:label="@string/app_name"
android:launchMode="standard">
<intent-filter>
@@ -30,7 +30,7 @@
android:launchMode="singleTask" />
<activity android:name=".ui.GroupList" android:label="GroupList" />
- <activity android:name="ui.PrivacyList" android:label="@string/privacy_list_name" />
+ <activity android:name=".ui.PrivacyList" android:label="@string/privacy_list_name" />
<!--
Could be interesting if we would launch beem at startup <receiver
@@ -39,7 +39,7 @@
android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter> </receiver>
-->
- <provider android:name="providers.AvatarProvider"
+ <provider android:name=".providers.AvatarProvider"
android:authorities="com.beem.project.beem.providers.avatarprovider"
android:exported="false" />
Binary file libs/junit-4.6.jar has changed
--- 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());
--- 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<Message>();
- 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<Message>();
+ mAdaptee.addMessageListener(mMsgListener);
+ }
- /**
- * {@inheritDoc}
- */
- @Override
- public Contact getParticipant() throws RemoteException {
- return mParticipant;
- }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Contact getParticipant() throws RemoteException {
+ return mParticipant;
+ }
/**
* {@inheritDoc}