# HG changeset patch # User Da Risk # Date 1258592193 -3600 # Node ID 58a827799e79aad757fc40be9c6f649a23fbdd4a # Parent e344b51f93ff1662aff547110f15a53e8e43bb4a# Parent 7964f04c2bf748647a92d31e51af6ae3c5c24903 merge diff -r 7964f04c2bf7 -r 58a827799e79 build.xml --- a/build.xml Thu Nov 19 01:14:15 2009 +0100 +++ b/build.xml Thu Nov 19 01:56:33 2009 +0100 @@ -58,4 +58,39 @@ targets are used. --> + + + + + + + + + + + + + + + + + + Beem-project.com]]> + Copyright © 2009 Beem-project.com. All Rights Reserved.]]> + + + + + + + + + + + + + + + diff -r 7964f04c2bf7 -r 58a827799e79 javadoc.xml --- a/javadoc.xml Thu Nov 19 01:14:15 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - - - - - - - Beem-project.com]]> - Copyright © 2009 Beem-project.com. All Rights Reserved.]]> - - - - - - - - - - - - - - - - diff -r 7964f04c2bf7 -r 58a827799e79 src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Nov 19 01:14:15 2009 +0100 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Nov 19 01:56:33 2009 +0100 @@ -28,9 +28,9 @@ import com.beem.project.beem.service.aidl.IChatManager; import com.beem.project.beem.service.aidl.IRoster; import com.beem.project.beem.service.aidl.IXmppConnection; -import com.beem.project.beem.ui.ChangeStatus; import com.beem.project.beem.ui.Subscription; import com.beem.project.beem.utils.BeemBroadcastReceiver; +import com.beem.project.beem.ui.ChangeStatus; import com.beem.project.beem.utils.Status; /** @@ -174,22 +174,23 @@ @Override public void changeStatusAndPriority(int status, String msg, int priority) { Presence pres = new Presence(Presence.Type.available); + String m; if (msg != null) - pres.setStatus(msg); + m = msg; else - msg = ""; + m = ""; + pres.setStatus(m); Presence.Mode mode = Status.getPresenceModeFromStatus(status); if (mode != null) pres.setMode(mode); // Smack limit : Priority between -128 and 128 - if (priority < -128) - priority = -128; - if (priority > 128) - priority = 128; - mPreviousPriority = priority; - pres.setPriority(priority); + int p = priority; + if (priority < -128) p = -128; + if (priority > 128) p = 128; + mPreviousPriority = p; + pres.setPriority(p); mAdaptee.sendPacket(pres); - updateNotification(msg); + updateNotification(m); } /** @@ -198,10 +199,12 @@ @Override public void changeStatus(int status, String msg) { Presence pres = new Presence(Presence.Type.available); + String m; if (msg != null) - pres.setStatus(msg); + m = msg; else - msg = ""; + m = ""; + pres.setStatus(m); Presence.Mode mode = Status.getPresenceModeFromStatus(status); if (mode != null) pres.setMode(mode); @@ -210,6 +213,10 @@ updateNotification(msg); } + /** + * Update the notification for the Beem status. + * @param text the text to display. + */ private void updateNotification(String text) { Notification mStatusNotification; mStatusNotification = new Notification(com.beem.project.beem.R.drawable.beem_status_icon, text, System @@ -217,8 +224,8 @@ mStatusNotification.defaults = Notification.DEFAULT_LIGHTS; mStatusNotification.flags = Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT; - mStatusNotification.setLatestEventInfo(mService, "Beem Status", text, PendingIntent.getActivity(mService, 0, - new Intent(mService, ChangeStatus.class), 0)); + mStatusNotification.setLatestEventInfo(mService, "Beem Status", text, PendingIntent.getActivity( + mService, 0, new Intent(mService, ChangeStatus.class), 0)); mService.sendNotification(BeemService.NOTIFICATION_STATUS_ID, mStatusNotification); } @@ -407,8 +414,8 @@ @Override public void processPacket(Packet packet) { String from = packet.getFrom(); - Notification notif = new Notification(android.R.drawable.stat_notify_more, mService.getString( - R.string.AcceptContactRequest, from), System.currentTimeMillis()); + Notification notif = new Notification(android.R.drawable.stat_notify_more, mService + .getString(R.string.AcceptContactRequest, from), System.currentTimeMillis()); notif.defaults = Notification.DEFAULT_ALL; notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); @@ -507,8 +514,8 @@ @Override public void processPacket(Packet packet) { String from = packet.getFrom(); - Notification notif = new Notification(android.R.drawable.stat_notify_more, mService.getString( - R.string.AcceptContactRequest, from), System.currentTimeMillis()); + Notification notif = new Notification(android.R.drawable.stat_notify_more, mService + .getString(R.string.AcceptContactRequest, from), System.currentTimeMillis()); notif.defaults = Notification.DEFAULT_ALL; notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class);