# HG changeset patch # User dasilvj # Date 1255003144 -7200 # Node ID fe0ba62ee3ffba62ca7f65cb3bdc7254eef41055 # Parent 7ff358b5201662065379902049895219de51f194 Correction de l'ensemble des erreurs de CheckStyle. Suppression dans le classpath de .apt_generated. diff -r 7ff358b52016 -r fe0ba62ee3ff .classpath --- a/.classpath Thu Oct 08 10:41:57 2009 +0200 +++ b/.classpath Thu Oct 08 13:59:04 2009 +0200 @@ -1,34 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/jingle/JingleService.java --- a/src/com/beem/project/beem/jingle/JingleService.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/jingle/JingleService.java Thu Oct 08 13:59:04 2009 +0200 @@ -36,7 +36,7 @@ */ public JingleService(final XMPPConnection xmppConnection) { BasicTransportManager bt = new BasicTransportManager(); - //JingleTransportManager tm = new ICETransportManager(); + // JingleTransportManager tm = new ICETransportManager(); mMediaManagers = new ArrayList(); mMediaManagers.add(new MicrophoneRTPManager(bt)); @@ -89,13 +89,15 @@ @Override public void sessionClosed(String reason, JingleSession jingleSession) { - //System.out.println("Session " + jingleSession.getResponder() + "closedd because " + reason); + // System.out.println("Session " + jingleSession.getResponder() + + // "closedd because " + reason); } @Override public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) { // TODO Auto-generated method stub - // System.out.println("Session " + jingleSession.getResponder() + " closed"); + // System.out.println("Session " + jingleSession.getResponder() + + // " closed"); } @@ -107,16 +109,18 @@ @Override public void sessionEstablished(PayloadType pt, TransportCandidate remoteCandidate, TransportCandidate localCandidate, JingleSession jingleSession) { - //System.out.println("Session established"); - //System.out.println("Je recois sur " + remoteCandidate.getIp() + ":" + remoteCandidate.getPort()); + // System.out.println("Session established"); + // System.out.println("Je recois sur " + remoteCandidate.getIp() + + // ":" + remoteCandidate.getPort()); // TODO choose the right RTPReceiver depending on the payload type - //RTPReceiver rtpReceiver = new RTPReceiver(remoteCandidate.getPort()); + // RTPReceiver rtpReceiver = new + // RTPReceiver(remoteCandidate.getPort()); Log.d(TAG, "Session " + jingleSession.getResponder() + "established"); } @Override public void sessionMediaReceived(JingleSession jingleSession, String participant) { - //System.out.println("Session Media received from " + participant); + // System.out.println("Session Media received from " + participant); } @Override @@ -140,18 +144,21 @@ @Override public void sessionClosed(final String reason, final JingleSession jingleSession) { - // System.out.println("Session " + jingleSession.getResponder() + "closed because " + reason); + // System.out.println("Session " + jingleSession.getResponder() + + // "closed because " + reason); } @Override public void sessionClosedOnError(final XMPPException e, final JingleSession jingleSession) { - // System.out.println("Session " + jingleSession.getResponder() + " closed on error"); + // System.out.println("Session " + jingleSession.getResponder() + + // " closed on error"); } @Override public void sessionDeclined(final String reason, final JingleSession jingleSession) { - // System.out.println("Session " + jingleSession.getResponder() + "declined because " + reason); + // System.out.println("Session " + jingleSession.getResponder() + + // "declined because " + reason); Log.d(TAG, "Session " + jingleSession.getResponder() + "declined because " + reason); } @@ -162,7 +169,8 @@ // String name = localCandidate.getName(); String ip = localCandidate.getIp(); int port = localCandidate.getPort(); - // System.out.println("Session established waiting connection on " + ip + ":" + port); + // System.out.println("Session established waiting connection on " + + // ip + ":" + port); RTPTransmitter transm = new PCMTransmitter(ip, port); @@ -174,7 +182,7 @@ e.printStackTrace(); } transm.stop(); - // System.out.println("End of transfer"); + // System.out.println("End of transfer"); } diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/jingle/MicrophoneRTPSession.java --- a/src/com/beem/project/beem/jingle/MicrophoneRTPSession.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/jingle/MicrophoneRTPSession.java Thu Oct 08 13:59:04 2009 +0200 @@ -23,12 +23,13 @@ * @param jingleSession the current jingle session */ public MicrophoneRTPSession(final PayloadType payloadType, final TransportCandidate remote, - final TransportCandidate local, final String mediaLocator, final JingleSession jingleSession) { + final TransportCandidate local, final String mediaLocator, final JingleSession jingleSession) { super(payloadType, remote, local, mediaLocator, jingleSession); - // TODO le transmitter ne devrait peut etre pas etre init ici, c'est peut etre encore un peu tot, a voir. + // TODO le transmitter ne devrait peut etre pas etre init ici, c'est + // peut etre encore un peu tot, a voir. mTransmitter = new PCMTransmitter(remote.getIp(), getRemote().getPort()); - //mReceiver = new MicroRTPReceiver(getLocal().getPort()); + // mReceiver = new MicroRTPReceiver(getLocal().getPort()); } @Override diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/jingle/RTPReceiver.java --- a/src/com/beem/project/beem/jingle/RTPReceiver.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/jingle/RTPReceiver.java Thu Oct 08 13:59:04 2009 +0200 @@ -10,7 +10,6 @@ /** * abstract RTP receiver class. * @author nikita - * */ public abstract class RTPReceiver implements Runnable, RTPAppIntf { diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/jingle/demo/JingleCallActivity.java --- a/src/com/beem/project/beem/jingle/demo/JingleCallActivity.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/jingle/demo/JingleCallActivity.java Thu Oct 08 13:59:04 2009 +0200 @@ -62,15 +62,15 @@ try { mConnection.connect(); Thread.sleep(3000); - mConnection.login(login, password); - mJingle = new JingleService(mConnection); - mJingle.initWhenConntected(mConnection); - mBtcall.setEnabled(true); - Toast.makeText(JingleCallActivity.this, "Connected", Toast.LENGTH_SHORT); - } catch (XMPPException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InterruptedException e) { + mConnection.login(login, password); + mJingle = new JingleService(mConnection); + mJingle.initWhenConntected(mConnection); + mBtcall.setEnabled(true); + Toast.makeText(JingleCallActivity.this, "Connected", Toast.LENGTH_SHORT); + } catch (XMPPException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -87,7 +87,7 @@ Toast.makeText(JingleCallActivity.this, "Appel en cours", Toast.LENGTH_SHORT); } else Toast.makeText(JingleCallActivity.this, "Remplir le champ (JID complet en toto@tutu.com/truc)", - Toast.LENGTH_SHORT); + Toast.LENGTH_SHORT); } }); diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/jingle/demo/package-info.java --- a/src/com/beem/project/beem/jingle/demo/package-info.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/jingle/demo/package-info.java Thu Oct 08 13:59:04 2009 +0200 @@ -2,3 +2,4 @@ * Package for testing the Jingle classes. */ package com.beem.project.beem.jingle.demo; + diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/jingle/package-info.java --- a/src/com/beem/project/beem/jingle/package-info.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/jingle/package-info.java Thu Oct 08 13:59:04 2009 +0200 @@ -2,3 +2,4 @@ * This package contains the class used by the Beem Jingle process. */ package com.beem.project.beem.jingle; + diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/package-info.java --- a/src/com/beem/project/beem/package-info.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/package-info.java Thu Oct 08 13:59:04 2009 +0200 @@ -2,3 +2,4 @@ * This package contains the main class for the Beem application. */ package com.beem.project.beem; + diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/provider/Beem.java --- a/src/com/beem/project/beem/provider/Beem.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/provider/Beem.java Thu Oct 08 13:59:04 2009 +0200 @@ -4,165 +4,186 @@ import android.provider.BaseColumns; /** - * Convenience definitions for BEEM's providers + * Convenience definitions for BEEM's providers. */ public final class Beem { /** - * Contacts table + * Contacts table. */ public static final class Contacts implements BaseColumns { /** - * The query used to create the table + * The query used to create the table. */ - public final static String QUERY_CREATE = "CREATE TABLE " + Beem.CONTACTS_TABLE_NAME + " (" - + BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," - + Contacts.UID + " INTEGER, " + Contacts.JID - + " INTEGER," + Contacts.NICKNAME + " TEXT," - + Contacts.ALIAS + " TEXT," + Contacts.DATE_CREATED - + " INTEGER," + Contacts.DATE_MODIFIED + " INTEGER" - + ");"; + public static final String QUERY_CREATE = "CREATE TABLE " + Beem.CONTACTS_TABLE_NAME + " (" + BaseColumns._ID + + " INTEGER PRIMARY KEY AUTOINCREMENT," + Contacts.UID + " INTEGER, " + Contacts.JID + " INTEGER," + + Contacts.NICKNAME + " TEXT," + Contacts.ALIAS + " TEXT," + Contacts.DATE_CREATED + " INTEGER," + + Contacts.DATE_MODIFIED + " INTEGER" + ");"; /** - * The content:// style URL for Contacts table + * The content:// style URL for Contacts table. */ - public final static Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/contacts"); + public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/contacts"); /** * The MIME type of {@link #CONTENT_URI} providing a directory of contacts. */ - public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.beem.project.contact"; + public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.beem.project.contact"; /** * The MIME type of a {@link #CONTENT_URI} sub-directory of a single contact. */ - public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.beem.project.contact"; + public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.beem.project.contact"; /** - * The default sort order for this table + * The default sort order for this table. */ - public final static String DEFAULT_SORT_ORDER = "nickname ASC"; + public static final String DEFAULT_SORT_ORDER = "nickname ASC"; /** * The user id having the contact *

