checkstyle
authornikita@nikita-laptop
Tue, 29 Dec 2009 20:48:16 +0100
changeset 613 58b8abc8719b
parent 612 e730f5770f8c (current diff)
parent 611 d5dfc657bfbe (diff)
child 614 38f529f0df86
checkstyle
.hgtags
AndroidManifest.xml
build.xml
src/com/beem/project/beem/BeemService.java
src/com/beem/project/beem/service/XmppFacade.java
src/com/beem/project/beem/ui/ChangeStatus.java
src/com/beem/project/beem/ui/dialogs/builders/Alias.java
src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java
src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java
src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java
src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java
src/com/beem/project/beem/ui/dialogs/builders/package-info.java
src/com/beem/project/beem/utils/BeemBroadcastReceiver.java
src/com/beem/project/beem/utils/BeemConnectivity.java
src/com/beem/project/beem/utils/PresenceType.java
src/com/beem/project/beem/utils/Status.java
--- a/AndroidManifest.xml	Wed Dec 23 03:14:56 2009 +0100
+++ b/AndroidManifest.xml	Tue Dec 29 20:48:16 2009 +0100
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	package="com.beem.project.beem" android:versionCode="1"
-	android:versionName="1.0">
+	android:versionName="0.1">
 	<application android:label="@string/app_name"
 		android:icon="@drawable/beem_launcher_icon_silver" android:theme="@style/Theme.BEEM.Default"
 		android:debuggable="true" android:name="@string/app_name">
@@ -84,8 +84,7 @@
 	<uses-permission android:name="android.permission.INTERNET"></uses-permission>
 	<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
 	<uses-permission android:name="com.beem.project.beem.BEEM_SERVICE"></uses-permission>
-	<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission>
 	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
-	<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
+	<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="6" />
 
 </manifest> 
--- a/build.xml	Wed Dec 23 03:14:56 2009 +0100
+++ b/build.xml	Tue Dec 29 20:48:16 2009 +0100
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project name="Beem" default="help">
+<project name="Beem">
 
     <!-- The local.properties file is created and updated by the 'android' tool.
          It contain the path to the SDK. It should *NOT* be checked in in Version
--- a/default.properties	Wed Dec 23 03:14:56 2009 +0100
+++ b/default.properties	Tue Dec 29 20:48:16 2009 +0100
@@ -10,5 +10,5 @@
 # Indicates whether an apk should be generated for each density.
 split.density=false
 # Project target.
-target=android-5
+target=android-6
 apk-configurations=
--- a/res/values-fr/strings.xml	Wed Dec 23 03:14:56 2009 +0100
+++ b/res/values-fr/strings.xml	Tue Dec 29 20:48:16 2009 +0100
@@ -70,7 +70,7 @@
 	<string name="ChangeStatusActTitle">Beem - Changer mon statut</string>
 	<string name="ChangeStatusType">Mon statut</string>
 	<string name="ChangeStatusMessage">Mon message personnel</string>
-	<string name="OpenContactList">Ouvrir la liste des contactes</string>
+	<string name="OpenContactList">Ouvrir la liste des contacts</string>
 
 	
 	<string name="MenuAddContact">Ajouter un nouveau contact</string>
@@ -119,7 +119,7 @@
 	<string name="BeemChatManagerNewMessage">Vous avez reçu un nouveau message</string>
 
 	<!--  BeemBroadcastReceiver class -->
-	<string name="BeemBroadcastReceiverDisconnect">Vous avez été déconnecté(e)</string>
+	<string name="BeemBroadcastReceiverDisconnect">BEEM: Vous avez été déconnecté(e)</string>
 
 	<!--  XmppConnectionAdapter class -->
 	<string name="AcceptContactRequest">%s vient de vous ajouter à sa liste d\'amis.</string>
--- a/res/values/strings.xml	Wed Dec 23 03:14:56 2009 +0100
+++ b/res/values/strings.xml	Tue Dec 29 20:48:16 2009 +0100
@@ -119,7 +119,7 @@
 	<string name="BeemChatManagerNewMessage">You\'ve a new message</string>
 
 	<!--  BeemBroadcastReceiver class -->
