--- 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<IBeemConnectionListener> mRemoteConnListeners =
- new RemoteCallbackList<IBeemConnectionListener>();
+ private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners = new RemoteCallbackList<IBeemConnectionListener>();
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))