* Type: INTEGER *

+ * . */ - public final static String UID = "uid"; + public static final String UID = "uid"; /** * The JabberID of the contact *

* Type: INTEGER *

+ * . */ - public final static String JID = "jid"; + public static final String JID = "jid"; /** * The nickname of the contact *

* Type: TEXT *

+ * . */ - public final static String NICKNAME = "nickname"; + public static final String NICKNAME = "nickname"; /** * The alias of the contact *

* Type: TEXT *

+ * . */ - public final static String ALIAS = "alias"; + public static final String ALIAS = "alias"; /** * The timestamp for when the contact was created *

* Type: INTEGER (long from System.curentTimeMillis()) *

+ * . */ - public final static String DATE_CREATED = "created"; + public static final String DATE_CREATED = "created"; /** * The timestamp for when the contact was last modified *

* Type: INTEGER (long from System.curentTimeMillis()) *

+ * . */ - public final static String DATE_MODIFIED = "modified"; + public static final String DATE_MODIFIED = "modified"; } /** - * Users table + * Users table. */ public static final class Users implements BaseColumns { /** - * The query used to create the table + * The query used to create the table. */ - public final static String QUERY_CREATE = "CREATE TABLE " + Beem.USERS_TABLE_NAME + " (" - + BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," - + Users.JUSERNAME + " TEXT," + Users.DATE_CREATED - + " INTEGER," + Users.DATE_MODIFIED + " INTEGER" + ");"; + public static final String QUERY_CREATE = "CREATE TABLE " + Beem.USERS_TABLE_NAME + " (" + BaseColumns._ID + + " INTEGER PRIMARY KEY AUTOINCREMENT," + Users.JUSERNAME + " TEXT," + Users.DATE_CREATED + " INTEGER," + + Users.DATE_MODIFIED + " INTEGER" + ");"; /** - * The content:// style URL for Contacts table + * The content:// style URL for Contacts table. */ - public final static Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/users"); + public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/users"); /** * The MIME type of {@link #CONTENT_URI} providing a directory of users. */ - public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.beem.project.user"; + public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.beem.project.user"; /** * The MIME type of a {@link #CONTENT_URI} sub-directory of a single user. */ - public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.beem.project.user"; + public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.beem.project.user"; /** - * The default sort order for this table + * The default sort order for this table. */ - public final static String DEFAULT_SORT_ORDER = "_id ASC"; + public static final String DEFAULT_SORT_ORDER = "_id ASC"; /** * The Jabber username of the user *