-	<string name="BeemBroadcastReceiverDisconnect">You have been disconnected</string>
+	<string name="BeemBroadcastReceiverDisconnect">BEEM: You have been disconnected</string>
 
 	<!--  XmppConnectionAdapter class -->
 	<string name="AcceptContactRequest">%s has just added you to his/her buddy list.</string>
--- a/src/com/beem/project/beem/BeemService.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Tue Dec 29 20:48:16 2009 +0100
@@ -40,7 +40,7 @@
     Flavien Astraud, November 26, 2009
     Head of the EIP Laboratory.
 
-*/
+ */
 package com.beem.project.beem;
 
 import org.jivesoftware.smack.ConnectionConfiguration;
@@ -82,8 +82,10 @@
 import android.app.NotificationManager;
 import android.app.Service;
 import android.content.Intent;
+import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.Editor;
+import android.net.ConnectivityManager;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.preference.PreferenceManager;
@@ -93,8 +95,9 @@
 import com.beem.project.beem.service.XmppConnectionAdapter;
 import com.beem.project.beem.service.XmppFacade;
 import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.utils.BeemBroadcastReceiver;
+import com.beem.project.beem.utils.BeemConnectivity;
 
-// TODO: Auto-generated Javadoc
 /**
  * This class is for the Beem service. The connection to the xmpp server will be made asynchronously when the service
  * will start.
@@ -123,6 +126,8 @@
     private boolean mUseProxy;
     private IXmppFacade.Stub mBind;
 
+    private BeemBroadcastReceiver mReceiver = new BeemBroadcastReceiver();
+
     /**
      * Constructor.
      */
