# HG changeset patch # User Vincent V. # Date 1336651391 -7200 # Node ID 847e7f7d88c18157b67795e479aa9d12f1404050 # Parent 257fbd2fcf7950eb6391dca04d579bfd827aec6d API=8 because of the android:installLocation in the AndroidManifest.xml Checkstyle diff -r 257fbd2fcf79 -r 847e7f7d88c1 project.properties --- a/project.properties Wed May 09 14:38:23 2012 +0200 +++ b/project.properties Thu May 10 14:03:11 2012 +0200 @@ -8,4 +8,4 @@ # project structure. # Project target. -target=android-7 +target=android-8 diff -r 257fbd2fcf79 -r 847e7f7d88c1 src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Wed May 09 14:38:23 2012 +0200 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu May 10 14:03:11 2012 +0200 @@ -40,7 +40,7 @@ Flavien Astraud, November 26, 2009 Head of the EIP Laboratory. -*/ + */ package com.beem.project.beem.service; import java.util.Iterator; @@ -119,8 +119,7 @@ private BeemAvatarManager mAvatarManager; private PepSubManager mPepManager; private SharedPreferences mPref; - private final RemoteCallbackList mRemoteConnListeners = - new RemoteCallbackList(); + private final RemoteCallbackList mRemoteConnListeners = new RemoteCallbackList(); private final SubscribePacketListener mSubscribePacketListener = new SubscribePacketListener(); private final PingListener mPingListener = new PingListener(); @@ -136,8 +135,8 @@ * @param password password to use on connect * @param service the background service associated with the connection. */ - public XmppConnectionAdapter(final ConnectionConfiguration config, - final String login, final String password, final BeemService service) { + public XmppConnectionAdapter(final ConnectionConfiguration config, final String login, final String password, + final BeemService service) { this(new XMPPConnection(config), login, password, service); } @@ -148,8 +147,8 @@ * @param password password to use on connect * @param service the background service associated with the connection. */ - public XmppConnectionAdapter(final String serviceName, - final String login, final String password, final BeemService service) { + public XmppConnectionAdapter(final String serviceName, final String login, final String password, + final BeemService service) { this(new XMPPConnection(serviceName), login, password, service); } @@ -160,8 +159,8 @@ * @param password The password to use * @param service the background service associated with the connection. */ - public XmppConnectionAdapter(final XMPPConnection con, - final String login, final String password, final BeemService service) { + public XmppConnectionAdapter(final XMPPConnection con, final String login, final String password, + final BeemService service) { mAdaptee = con; PrivacyListManager.getInstanceFor(mAdaptee); mLogin = login; @@ -203,8 +202,8 @@ try { //TODO NIKITA DOES SOME SHIT !!! Fix this monstruosity String str = mService.getResources().getString( - mService.getResources().getIdentifier( - e.getXMPPError().getCondition().replace("-", "_"), "string", "com.beem.project.beem")); + mService.getResources().getIdentifier(e.getXMPPError().getCondition().replace("-", "_"), + "string", "com.beem.project.beem")); mErrorMsg = str; } catch (NullPointerException e2) { if (!"".equals(e.getMessage())) @@ -341,7 +340,6 @@ /** * Get the AvatarManager of this connection. - * * @return the AvatarManager or null if there is not */ public BeemAvatarManager getAvatarManager() { @@ -366,6 +364,7 @@ /** * Update the notification for the Beem status. + * @param status the status to display. * @param text the text to display. */ private void updateNotification(int status, String text) { @@ -374,8 +373,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)); // bypass the preferences for notification mService.getNotificationManager().notify(BeemService.NOTIFICATION_STATUS_ID, mStatusNotification); } @@ -422,7 +421,6 @@ /** * Get the user informations. - * * @return the user infos or null if not logged */ public UserInfo getUserInfo() { @@ -676,11 +674,10 @@ R.string.AcceptContactRequest, from), System.currentTimeMillis()); notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - .putExtra("from", from); - notif.setLatestEventInfo(mService, from, mService - .getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0, - intent, PendingIntent.FLAG_ONE_SHOT)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).putExtra("from", from); + notif.setLatestEventInfo(mService, from, + mService.getString(R.string.AcceptContactRequestFrom, from), + PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT)); int id = packet.hashCode(); mService.sendNotification(id, notif); Presence p = (Presence) packet; @@ -730,9 +727,9 @@ notification.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); intent.setData(Contact.makeXmppUri(from)); - notification.setLatestEventInfo(mService, from, mService - .getString(R.string.AcceptContactRequestFrom, from), PendingIntent.getActivity(mService, 0, - intent, PendingIntent.FLAG_ONE_SHOT)); + notification.setLatestEventInfo(mService, from, + mService.getString(R.string.AcceptContactRequestFrom, from), + PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT)); int id = p.hashCode(); mService.sendNotification(id, notification); } @@ -760,11 +757,17 @@ } /** - * Listener for Ping request. - * It will respond with a Pong. + * Listener for Ping request. It will respond with a Pong. */ private class PingListener implements PacketListener { + /** + * Constructor. + */ + public PingListener() { + + } + @Override public void processPacket(Packet packet) { if (!(packet instanceof PingExtension)) diff -r 257fbd2fcf79 -r 847e7f7d88c1 src/com/beem/project/beem/utils/Status.java --- a/src/com/beem/project/beem/utils/Status.java Wed May 09 14:38:23 2012 +0200 +++ b/src/com/beem/project/beem/utils/Status.java Thu May 10 14:03:11 2012 +0200 @@ -43,11 +43,11 @@ */ package com.beem.project.beem.utils; +import com.beem.project.beem.R; + import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.packet.Presence.Mode; -import com.beem.project.beem.R; - /** * Utility class to deal with status and presence value. * @author marseille @@ -155,6 +155,11 @@ return status != Status.CONTACT_STATUS_DISCONNECT; } + /** + * Get icon resource from status. + * @param status the status + * @return the resource icon + */ public static int getIconBarFromStatus(final int status) { int icon = R.drawable.beem_status_icon; switch (status) {