* Type: TEXT *

+ * . */ - public final static String JUSERNAME = "username"; + public static final String JUSERNAME = "username"; /** * The timestamp for when the user was created *

* Type: INTEGER (long from System.curentTimeMillis()) *

+ * . */ - public final static String DATE_CREATED = "created"; + public static final String DATE_CREATED = "created"; /** * The timestamp for when the user was last modified *

* Type: INTEGER (long from System.curentTimeMillis()) *

+ * . */ - public final static String DATE_MODIFIED = "modified"; + public static final String DATE_MODIFIED = "modified"; } - public final static String AUTHORITY = "com.beem.project.provider"; + /** + * AUTHORITY. + */ + public static final String AUTHORITY = "com.beem.project.provider"; - public final static String DB_NAME = "beem.db"; - public final static int DB_VERSION = 2; - - public final static String USERS_TABLE_NAME = "users"; - - public final static String CONTACTS_TABLE_NAME = "contacts"; + /** + * DB Name. + */ + public static final String DB_NAME = "beem.db"; /** - * Constructor + * DB Version. + */ + public static final int DB_VERSION = 2; + + /** + * Name of the users table. + */ + public static final String USERS_TABLE_NAME = "users"; + + /** + * Name of the contacts table. + */ + public static final String CONTACTS_TABLE_NAME = "contacts"; + + /** + * Constructor. */ private Beem() { } diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/provider/BeemDatabaseHelper.java --- a/src/com/beem/project/beem/provider/BeemDatabaseHelper.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/provider/BeemDatabaseHelper.java Thu Oct 08 13:59:04 2009 +0200 @@ -5,13 +5,25 @@ import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; +/** + * BeemDatabaseHelper class. + * @author Jamu + */ public class BeemDatabaseHelper extends SQLiteOpenHelper { - private String mTag; - private String mTableName; - private String mCreationQuery; + private final String mTag; + private final String mTableName; + private final String mCreationQuery; - public BeemDatabaseHelper(Context context, String tag, String tableName, String creationQuery) { + /** + * BeemDatabaseHelper class. + * @param context the context. + * @param tag the tag. + * @param tableName the tableName. + * @param creationQuery the creation query. + */ + public BeemDatabaseHelper(final Context context, final String tag, final String tableName, + final String creationQuery) { super(context, Beem.DB_NAME, null, Beem.DB_VERSION); this.mTag = tag; diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/provider/ContactProvider.java --- a/src/com/beem/project/beem/provider/ContactProvider.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/provider/ContactProvider.java Thu Oct 08 13:59:04 2009 +0200 @@ -18,18 +18,19 @@ import android.text.TextUtils; /** + * ContactProvider class. * @author dasilvj */ public class ContactProvider extends ContentProvider { - private final static String TAG = "ContactProvider"; + private static final String TAG = "ContactProvider"; private static HashMap sContactsProjectionMap; - private static final int CONTACTS = 1; - private static final int CONTACT_ID = 2; + private static final int CONTACTS = 1; + private static final int CONTACT_ID = 2; - private static final UriMatcher sUriMatcher; + private static final UriMatcher sUriMatcher; static { sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH); sUriMatcher.addURI(Beem.AUTHORITY, "contacts", CONTACTS); @@ -45,7 +46,7 @@ sContactsProjectionMap.put(Beem.Contacts.DATE_MODIFIED, Beem.Contacts.DATE_MODIFIED); } - private BeemDatabaseHelper mOpenHelper; + private BeemDatabaseHelper mOpenHelper; @Override public int delete(Uri uri, String selection, String[] selectionArgs) { @@ -102,28 +103,28 @@ Long now = Long.valueOf(System.currentTimeMillis()); // Make sure that the fields are all set - if (values.containsKey(Beem.Contacts.UID) == false) { + if (!values.containsKey(Beem.Contacts.UID)) { // TODO :: Must check that the UID exists using UserProvider throw new SQLException("No UID specified. Failed to insert row into " + uri); } - if (values.containsKey(Beem.Contacts.JID) == false) { + if (!values.containsKey(Beem.Contacts.JID)) { values.put(Beem.Contacts.JID, ""); } - if (values.containsKey(Beem.Contacts.NICKNAME) == false) { + if (!values.containsKey(Beem.Contacts.NICKNAME)) { values.put(Beem.Contacts.JID, ""); } - if (values.containsKey(Beem.Contacts.ALIAS) == false) { + if (!values.containsKey(Beem.Contacts.ALIAS)) { values.put(Beem.Contacts.JID, ""); } - if (values.containsKey(Beem.Contacts.DATE_CREATED) == false) { + if (!values.containsKey(Beem.Contacts.DATE_CREATED)) { values.put(Beem.Contacts.DATE_CREATED, now); } - if (values.containsKey(Beem.Contacts.DATE_MODIFIED) == false) { + if (!values.containsKey(Beem.Contacts.DATE_MODIFIED)) { values.put(Beem.Contacts.DATE_MODIFIED, now); } @@ -176,7 +177,8 @@ SQLiteDatabase db = mOpenHelper.getReadableDatabase(); Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy); - // Tell the cursor what uri to watch, so it knows when its source data changes + // Tell the cursor what uri to watch, so it knows when its source data + // changes c.setNotificationUri(getContext().getContentResolver(), uri); return c; } diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/provider/UserProvider.java --- a/src/com/beem/project/beem/provider/UserProvider.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/provider/UserProvider.java Thu Oct 08 13:59:04 2009 +0200 @@ -14,16 +14,20 @@ import android.provider.BaseColumns; import android.text.TextUtils; +/** + * UserProvider class. + * @author Jamu + */ public class UserProvider extends ContentProvider { - private final static String TAG = "UserProvider"; + private static final String TAG = "UserProvider"; private static HashMap sUsersProjectionMap; - private static final int USERS = 1; - private static final int USER_ID = 2; + private static final int USERS = 1; + private static final int USER_ID = 2; - private static final UriMatcher sUriMatcher; + private static final UriMatcher sUriMatcher; static { sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH); sUriMatcher.addURI(Beem.AUTHORITY, "users", USERS); @@ -36,7 +40,7 @@ sUsersProjectionMap.put(Beem.Users.DATE_MODIFIED, Beem.Users.DATE_MODIFIED); } - private BeemDatabaseHelper mOpenHelper; + private BeemDatabaseHelper mOpenHelper; @Override public int delete(Uri uri, String selection, String[] selectionArgs) { @@ -93,15 +97,15 @@ Long now = Long.valueOf(System.currentTimeMillis()); // Make sure that the fields are all set - if (values.containsKey(Beem.Users.JUSERNAME) == false) { + if (!values.containsKey(Beem.Users.JUSERNAME)) { throw new SQLException("No JUSERNAME specified. Failed to insert row into " + uri); } - if (values.containsKey(Beem.Users.DATE_CREATED) == false) { + if (!values.containsKey(Beem.Users.DATE_CREATED)) { values.put(Beem.Users.DATE_CREATED, now); } - if (values.containsKey(Beem.Users.DATE_MODIFIED) == false) { + if (!values.containsKey(Beem.Users.DATE_MODIFIED)) { values.put(Beem.Users.DATE_MODIFIED, now); } @@ -154,7 +158,8 @@ SQLiteDatabase db = mOpenHelper.getReadableDatabase(); Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy); - // Tell the cursor what uri to watch, so it knows when its source data changes + // Tell the cursor what uri to watch, so it knows when its source data + // changes c.setNotificationUri(getContext().getContentResolver(), uri); return c; } diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/BeemChatManager.java --- a/src/com/beem/project/beem/service/BeemChatManager.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/BeemChatManager.java Thu Oct 08 13:59:04 2009 +0200 @@ -29,14 +29,12 @@ /** * An adapter for smack's ChatManager. This class provides functionnality to handle chats. - * * @author darisk */ public class BeemChatManager extends IChatManager.Stub { /** * A listener for all the chat creation event that happens on the connection. - * * @author darisk */ private class ChatListener implements ChatStateListener, ChatManagerListener, MessageListener { @@ -71,22 +69,20 @@ /** * Set a notification of a new chat in android. - * - * @param chat - * The chat to access by the notification + * @param chat The chat to access by the notification */ private void notifyNewChat(IChat chat) { try { String text = chat.getParticipant().getJID(); Notification notif = new Notification(com.beem.project.beem.R.drawable.notify_message, text, System - .currentTimeMillis()); + .currentTimeMillis()); notif.defaults = Notification.DEFAULT_ALL; notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, SendIM.class); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setData(chat.getParticipant().toUri()); notif.setLatestEventInfo(mService, text, mService.getString(R.string.BeemChatManagerNewMessage), - PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); + PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); int id = chat.hashCode(); mService.sendNotification(id, notif); } catch (RemoteException e) { @@ -151,20 +147,15 @@ private final ChatManager mAdaptee; private final Map mChats = new HashMap(); private final ChatListener mChatListener = new ChatListener(); - private final RemoteCallbackList mRemoteChatCreationListeners - = new RemoteCallbackList(); - private final RemoteCallbackList mRemoteMessageListeners - = new RemoteCallbackList(); + private final RemoteCallbackList mRemoteChatCreationListeners = new RemoteCallbackList(); + private final RemoteCallbackList mRemoteMessageListeners = new RemoteCallbackList(); private final BeemService mService; /** * Constructor. - * - * @param chatManager - * the smack ChatManager to adapt - * @param service - * the service which runs the chat manager + * @param chatManager the smack ChatManager to adapt + * @param service the service which runs the chat manager */ public BeemChatManager(final ChatManager chatManager, final BeemService service) { mService = service; @@ -182,11 +173,8 @@ /** * Create a chat session. - * - * @param contact - * the contact you want to chat with - * @param listener - * listener to use for chat events on this chat session + * @param contact the contact you want to chat with + * @param listener listener to use for chat events on this chat session * @return the chat session */ public IChat createChat(Contact contact, IMessageListener listener) { @@ -196,11 +184,8 @@ /** * Create a chat session. - * - * @param jid - * the jid of the contact you want to chat with - * @param listener - * listener to use for chat events on this chat session + * @param jid the jid of the contact you want to chat with + * @param listener listener to use for chat events on this chat session * @return the chat session */ public IChat createChat(String jid, IMessageListener listener) { @@ -233,9 +218,7 @@ /** * Get an existing ChatAdapter or create it if necessary. - * - * @param chat - * The real instance of smack chat + * @param chat The real instance of smack chat * @return a chat adapter register in the manager */ private ChatAdapter getChat(Chat chat) { diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/Contact.java --- a/src/com/beem/project/beem/service/Contact.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/Contact.java Thu Oct 08 13:59:04 2009 +0200 @@ -52,8 +52,7 @@ /** * Construct a contact from a parcel. - * @param in - * parcel to use for construction + * @param in parcel to use for construction */ private Contact(final Parcel in) { mID = in.readInt(); @@ -69,8 +68,7 @@ /** * Constructor. - * @param jid - * JID of the contact + * @param jid JID of the contact */ public Contact(final String jid) { mJID = StringUtils.parseBareAddress(jid); @@ -85,10 +83,8 @@ /** * Create a contact from a Uri. - * @param uri - * an uri for the contact - * @throws IllegalArgumentException - * if it is not a xmpp uri + * @param uri an uri for the contact + * @throws IllegalArgumentException if it is not a xmpp uri */ public Contact(final Uri uri) { if (!"xmpp".equals(uri.getScheme())) @@ -104,8 +100,7 @@ /** * Add a group for the contact. - * @param group - * the group + * @param group the group */ public void addGroup(String group) { if (!mGroups.contains(group)) @@ -122,8 +117,7 @@ /** * Add a resource for this contact. - * @param res - * the resource to add + * @param res the resource to add */ public void addRes(String res) { if (!mRes.contains(res)) @@ -132,8 +126,7 @@ /** * Delete a resource for this contact. - * @param res - * the resource de delete + * @param res the resource de delete */ public void delRes(String res) { mRes.remove(res); @@ -206,8 +199,7 @@ /** * Set the groups the contact is in. - * @param groups - * list of groups + * @param groups list of groups */ public void setGroups(Collection groups) { this.mGroups.clear(); @@ -218,8 +210,7 @@ /** * Set the groups the contact is in. - * @param groups - * the mGroups to set + * @param groups the mGroups to set */ public void setGroups(List groups) { this.mGroups = groups; @@ -227,8 +218,7 @@ /** * set the id of te contact on the phone contact list. - * @param mid - * the mID to set + * @param mid the mID to set */ public void setID(int mid) { mID = mid; @@ -236,8 +226,7 @@ /** * Set the Jabber ID of the contact. - * @param jid - * the jabber ID to set + * @param jid the jabber ID to set */ public void setJID(String jid) { mJID = jid; @@ -245,8 +234,7 @@ /** * Set a list of resource for the contact. - * @param mRes - * the mRes to set + * @param mRes the mRes to set */ public void setMRes(List mRes) { this.mRes = mRes; @@ -254,8 +242,7 @@ /** * Set the message status of the contact. - * @param msgState - * the message status of the contact to set + * @param msgState the message status of the contact to set */ public void setMsgState(String msgState) { mMsgState = msgState; @@ -263,8 +250,7 @@ /** * Set the name of the contact. - * @param name - * the mName to set + * @param name the mName to set */ public void setName(String name) { if (name != null) @@ -273,8 +259,7 @@ /** * Set the status of the contact. - * @param status - * the mStatus to set + * @param status the mStatus to set */ public void setStatus(int status) { mStatus = status; @@ -282,8 +267,7 @@ /** * Set the status of the contact using a presence packet. - * @param presence - * the presence containing status + * @param presence the presence containing status */ public void setStatus(Presence presence) { mStatus = Status.getStatusFromPresence(presence); @@ -292,8 +276,7 @@ /** * Set status for the contact. - * @param presence - * The presence packet which contains the status + * @param presence The presence packet which contains the status */ public void setStatus(PresenceAdapter presence) { mStatus = presence.getStatus(); diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/Message.java --- a/src/com/beem/project/beem/service/Message.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/Message.java Thu Oct 08 13:59:04 2009 +0200 @@ -53,9 +53,9 @@ private String mTo; private String mFrom; private String mThread; + // TODO ajouter l'erreur - /** * Constructor. * @param to the destinataire of the message @@ -95,7 +95,8 @@ mType = MSG_TYPE_NORMAL; break; // TODO gerer les message de type error - // this a little work around waiting for a better handling of error messages + // this a little work around waiting for a better handling of error + // messages case error: mType = MSG_TYPE_ERROR; break; diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/PresenceAdapter.java --- a/src/com/beem/project/beem/service/PresenceAdapter.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/PresenceAdapter.java Thu Oct 08 13:59:04 2009 +0200 @@ -20,8 +20,7 @@ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override - public PresenceAdapter createFromParcel( - Parcel source) { + public PresenceAdapter createFromParcel(Parcel source) { return new PresenceAdapter(source); } @@ -31,12 +30,11 @@ } }; - private int mType; - private int mStatus; - private String mTo; - private String mFrom; - private String mStatusText; - + private int mType; + private int mStatus; + private String mTo; + private String mFrom; + private String mStatusText; /** * constructor from Parcel. diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/RosterAdapter.java --- a/src/com/beem/project/beem/service/RosterAdapter.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/RosterAdapter.java Thu Oct 08 13:59:04 2009 +0200 @@ -162,7 +162,7 @@ public PresenceAdapter getPresence(String jid) throws RemoteException { return new PresenceAdapter(mAdaptee.getPresence(jid)); } - + @Override public void addContactToGroup(String groupName, String jid) throws RemoteException { createGroup(groupName); @@ -171,9 +171,9 @@ group.addEntry(mAdaptee.getEntry(jid)); } catch (XMPPException e) { e.printStackTrace(); - } + } } - + @Override public void removeContactFromGroup(String groupName, String jid) throws RemoteException { RosterGroup group = mAdaptee.getGroup(groupName); @@ -196,7 +196,7 @@ c.setGroups(entry.getGroups()); c.setName(entry.getName()); return c; - } + } /** * Listener for the roster events. It will call the remote listeners registered. @@ -235,7 +235,8 @@ */ @Override public void entriesAdded(Collection addresses) { - // Log.i(TAG, "Ajout de l'entry " + addresses.size() + " " + addresses.toArray()[0]); + // Log.i(TAG, "Ajout de l'entry " + addresses.size() + " " + + // addresses.toArray()[0]); final int n = mRemoteRosListeners.beginBroadcast(); List tab = new ArrayList(); @@ -277,7 +278,8 @@ */ @Override public void entriesUpdated(Collection addresses) { - // Log.i(TAG, "Update de l'entry " + addresses.size() + " " + addresses.toArray()[0]); + // Log.i(TAG, "Update de l'entry " + addresses.size() + " " + + // addresses.toArray()[0]); final int n = mRemoteRosListeners.beginBroadcast(); List tab = new ArrayList(); @@ -314,5 +316,5 @@ } mRemoteRosListeners.finishBroadcast(); } - } + } } diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Oct 08 13:59:04 2009 +0200 @@ -48,8 +48,7 @@ private RosterAdapter mRoster; private PrivacyListManagerAdapter mPrivacyList; private BeemService mService; - private RemoteCallbackList mRemoteConnListeners = - new RemoteCallbackList(); + private RemoteCallbackList mRemoteConnListeners = new RemoteCallbackList(); private ConnexionListenerAdapter mConListener = new ConnexionListenerAdapter(); @@ -134,13 +133,14 @@ mChatManager = new BeemChatManager(mAdaptee.getChatManager(), mService); mPrivacyList = new PrivacyListManagerAdapter(mAdaptee); - this.initFeatures(); // pour declarer les features xmpp qu'on supporte + this.initFeatures(); // pour declarer les features xmpp qu'on + // supporte ChatStateManager.getInstance(mAdaptee); triggerAsynchronousConnectEvent(); - //Priority between -128 and 128 - Presence p = new Presence(Presence.Type.available, "Beem : http://www.beem-project.com", - 128, Presence.Mode.available); + // Priority between -128 and 128 + Presence p = new Presence(Presence.Type.available, "Beem : http://www.beem-project.com", 128, + Presence.Mode.available); mAdaptee.sendPacket(p); return true; } catch (XMPPException e) { @@ -338,14 +338,14 @@ @Override public void processPacket(Packet packet) { String from = packet.getFrom(); - Notification notif = new Notification(com.beem.project.beem.R.drawable.signal, - mService.getString(R.string.AcceptContactRequest), System.currentTimeMillis()); + Notification notif = new Notification(com.beem.project.beem.R.drawable.signal, mService + .getString(R.string.AcceptContactRequest), System.currentTimeMillis()); notif.defaults = Notification.DEFAULT_ALL; notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); intent.putExtra("from", from); - notif.setLatestEventInfo(mService, from, mService.getString(R.string.AcceptContactRequestFrom) + from, - PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT)); + 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); } @@ -438,21 +438,19 @@ @Override public void processPacket(Packet packet) { String from = packet.getFrom(); - Notification notif = new Notification(com.beem.project.beem.R.drawable.signal, - mService.getString(R.string.AcceptContactRequest), System.currentTimeMillis()); + Notification notif = new Notification(com.beem.project.beem.R.drawable.signal, mService + .getString(R.string.AcceptContactRequest), System.currentTimeMillis()); notif.defaults = Notification.DEFAULT_ALL; notif.flags = Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(mService, Subscription.class); intent.putExtra("from", from); - notif.setLatestEventInfo(mService, from, - mService.getString(R.string.AcceptContactRequestFrom) + from, - PendingIntent.getActivity(mService, 0, intent, PendingIntent.FLAG_ONE_SHOT)); + 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); } }, filter); - final int n = mRemoteConnListeners.beginBroadcast(); for (int i = 0; i < n; i++) { diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/XmppFacade.java --- a/src/com/beem/project/beem/service/XmppFacade.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/XmppFacade.java Thu Oct 08 13:59:04 2009 +0200 @@ -25,9 +25,9 @@ */ public class XmppFacade extends IXmppFacade.Stub { - private XmppConnectionAdapter mConnexion; - private BeemService mBeemService; - private JingleService mJingle; + private XmppConnectionAdapter mConnexion; + private BeemService mBeemService; + private JingleService mJingle; /** * Constructor for XMPPFacade. @@ -138,7 +138,7 @@ VCard vcard = new VCard(); try { - vcard.load(mConnexion.getAdaptee(),jid); + vcard.load(mConnexion.getAdaptee(), jid); return vcard.getAvatar(); } catch (XMPPException e) { e.printStackTrace(); diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/service/package-info.java --- a/src/com/beem/project/beem/service/package-info.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/service/package-info.java Thu Oct 08 13:59:04 2009 +0200 @@ -1,5 +1,5 @@ /** - * This package contains the class used by the Beem service - * process. + * This package contains the class used by the Beem service process. */ package com.beem.project.beem.service; + diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/AddContact.java --- a/src/com/beem/project/beem/ui/AddContact.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/AddContact.java Thu Oct 08 13:59:04 2009 +0200 @@ -115,7 +115,6 @@ private final OnClickListener mOkListener = new OnClickListener() { - @Override public void onClick(View v) { String login; login = getWidgetText(R.id.addc_login); diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/ContactDialog.java --- a/src/com/beem/project/beem/ui/ContactDialog.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactDialog.java Thu Oct 08 13:59:04 2009 +0200 @@ -27,7 +27,7 @@ private final Context mContext; private IXmppFacade mXmppFacade; private final ServiceConnection mServConn = new BeemServiceConnection(); - + static { SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService")); } @@ -58,7 +58,7 @@ public void dismiss() { super.dismiss(); mContext.unbindService(mServConn); - } + } /** * Event simple click on call button. @@ -74,7 +74,8 @@ @Override public void onClick(View v) { try { - //TODO permettre a l'user de choisir a quel ressource il veut faire le call. + // TODO permettre a l'user de choisir a quel ressource il veut + // faire le call. mXmppFacade.call(mContact.getJID() + "/BEEM"); } catch (RemoteException e) { e.printStackTrace(); diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/CreateAccount.java --- a/src/com/beem/project/beem/ui/CreateAccount.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/CreateAccount.java Thu Oct 08 13:59:04 2009 +0200 @@ -41,7 +41,8 @@ /** * Constructor. */ - public CreateAccount() { } + public CreateAccount() { + } /** * {@inheritDoc} diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/GroupList.java --- a/src/com/beem/project/beem/ui/GroupList.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/GroupList.java Thu Oct 08 13:59:04 2009 +0200 @@ -42,7 +42,7 @@ private ArrayAdapter mGroups; private Contact mContact; private TextView mText; - private ArrayList mStrings = new ArrayList(); + private final ArrayList mStrings = new ArrayList(); static { SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService")); @@ -99,10 +99,11 @@ * @param position The position of the view in the list * @param id The row id of the item that was clicked */ + @Override protected void onListItemClick(ListView l, View v, int position, long id) { Log.d("GROUPLIST", "CLICK"); CheckedTextView textView = (CheckedTextView) v; - if (textView.isChecked()) { + if (textView.isChecked()) { try { mRoster.addContactToGroup(textView.getText().toString(), mJID); } catch (RemoteException e) { @@ -122,11 +123,10 @@ */ private void setAdapter() { try { - for (String group: mRoster.getGroupsNames()) { + for (String group : mRoster.getGroupsNames()) { mStrings.add(group); } - mGroups = new ArrayAdapter(this, - android.R.layout.simple_list_item_multiple_choice, mStrings); + mGroups = new ArrayAdapter(this, android.R.layout.simple_list_item_multiple_choice, mStrings); setListAdapter(mGroups); mContact = mRoster.getContact(mJID); for (String group : mContact.getGroups()) { @@ -137,6 +137,9 @@ } } + /** + * GroupListOnKeyListener class. + */ private class GroupListOnKeyListener implements OnKeyListener { @Override @@ -173,7 +176,8 @@ /** * Constructor. */ - public BeemServiceConnection() { } + public BeemServiceConnection() { + } @Override public void onServiceConnected(ComponentName name, IBinder service) { diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/SendIM.java --- a/src/com/beem/project/beem/ui/SendIM.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/SendIM.java Thu Oct 08 13:59:04 2009 +0200 @@ -78,7 +78,6 @@ private TextView mStatusText; private BeemBroadcastReceiver mReceiver; - /** * Constructor. */ @@ -100,7 +99,7 @@ @Override protected void onCreate(Bundle saveBundle) { super.onCreate(saveBundle); - //setTheme(R.style.OldTheme); + // setTheme(R.style.OldTheme); setContentView(R.layout.sendim); mHandler = new Handler(); mChatManagerListener = new OnChatListener(); @@ -287,7 +286,8 @@ /** * Constructor. */ - public BeemServiceConnection() { } + public BeemServiceConnection() { + } @Override public void onServiceConnected(ComponentName name, IBinder service) { @@ -399,7 +399,8 @@ /** * Constructor. */ - public OnChatListener() { } + public OnChatListener() { + } /** * {@inheritDoc} @@ -419,7 +420,8 @@ /** * Constructor. */ - public BeemRosterListener() { } + public BeemRosterListener() { + } @Override public void onEntriesAdded(List addresses) throws RemoteException { @@ -461,7 +463,8 @@ /** * Constructor. */ - public RunnableChange() { } + public RunnableChange() { + } @Override public void run() { @@ -470,8 +473,6 @@ } } - - } /** @@ -483,7 +484,8 @@ /** * Constructor. */ - public OnMessageListener() { } + public OnMessageListener() { + } /** * {@inheritDoc} diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/SendIMDialogSmiley.java --- a/src/com/beem/project/beem/ui/SendIMDialogSmiley.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/SendIMDialogSmiley.java Thu Oct 08 13:59:04 2009 +0200 @@ -11,7 +11,7 @@ public class SendIMDialogSmiley extends Dialog { @SuppressWarnings("unused") - private SendIM mSendIM; + private SendIM mSendIM; @SuppressWarnings("unused") private SharedPreferences mSet; diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/Settings.java --- a/src/com/beem/project/beem/ui/Settings.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/Settings.java Thu Oct 08 13:59:04 2009 +0200 @@ -66,9 +66,10 @@ public void onStop() { super.onStop(); SharedPreferences settings = getPreferenceManager().getSharedPreferences(); - settings.edit().putBoolean("PreferenceIsConfigured", + settings.edit().putBoolean( + "PreferenceIsConfigured", !"".equals(settings.getString("settings_key_account_username", "")) - || !"".equals(settings.getString("settings_key_account_password", ""))).commit(); + || !"".equals(settings.getString("settings_key_account_password", ""))).commit(); } /** @@ -81,8 +82,6 @@ return true; } - - /** * {@inheritDoc} */ @@ -97,9 +96,10 @@ case R.id.settings_menu_login: setResult(69); SharedPreferences settings = getPreferenceManager().getSharedPreferences(); - settings.edit().putBoolean("PreferenceIsConfigured", + settings.edit().putBoolean( + "PreferenceIsConfigured", !"".equals(settings.getString("settings_key_account_username", "")) - || !"".equals(settings.getString("settings_key_account_password", ""))).commit(); + || !"".equals(settings.getString("settings_key_account_password", ""))).commit(); this.stopService(SERVICE_INTENT); finish(); return true; diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/Subscription.java --- a/src/com/beem/project/beem/ui/Subscription.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/Subscription.java Thu Oct 08 13:59:04 2009 +0200 @@ -94,23 +94,21 @@ PresenceAdapter preAdapt = new PresenceAdapter(presence); try { mService.sendPresencePacket(preAdapt); - Toast.makeText(Subscription.this, getString(R.string.SubscriptAccept), - Toast.LENGTH_SHORT).show(); + Toast.makeText(Subscription.this, getString(R.string.SubscriptAccept), Toast.LENGTH_SHORT) + .show(); finish(); } catch (RemoteException e) { - Toast.makeText(Subscription.this, getString(R.string.SubscriptError), - Toast.LENGTH_SHORT).show(); + Toast.makeText(Subscription.this, getString(R.string.SubscriptError), Toast.LENGTH_SHORT) + .show(); e.printStackTrace(); } break; case R.id.SubscriptionRefuse: - Toast.makeText(Subscription.this, getString(R.string.SubscriptRefused), - Toast.LENGTH_SHORT).show(); + Toast.makeText(Subscription.this, getString(R.string.SubscriptRefused), Toast.LENGTH_SHORT).show(); break; default: - Toast.makeText(Subscription.this, getString(R.string.SubscriptError), - Toast.LENGTH_SHORT).show(); + Toast.makeText(Subscription.this, getString(R.string.SubscriptError), Toast.LENGTH_SHORT).show(); } } }; diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/UserInfo.java --- a/src/com/beem/project/beem/ui/UserInfo.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/UserInfo.java Thu Oct 08 13:59:04 2009 +0200 @@ -265,25 +265,25 @@ AlertDialog.Builder builder = new AlertDialog.Builder(UserInfo.this); builder.setMessage(UserInfo.this.getString(R.string.userinfo_sureresend)).setCancelable(false) - .setPositiveButton(UserInfo.this.getString(R.string.userinfo_yes), - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - Presence presencePacket = new Presence(Presence.Type.subscribe); - presencePacket.setTo(mContact.getJID()); - try { - mXmppFacade.sendPresencePacket(new PresenceAdapter(presencePacket)); - } catch (RemoteException e) { - e.printStackTrace(); - } - Toast.makeText(UserInfo.this, getString(R.string.userinfo_resend), Toast.LENGTH_SHORT) - .show(); - } - }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no), - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - dialog.cancel(); - } - }); + .setPositiveButton(UserInfo.this.getString(R.string.userinfo_yes), + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + Presence presencePacket = new Presence(Presence.Type.subscribe); + presencePacket.setTo(mContact.getJID()); + try { + mXmppFacade.sendPresencePacket(new PresenceAdapter(presencePacket)); + } catch (RemoteException e) { + e.printStackTrace(); + } + Toast.makeText(UserInfo.this, getString(R.string.userinfo_resend), Toast.LENGTH_SHORT) + .show(); + } + }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no), + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.cancel(); + } + }); AlertDialog alert = builder.create(); alert.show(); } @@ -305,21 +305,21 @@ public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(UserInfo.this); builder.setMessage(UserInfo.this.getString(R.string.userinfo_sure2delete)).setCancelable(false) - .setPositiveButton(UserInfo.this.getString(R.string.userinfo_yes), - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - try { - mRoster.deleteContact(mContact); - } catch (RemoteException e) { - e.printStackTrace(); - } - } - }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no), - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - dialog.cancel(); - } - }); + .setPositiveButton(UserInfo.this.getString(R.string.userinfo_yes), + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + try { + mRoster.deleteContact(mContact); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no), + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.cancel(); + } + }); AlertDialog alert = builder.create(); alert.show(); } @@ -343,7 +343,7 @@ public void onServiceConnected(ComponentName name, IBinder service) { mXmppFacade = IXmppFacade.Stub.asInterface(service); try { - mRoster = mXmppFacade.getRoster(); + mRoster = mXmppFacade.getRoster(); } catch (RemoteException e) { e.printStackTrace(); } diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/ui/package-info.java --- a/src/com/beem/project/beem/ui/package-info.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/ui/package-info.java Thu Oct 08 13:59:04 2009 +0200 @@ -1,5 +1,5 @@ /** - * This package contains the class concerning the user interface - * (activities) of Beem. + * This package contains the class concerning the user interface (activities) of Beem. */ package com.beem.project.beem.ui; + diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/utils/FreePort.java --- a/src/com/beem/project/beem/utils/FreePort.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/utils/FreePort.java Thu Oct 08 13:59:04 2009 +0200 @@ -9,6 +9,9 @@ */ public final class FreePort { + private static final int MAGIC_10 = 10; + private static final int MAGIC_10000 = 10000; + /** * Private default constructor. */ @@ -23,8 +26,8 @@ ServerSocket ss; int freePort = 0; - for (int i = 0; i < 10; i++) { - freePort = (int) (10000 + Math.round(Math.random() * 10000)); + for (int i = 0; i < MAGIC_10; i++) { + freePort = (int) (MAGIC_10000 + Math.round(Math.random() * MAGIC_10000)); try { ss = new ServerSocket(freePort); freePort = ss.getLocalPort(); diff -r 7ff358b52016 -r fe0ba62ee3ff src/com/beem/project/beem/utils/package-info.java --- a/src/com/beem/project/beem/utils/package-info.java Thu Oct 08 10:41:57 2009 +0200 +++ b/src/com/beem/project/beem/utils/package-info.java Thu Oct 08 13:59:04 2009 +0200 @@ -2,3 +2,4 @@ * This package contains utility class used by the Beem project. */ package com.beem.project.beem.utils; +