@@ -188,8 +193,8 @@
      */
     @Override
     public void onCreate() {
-
 	super.onCreate();
+	registerReceiver(mReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
 	mSettings = PreferenceManager.getDefaultSharedPreferences(this);
 	String tmpJid = mSettings.getString("settings_key_account_username", "");
 	mLogin = StringUtils.parseName(tmpJid);
@@ -215,7 +220,7 @@
 
 	Roster.setDefaultSubscriptionMode(SubscriptionMode.manual);
 	mJingle = new JingleService(mConnection.getAdaptee());
-	mBind = new XmppFacade(mConnection, this, mJingle);
+	mBind = new XmppFacade(mConnection, mJingle);
 	Log.d(TAG, "ONCREATE");
     }
 
@@ -225,8 +230,10 @@
     @Override
     public void onDestroy() {
 	super.onDestroy();
+	Log.d("Service", "onDestroy");
 	mNotificationManager.cancelAll();
-	if (mConnection.isAuthentificated())
+	unregisterReceiver(mReceiver);
+	if (mConnection.isAuthentificated() && BeemConnectivity.isConnected(this))
 	    mConnection.disconnect();
 	Log.d(TAG, "ONDESTROY");
     }
@@ -316,8 +323,8 @@
 	// Chat State
 	pm.addExtensionProvider("active", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
 	pm
-	    .addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
-		new ChatStateExtension.Provider());
+	.addExtensionProvider("composing", "http://jabber.org/protocol/chatstates",
+	    new ChatStateExtension.Provider());
 	pm.addExtensionProvider("paused", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
 	pm.addExtensionProvider("inactive", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
 	pm.addExtensionProvider("gone", "http://jabber.org/protocol/chatstates", new ChatStateExtension.Provider());
--- a/src/com/beem/project/beem/service/RosterAdapter.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/service/RosterAdapter.java	Tue Dec 29 20:48:16 2009 +0100
@@ -147,7 +147,7 @@
 	try {
 	    mAdaptee.createGroup(groupname);
 	} catch (IllegalArgumentException e) {
-	    Log.e(TAG, "Error while creating group", e);
+	    Log.v(TAG, "Error while creating group", e);
 	}
     }
 
--- a/src/com/beem/project/beem/service/XmppFacade.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/service/XmppFacade.java	Tue Dec 29 20:48:16 2009 +0100
@@ -49,7 +49,6 @@
 
 import android.os.RemoteException;
 
-import com.beem.project.beem.BeemService;
 import com.beem.project.beem.jingle.JingleService;
 import com.beem.project.beem.service.aidl.IChatManager;
 import com.beem.project.beem.service.aidl.IPrivacyListManager;
@@ -65,7 +64,6 @@
 public class XmppFacade extends IXmppFacade.Stub {
 
     private final XmppConnectionAdapter mConnexion;
-    private final BeemService mBeemService;
     private final JingleService mJingle;
 
     /**
@@ -74,9 +72,8 @@
      * @param service the service which holds the facade
      * @param jingle the jingle session
      */
-    public XmppFacade(final XmppConnectionAdapter connection, final BeemService service, final JingleService jingle) {
+    public XmppFacade(final XmppConnectionAdapter connection, final JingleService jingle) {
 	this.mConnexion = connection;
-	this.mBeemService = service;
 	this.mJingle = jingle;
     }
 
--- a/src/com/beem/project/beem/ui/Chat.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java	Tue Dec 29 20:48:16 2009 +0100
@@ -552,15 +552,15 @@
      */
     private void prepareIconsStatus() {
 	mStatusIconsMap.put(Status.CONTACT_STATUS_AVAILABLE, BitmapFactory.decodeResource(getResources(),
-	    R.drawable.status_available));
+	    android.R.drawable.presence_online));
 	mStatusIconsMap.put(Status.CONTACT_STATUS_AVAILABLE_FOR_CHAT, BitmapFactory.decodeResource(getResources(),
-	    R.drawable.status_available));
+	    android.R.drawable.presence_online));
 	mStatusIconsMap.put(Status.CONTACT_STATUS_AWAY, BitmapFactory.decodeResource(getResources(),
-	    R.drawable.status_away));
+	    android.R.drawable.presence_away));
 	mStatusIconsMap.put(Status.CONTACT_STATUS_BUSY, BitmapFactory.decodeResource(getResources(),
-	    R.drawable.status_dnd));
+	    android.R.drawable.presence_busy));
 	mStatusIconsMap.put(Status.CONTACT_STATUS_DISCONNECT, BitmapFactory.decodeResource(getResources(),
-	    R.drawable.status_offline));
+	    android.R.drawable.presence_offline));
 	mStatusIconsMap.put(Status.CONTACT_STATUS_UNAVAILABLE, BitmapFactory.decodeResource(getResources(),
 	    R.drawable.status_requested));
     }
--- a/src/com/beem/project/beem/ui/ContactList.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java	Tue Dec 29 20:48:16 2009 +0100
@@ -266,7 +266,6 @@
     @Override
     protected void onCreate(Bundle saveBundle) {
 	super.onCreate(saveBundle);
-	Log.v(TAG, "onCreate");
 	mSettings = PreferenceManager.getDefaultSharedPreferences(this);
 	setContentView(R.layout.contactlist);
 
@@ -282,9 +281,12 @@
     @Override
     protected void onResume() {
 	super.onResume();
-	Log.d(TAG, "onResume");
 	if (mXmppFacade == null)
 	    bindService(SERVICE_INTENT, mServConn, BIND_AUTO_CREATE);
+	else {
+	    buildContactList();
+	    buildBanner();
+	}
     }
 
     /**
@@ -299,11 +301,10 @@
 		mRoster = null;
 	    }
 	} catch (RemoteException e) {
-	    Log.d("ContactList", "Remode exception", e);
+	    Log.d("ContactList", "Remote exception", e);
 	}
 	unbindService(mServConn);
 	mXmppFacade = null;
-	Log.e(TAG, "onPause activity");
     }
 
     /*
@@ -515,19 +516,19 @@
 	    for (String cToDelete : addresses) {
 		for (Contact c : mListContact) {
 		    if (c.getJID().equals(cToDelete)) {
-			mListContact.remove(c);
 			for (String group : mListGroup) {
 			    mContactOnGroup.get(group).remove(c);
 			    if (mContactOnGroup.get(group).size() == 0) {
-				mContactOnGroup.remove(group);
-				mListGroup.remove(group);
-				mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
+				//mContactOnGroup.remove(group);
+				//mListGroup.remove(group);
 			    }
 			}
+			mListContact.remove(c);
 			break;
 		    }
 		}
 	    }
+	    mListContact = mContactOnGroup.get(getString(R.string.contact_list_all_contact));
 	    mHandler.post(new RunnableChange());
 	}
 
--- a/src/com/beem/project/beem/ui/CreateAccount.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/CreateAccount.java	Tue Dec 29 20:48:16 2009 +0100
@@ -74,7 +74,6 @@
 
     private static final boolean DEFAULT_BOOLEAN_VALUE = false;
     private static final String DEFAULT_STRING_VALUE = "";
-    private static final int DEFAULT_INT_VALUE = 0;
     private static final int DEFAULT_XMPP_PORT = 5222;
 
     private static final int NOTIFICATION_DURATION = Toast.LENGTH_SHORT;
--- a/src/com/beem/project/beem/ui/dialogs/builders/Alias.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/Alias.java	Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+*/
 package com.beem.project.beem.ui.dialogs.builders;
 
 import android.app.AlertDialog;
@@ -28,17 +71,19 @@
      * Constructor.
      * @param context context activity.
      */
-    public Alias(final Context context, IRoster roster, Contact contact) {
+    public Alias(final Context context, final IRoster roster, final Contact contact) {
 	super(context);
 
 	mRoster = roster;
 	mContact = contact;
 
 	LayoutInflater factory = LayoutInflater.from(context);
-	final View textEntryView = factory.inflate(R.layout.contactdialogaliasdialog, null);
+	final View textEntryView = factory.inflate(
+	    R.layout.contactdialogaliasdialog, null);
 	setTitle(mContact.getJID());
 	setView(textEntryView);
-	mEditTextAlias = (EditText) textEntryView.findViewById(R.id.CDAliasDialogName);
+	mEditTextAlias = (EditText) textEntryView.findViewById(
+	    R.id.CDAliasDialogName);
 	mEditTextAlias.setText(mContact.getName());
 	setPositiveButton(R.string.OkButton, new DialogClickListener());
 	setNegativeButton(R.string.CancelButton, new DialogClickListener());
@@ -55,16 +100,14 @@
 	public DialogClickListener() {
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface, int)
-	 */
+
 	@Override
-	public void onClick(DialogInterface dialog, int which) {
+	public void onClick(final DialogInterface dialog, final int which) {
 	    if (which == DialogInterface.BUTTON_POSITIVE) {
 		String name = mEditTextAlias.getText().toString();
-		if (name.length() == 0)
+		if (name.length() == 0) {
 		    name = mContact.getJID();
+		}
 		try {
 		    mRoster.setContactName(mContact.getJID(), name);
 		} catch (RemoteException e) {
--- a/src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/CreatePrivacyList.java	Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+*/
 package com.beem.project.beem.ui.dialogs.builders;
 
 import java.util.ArrayList;
@@ -31,19 +74,23 @@
      * Constructor.
      * @param context context activity.
      */
-    public CreatePrivacyList(final Context context, IPrivacyListManager privacyListManager) {
+    public CreatePrivacyList(final Context context,
+	final IPrivacyListManager privacyListManager) {
 	super(context);
 
 	LayoutInflater factory = LayoutInflater.from(context);
-	
-	mTextEntryView = factory.inflate(R.layout.privacy_list_create_dialog, null);
+
+	mTextEntryView = factory.inflate(
+	    R.layout.privacy_list_create_dialog, null);
 	setView(mTextEntryView);
-	
+
 	mPrivacyListManager = privacyListManager;
-	mListNameField = (EditText) mTextEntryView.findViewById(R.id.privacy_list_create_dialog_list_name);
-	
+	mListNameField = (EditText) mTextEntryView.findViewById(
+	    R.id.privacy_list_create_dialog_list_name);
+
 	setTitle(R.string.privacy_list_create_dialog_title);
-	setPositiveButton(R.string.privacy_list_create_dialog_create_button, new DialogClickListener());
+	setPositiveButton(R.string.privacy_list_create_dialog_create_button,
+	    new DialogClickListener());
 	setNegativeButton(R.string.CancelButton, new DialogClickListener());
     }
 
@@ -58,12 +105,8 @@
 	public DialogClickListener() {
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface, int)
-	 */
 	@Override
-	public void onClick(DialogInterface dialog, int which) {
+	public void onClick(final DialogInterface dialog, final int which) {
 	    if (which == DialogInterface.BUTTON_POSITIVE) {
 		try {
 		    Log.d(TAG, "mPrivacyListManager ## " + mPrivacyListManager);
--- a/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeleteContact.java	Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+*/
 package com.beem.project.beem.ui.dialogs.builders;
 
 import android.app.AlertDialog;
@@ -21,7 +64,8 @@
      * Constructor.
      * @param context context activity.
      */
-    public DeleteContact(final Context context, IRoster roster, Contact contact) {
+    public DeleteContact(final Context context, final IRoster roster,
+	final Contact contact) {
 	super(context);
 
 	mContact = contact;
@@ -45,7 +89,7 @@
 	}
 
 	@Override
-	public void onClick(DialogInterface dialog, int which) {
+	public void onClick(final DialogInterface dialog, final int which) {
 	    if (which == DialogInterface.BUTTON_POSITIVE) {
 		try {
 		    mRoster.deleteContact(mContact);
--- a/src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/DeletePrivacyList.java	Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+*/
 package com.beem.project.beem.ui.dialogs.builders;
 
 import android.app.AlertDialog;
@@ -20,13 +63,15 @@
      * Constructor.
      * @param context context activity.
      */
-    public DeletePrivacyList(final Context context, IPrivacyListManager privacyListManager, String privacyListName) {
+    public DeletePrivacyList(final Context context,
+	final IPrivacyListManager privacyListManager, final String privacyListName) {
 	super(context);
 
 	mPrivacyListManager = privacyListManager;
 	mPrivacyListName = privacyListName;
 
-	setMessage(context.getString(R.string.privacy_list_delete_dialog_msg, privacyListName));
+	setMessage(context.getString(
+	    R.string.privacy_list_delete_dialog_msg, privacyListName));
 	DialogClickListener dl = new DialogClickListener();
 	setPositiveButton(R.string.privacy_list_delete_dialog_yes, dl);
 	setNegativeButton(R.string.privacy_list_delete_dialog_no, dl);
@@ -44,7 +89,7 @@
 	}
 
 	@Override
-	public void onClick(DialogInterface dialog, int which) {
+	public void onClick(final DialogInterface dialog, final int which) {
 	    if (which == DialogInterface.BUTTON_POSITIVE) {
 		try {
 		    mPrivacyListManager.removePrivacyList(mPrivacyListName);
--- a/src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/ui/dialogs/builders/ResendSubscription.java	Tue Dec 29 20:48:16 2009 +0100
@@ -1,3 +1,46 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+*/
 package com.beem.project.beem.ui.dialogs.builders;
 
 import org.jivesoftware.smack.packet.Presence;
@@ -26,7 +69,8 @@
      * Constructor.
      * @param context context activity
      */
-    public ResendSubscription(final Context context, IXmppFacade xmppFacade, Contact contact) {
+    public ResendSubscription(final Context context,
+	final IXmppFacade xmppFacade, final Contact contact) {
 	super(context);
 
 	mContext = context;
@@ -50,18 +94,16 @@
 	DialogClickListener() {
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface, int)
-	 */
 	@Override
-	public void onClick(DialogInterface dialog, int which) {
+	public void onClick(final DialogInterface dialog, final int which) {
 	    if (which == DialogInterface.BUTTON_POSITIVE) {
 		Presence presencePacket = new Presence(Presence.Type.subscribe);
 		presencePacket.setTo(mContact.getJID());
 		try {
-		    mXmppFacade.sendPresencePacket(new PresenceAdapter(presencePacket));
-		    Toast.makeText(mContext, mContext.getString(R.string.userinfo_resend), Toast.LENGTH_SHORT).show();
+		    mXmppFacade.sendPresencePacket(
+			new PresenceAdapter(presencePacket));
+		    Toast.makeText(mContext, mContext.getString(
+			R.string.userinfo_resend), Toast.LENGTH_SHORT).show();
 		} catch (RemoteException e) {
 		    Log.e(TAG, e.getMessage());
 		}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/dialogs/builders/package-info.java	Tue Dec 29 20:48:16 2009 +0100
@@ -0,0 +1,48 @@
+/*
+    BEEM is a videoconference application on the Android Platform.
+
+    Copyright (C) 2009 by Frederic-Charles Barthelery,
+                          Jean-Manuel Da Silva,
+                          Nikita Kozlov,
+                          Philippe Lago,
+                          Jean Baptiste Vergely,
+                          Vincent Veronis.
+
+    This file is part of BEEM.
+
+    BEEM is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    BEEM is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with BEEM.  If not, see <http://www.gnu.org/licenses/>.
+
+    Please send bug reports with examples or suggestions to
+    contact@beem-project.com or http://dev.beem-project.com/
+
+    Epitech, hereby disclaims all copyright interest in the program "Beem"
+    written by Frederic-Charles Barthelery,
+               Jean-Manuel Da Silva,
+               Nikita Kozlov,
+               Philippe Lago,
+               Jean Baptiste Vergely,
+               Vincent Veronis.
+
+    Nicolas Sadirac, November 26, 2009
+    President of Epitech.
+
+    Flavien Astraud, November 26, 2009
+    Head of the EIP Laboratory.
+
+*/
+/**
+ * This package contains Beem dialog builder's.
+ */
+package com.beem.project.beem.ui.dialogs.builders;
+
--- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java	Tue Dec 29 20:48:16 2009 +0100
@@ -48,12 +48,10 @@
 import android.content.Context;
 import android.content.Intent;
 import android.net.ConnectivityManager;
-import android.util.Log;
 import android.widget.Toast;
 
 import com.beem.project.beem.BeemService;
 
-// TODO: Auto-generated Javadoc
 /**
  * Manage broadcast disconnect intent.
  * @author nikita
@@ -73,12 +71,7 @@
      * {@inheritDoc}
      */
     @Override
-    public void onReceive(Context context, Intent intent) {
-	Log.d("Broadcast", "onReceive");
-	// TODO ce code est comment car il empeche de gerer un cancel sur une connexion
-	// start activity if unexpected disconnection
-	// if (!intent.getBooleanExtra("normally", false))
-	// context.startActivity(new Intent(context, Login.class));
+    public void onReceive(final Context context, final Intent intent) {
 	String intentAction = intent.getAction();
 	if (intentAction.equals(BEEM_CONNECTION_CLOSED)) {
 	    CharSequence message = intent.getCharSequenceExtra("message");
--- a/src/com/beem/project/beem/utils/BeemConnectivity.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/utils/BeemConnectivity.java	Tue Dec 29 20:48:16 2009 +0100
@@ -40,7 +40,7 @@
     Flavien Astraud, November 26, 2009
     Head of the EIP Laboratory.
 
-*/
+ */
 package com.beem.project.beem.utils;
 
 import android.content.Context;
@@ -66,8 +66,9 @@
      * @param ctx the ctx
      * @return true, if is connected
      */
-    public static boolean isConnected(Context ctx) {
-	ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
+    public static boolean isConnected(final Context ctx) {
+	ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(
+	    Context.CONNECTIVITY_SERVICE);
 	NetworkInfo ni = cm.getActiveNetworkInfo();
 	return ni != null && ni.isConnected();
     }
@@ -77,14 +78,15 @@
      * @param ctx the ctx
      * @return true, if is wifi
      */
-    public static boolean isWifi(Context ctx) {
-	WifiManager wm = (WifiManager) ctx.getSystemService(Context.WIFI_SERVICE);
+    public static boolean isWifi(final Context ctx) {
+	WifiManager wm = (WifiManager) ctx.getSystemService(
+	    Context.WIFI_SERVICE);
 	WifiInfo wi = wm.getConnectionInfo();
-	if (wi != null)
-	    return false;
 	if (wi != null
-	    && (WifiInfo.getDetailedStateOf(wi.getSupplicantState()) == DetailedState.OBTAINING_IPADDR || WifiInfo
-		.getDetailedStateOf(wi.getSupplicantState()) == DetailedState.CONNECTED)) {
+	    && (WifiInfo.getDetailedStateOf(wi.getSupplicantState())
+		== DetailedState.OBTAINING_IPADDR
+		|| WifiInfo.getDetailedStateOf(wi.getSupplicantState())
+		== DetailedState.CONNECTED)) {
 	    return false;
 	}
 	return false;
@@ -95,11 +97,10 @@
      * @param ctx the ctx
      * @return true, if is umts
      */
-    public static boolean isUmts(Context ctx) {
-	TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
-	if (tm.getNetworkType() >= TelephonyManager.NETWORK_TYPE_UMTS)
-	    return true;
-	return false;
+    public static boolean isUmts(final Context ctx) {
+	TelephonyManager tm = (TelephonyManager) ctx.getSystemService(
+	    Context.TELEPHONY_SERVICE);
+	return tm.getNetworkType() >= TelephonyManager.NETWORK_TYPE_UMTS;
     }
 
     /**
@@ -107,11 +108,10 @@
      * @param ctx the ctx
      * @return true, if is edge
      */
-    public static boolean isEdge(Context ctx) {
-	TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
-	if (tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_EDGE)
-	    return true;
-	return false;
+    public static boolean isEdge(final Context ctx) {
+	TelephonyManager tm = (TelephonyManager) ctx.getSystemService(
+	    Context.TELEPHONY_SERVICE);
+	return tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_EDGE;
     }
 
 }
--- a/src/com/beem/project/beem/utils/PresenceType.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/utils/PresenceType.java	Tue Dec 29 20:48:16 2009 +0100
@@ -84,7 +84,7 @@
      * @param presence the presence type
      * @return an int representing the presence type
      */
-    public static int getPresenceType(Presence presence) {
+    public static int getPresenceType(final Presence presence) {
 	int res = PresenceType.ERROR;
 	switch (presence.getType()) {
 	    case available:
@@ -117,7 +117,7 @@
      * @param type the status type in beem
      * @return the presence mode to use in presence packet or null if there is no mode to use
      */
-    public static Presence.Type getPresenceTypeFrom(int type) {
+    public static Presence.Type getPresenceTypeFrom(final int type) {
 	Presence.Type res;
 	switch (type) {
 	    case AVAILABLE:
--- a/src/com/beem/project/beem/utils/Status.java	Wed Dec 23 03:14:56 2009 +0100
+++ b/src/com/beem/project/beem/utils/Status.java	Tue Dec 29 20:48:16 2009 +0100
@@ -81,7 +81,7 @@
      * @param status the status in beem
      * @return the presence mode to use in presence packet or null if there is no mode to use
      */
-    public static Presence.Mode getPresenceModeFromStatus(int status) {
+    public static Presence.Mode getPresenceModeFromStatus(final int status) {
 	Presence.Mode res;
 	switch (status) {
 	    case CONTACT_STATUS_AVAILABLE:
@@ -110,7 +110,7 @@
      * @param presence the presence containing status
      * @return an int representing the status
      */
-    public static int getStatusFromPresence(Presence presence) {
+    public static int getStatusFromPresence(final Presence presence) {
 	int res = Status.CONTACT_STATUS_DISCONNECT;
 	if (presence.getType().equals(Presence.Type.unavailable)) {
 	    res = Status.CONTACT_STATUS_DISCONNECT;
@@ -149,7 +149,7 @@
      * @param status contact status
      * @return is obline
      */
-    public static boolean statusOnline(int status) {
+    public static boolean statusOnline(final int status) {
 	return status != Status.CONTACT_STATUS_DISCONNECT && status != Status.CONTACT_STATUS_UNAVAILABLE;
     }