merge
authorDa Risk <darisk972@gmail.com>
Tue, 17 Nov 2009 00:27:43 +0100
changeset 526 62a448d5dfe9
parent 521 0444ac5038a0 (diff)
parent 525 32e700f9f07e (current diff)
child 527 d9e22d4c2bb2
merge
default.properties
res/layout/chat.xml
res/layout/preferences.xml
res/values-fr/strings.xml
res/values/strings.xml
src/com/beem/project/beem/BeemService.java
src/com/beem/project/beem/service/BeemChatManager.java
src/com/beem/project/beem/service/XmppConnectionAdapter.java
src/com/beem/project/beem/service/XmppFacade.java
src/com/beem/project/beem/service/aidl/IXmppConnection.aidl
src/com/beem/project/beem/ui/Chat.java
--- a/.classpath	Mon Nov 16 22:39:11 2009 +0100
+++ b/.classpath	Tue Nov 17 00:27:43 2009 +0100
@@ -8,7 +8,7 @@
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="lib" path="libs/security.jar"/>
-	<classpathentry kind="lib" path="libs/smack.jar" sourcepath="/home/nikita/devel/smack/source">
+	<classpathentry kind="lib" path="libs/smack.jar" sourcepath="/home/marseille/smack_src_3_1_0/source">
 		<attributes>
 			<attribute name="javadoc_location" value="file:/home/nikita/devel/smack_src_3_1_0/javadoc/org/"/>
 		</attributes>
--- a/AndroidManifest.xml	Mon Nov 16 22:39:11 2009 +0100
+++ b/AndroidManifest.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -2,10 +2,9 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	package="com.beem.project.beem" android:versionCode="1"
 	android:versionName="1.0">
-	<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"
-		>
+	<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">
 		<activity android:name=".ui.Login" android:label="@string/app_name"
 			android:launchMode="singleTask">
 			<intent-filter>
@@ -26,8 +25,9 @@
 		<activity android:name=".ui.Chat" android:label="@string/chat_name"
 			android:launchMode="singleTop">
 			<intent-filter android:label="Beem Connection">
-				<action android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
-			</intent-filter>		
+				<action
+					android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
+			</intent-filter>
 		</activity>
 		<activity android:name=".ui.ChangeStatus" android:label="@string/ChangeStatusActTitle">
 			<intent-filter android:label="Beem Connection">
@@ -74,6 +74,12 @@
 					android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
 			</intent-filter>
 		</activity>
+		<activity android:name=".ui.PrivacyList" android:label="@string/privacy_list_name">
+			<intent-filter android:label="Beem Connection">
+				<action
+					android:name="com.beem.project.beem.service.XmppConnectionAdapter.CONNECTION_CLOSED" />
+			</intent-filter>
+		</activity>
 		<service android:name="BeemService" android:enabled="true"
 			android:label="Beem Service" android:permission="com.beem.project.beem.BEEM_SERVICE">
 			<intent-filter>
--- a/default.properties	Mon Nov 16 22:39:11 2009 +0100
+++ b/default.properties	Tue Nov 17 00:27:43 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-3
 apk-configurations=
--- a/res/layout/chat.xml	Mon Nov 16 22:39:11 2009 +0100
+++ b/res/layout/chat.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -3,9 +3,9 @@
 	android:layout_width="fill_parent" android:layout_height="fill_parent"
 	android:orientation="vertical">
 	<LinearLayout android:id="@+id/chat_header"
-		android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"
-		android:gravity="center_vertical" android:background="#222222"
-		android:padding="4px">
+		android:layout_width="fill_parent" android:layout_height="wrap_content"
+		android:orientation="horizontal" android:gravity="center_vertical"
+		android:background="#222222" android:padding="4px">
 		<ImageView android:id="@+id/chat_contact_status_icon"
 			android:adjustViewBounds="true" android:layout_width="wrap_content"
 			android:layout_height="wrap_content" android:gravity="center_vertical" />
@@ -25,13 +25,20 @@
 	<View android:layout_width="fill_parent" android:layout_height="2dp"
 		android:fadingEdge="horizontal" android:background="#555555" />
 	<ListView android:id="@+id/chat_messages"
-		android:layout_width="fill_parent"
-		android:layout_height="0px" android:layout_weight="1"
-		android:transcriptMode="normal" android:fastScrollEnabled="true"
-		android:smoothScrollbar="false" android:layout_marginBottom="20sp"
-		android:padding="4px" />
-	<EditText android:id="@+id/chat_input" android:layout_width="fill_parent"
-		android:layout_height="wrap_content" android:inputType="textShortMessage"
-		android:imeOptions="actionSend" android:cursorVisible="true"
-		android:hint="@string/chat_input_default_value" />
+		android:layout_width="fill_parent" android:layout_height="0px"
+		android:layout_weight="1" android:transcriptMode="normal"
+		android:fastScrollEnabled="true" android:smoothScrollbar="false"
+		android:layout_marginBottom="20sp" android:padding="4px" />
+	<LinearLayout android:layout_width="fill_parent"
+		android:layout_height="wrap_content" android:orientation="horizontal"
+		android:background="#222222" android:padding="8px">
+		<EditText android:id="@+id/chat_input" android:layout_width="wrap_content"
+			android:layout_height="fill_parent" android:layout_weight="1"
+			android:ellipsize="end" android:inputType="textShortMessage|textAutoCorrect"
+			android:imeOptions="actionSend" android:cursorVisible="true"
+			android:hint="@string/chat_input_default_value" />
+		<Button android:id="@+id/chat_send_message"
+			android:layout_width="wrap_content" android:layout_height="fill_parent"
+			android:text="@string/chat_send_message" />
+	</LinearLayout>
 </LinearLayout>
--- a/res/layout/preferences.xml	Mon Nov 16 22:39:11 2009 +0100
+++ b/res/layout/preferences.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -1,42 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen
-	xmlns:android="http://schemas.android.com/apk/res/android"
-	android:shouldDisableView="true"	
-	android:selectable="true">
-
-	<PreferenceCategory
-		android:title="@string/general_preferences">
-		
-		<PreferenceScreen
-			android:key="contact_list"
-			android:title="@string/contact_list_preferences"
-			android:summary="@string/contact_list_preferences_sum">
-			
-			<CheckBoxPreference
-				android:title="@string/CLP_hidden_contact"
-				android:defaultValue="false"
-				android:summary="@string/CLP_hidden_contact_sum"
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+	android:shouldDisableView="true" android:selectable="true">
+	<PreferenceCategory android:title="@string/general_preferences">
+		<PreferenceScreen android:key="contact_list"
+			android:title="@string/contact_list_preferences" android:summary="@string/contact_list_preferences_sum">
+			<CheckBoxPreference android:title="@string/CLP_hidden_contact"
+				android:defaultValue="false" android:summary="@string/CLP_hidden_contact_sum"
 				android:key="settings_key_hidden_contact" />
-
 		</PreferenceScreen>
-
 	</PreferenceCategory>
-	
-	<PreferenceCategory
-		android:title="@string/user_preferences">
-
-		<EditTextPreference
-			android:singleLine="true"
-			android:summary="@string/SettingsText"
-			android:title="@string/settings_account_username"
+	<PreferenceCategory android:title="@string/user_preferences">
+		<EditTextPreference android:singleLine="true"
+			android:summary="@string/SettingsText" android:title="@string/settings_account_username"
 			android:key="settings_key_account_username" />
-		<EditTextPreference
-			android:name="password"
-			android:singleLine="true"
-			android:password="true"
-			android:summary="@string/SettingsPassword"
-			android:title="@string/settings_account_password"
-			android:key="settings_key_account_password" />
+		<EditTextPreference android:name="password"
+			android:singleLine="true" android:password="true" android:summary="@string/SettingsPassword"
+			android:title="@string/settings_account_password" android:key="settings_key_account_password" />
 		<EditTextPreference
 		    android:key="settings_key_resource"
 		    android:title="@string/SettingsResourceTitle"
@@ -48,130 +27,64 @@
 		    android:summary="@string/SettingsPrioritySummary"
 		    android:numeric="integer"
 		    android:defaultValue="0" />
-		<CheckBoxPreference
-			android:title="@string/SettingsCheckboxText"
-			android:defaultValue="false"
-			android:summary="@string/SettingsGmail"
+		<CheckBoxPreference android:title="@string/SettingsCheckboxText"
+			android:defaultValue="false" android:summary="@string/SettingsGmail"
 			android:key="settings_key_gmail" />
-		
-	</PreferenceCategory>		
-
-	<PreferenceCategory
-		android:title="@string/network_preferences">
-	
-		<PreferenceScreen
-			android:key="proxy"
-			android:title="@string/SettingsProxy"
-			android:summary="@string/settings_proxy_sum">
-	
-			<CheckBoxPreference
-				android:title="@string/SettingsProxyProxy"
-				android:defaultValue="false"
-				android:summary="@string/SettingsProxySummary"
-				android:key="settings_key_proxy_use" />
-	
-			<PreferenceCategory
-			   android:title="@string/proxy_proxy_settings">
-
-				<ListPreference
-					android:dependency="settings_key_proxy_use"
-					android:title="@string/SettingsProxyType"
-					android:entries="@array/proxy_types"
-					android:summary="@string/SettingsProxyTypeSummary"
-					android:defaultValue="HTTP"
-					android:entryValues="@array/proxy_types"
-					android:key="settings_key_proxy_type" />
-
-				<EditTextPreference
-					android:singleLine="true"
-					android:dependency="settings_key_proxy_use"
-					android:name="serveur"
-					android:summary="@string/SettingsProxyServer"
-					android:title="@string/settings_proxy_server"
-					android:key="settings_key_proxy_server" />
-
-				<EditTextPreference 
-					android:singleLine="true"
-					android:dependency="settings_key_proxy_use"
-					android:name="port"
-					android:summary="@string/SettingsProxyPort"
-					android:title="@string/settings_proxy_port"
-					android:key="settings_key_proxy_port" />
-
-			</PreferenceCategory>
-			
-			<PreferenceCategory
-			   android:title="@string/proxy_user_settings">
-
-				<EditTextPreference
-					android:singleLine="true"
-					android:dependency="settings_key_proxy_use"
-					android:name="Utilisateur"
-					android:summary="@string/SettingsProxyUser"
-					android:title="@string/settings_proxy_username"
-					android:key="settings_key_proxy_username" />
+	</PreferenceCategory>
 
-				<EditTextPreference
-					android:singleLine="true"
-					android:dependency="settings_key_proxy_use"
-					android:name="pass_user"
-					android:password="true"
-					android:summary="@string/SettingsProxyPassword"
-					android:title="@string/settings_proxy_password"
-					android:key="settings_key_proxy_password" />
-
+	<PreferenceCategory android:title="@string/network_preferences">
+		<PreferenceScreen android:key="proxy" android:title="@string/SettingsProxy"
+			android:summary="@string/settings_proxy_sum">
+			<CheckBoxPreference android:title="@string/SettingsProxyProxy"
+				android:defaultValue="false" android:summary="@string/SettingsProxySummary"
+				android:key="settings_key_proxy_use" />
+			<PreferenceCategory android:title="@string/proxy_proxy_settings">
+				<ListPreference android:dependency="settings_key_proxy_use"
+					android:title="@string/SettingsProxyType" android:entries="@array/proxy_types"
+					android:summary="@string/SettingsProxyTypeSummary"
+					android:defaultValue="HTTP" android:entryValues="@array/proxy_types"
+					android:key="settings_key_proxy_type" />
+				<EditTextPreference android:singleLine="true"
+					android:dependency="settings_key_proxy_use" android:name="serveur"
+					android:summary="@string/SettingsProxyServer" android:title="@string/settings_proxy_server"
+					android:key="settings_key_proxy_server" />
+				<EditTextPreference android:singleLine="true"
+					android:dependency="settings_key_proxy_use" android:name="port"
+					android:summary="@string/SettingsProxyPort" android:title="@string/settings_proxy_port"
+					android:key="settings_key_proxy_port" />
 			</PreferenceCategory>
-	
+			<PreferenceCategory android:title="@string/proxy_user_settings">
+				<EditTextPreference android:singleLine="true"
+					android:dependency="settings_key_proxy_use" android:name="Utilisateur"
+					android:summary="@string/SettingsProxyUser" android:title="@string/settings_proxy_username"
+					android:key="settings_key_proxy_username" />
+				<EditTextPreference android:singleLine="true"
+					android:dependency="settings_key_proxy_use" android:name="pass_user"
+					android:password="true" android:summary="@string/SettingsProxyPassword"
+					android:title="@string/settings_proxy_password" android:key="settings_key_proxy_password" />
+			</PreferenceCategory>
 		</PreferenceScreen>
-	
-		<PreferenceScreen
-			android:key="advanced"
-			android:title="@string/SettingsAdvanced"
-			android:summary="@string/settings_advanced_sum">
-			
-			<PreferenceCategory
-				android:title="@string/settings_advanced_service_behaviour">
-	
-				<CheckBoxPreference
-					android:title="@string/settings_xmpp_use_tls"
-					android:defaultValue="false"
-					android:key="settings_key_xmpp_tls_use" />
-				
-				<EditTextPreference
-					android:singleLine="true"
-					android:title="@string/settings_reco_delay"
-					android:name="Reconnect delay"
-					android:summary="@string/SettingsAdvancedRecoDelay"
-					android:key="settings_key_reco_delay"
+		<PreferenceScreen android:key="advanced"
+			android:title="@string/SettingsAdvanced" android:summary="@string/settings_advanced_sum">
+			<PreferenceCategory android:title="@string/settings_advanced_service_behaviour">
+				<CheckBoxPreference android:title="@string/settings_xmpp_use_tls"
+					android:defaultValue="false" android:key="settings_key_xmpp_tls_use" />
+				<EditTextPreference android:singleLine="true"
+					android:title="@string/settings_reco_delay" android:name="Reconnect delay"
+					android:summary="@string/SettingsAdvancedRecoDelay" android:key="settings_key_reco_delay"
 					android:defaultValue="10" />
-			
 			</PreferenceCategory>
-			
-			<CheckBoxPreference
-				android:title="@string/SettingsAdvancedOptions"
-				android:defaultValue="false"
-				android:summary="@string/SettingsAdvancedSpecOpt"
+			<CheckBoxPreference android:title="@string/SettingsAdvancedOptions"
+				android:defaultValue="false" android:summary="@string/SettingsAdvancedSpecOpt"
 				android:key="settings_key_specific_server" />
-				
-				<EditTextPreference
-					android:singleLine="true"
-					android:dependency="settings_key_specific_server"
-					android:name="adresse"
-					android:summary="@string/SettingsAdvancedAddOpt"
-					android:title="@string/settings_xmpp_server"
-					android:key="settings_key_xmpp_server"/>
-					
-				<EditTextPreference
-					android:singleLine="true"
-					android:dependency="settings_key_specific_server"
-					android:name="port"
-					android:summary="@string/SettingsAdvancedPortOpt"
-					android:title="@string/settings_xmpp_port"
-					android:defaultValue="5222"
-					android:key="settings_key_xmpp_port" />
-
+			<EditTextPreference android:singleLine="true"
+				android:dependency="settings_key_specific_server" android:name="adresse"
+				android:summary="@string/SettingsAdvancedAddOpt" android:title="@string/settings_xmpp_server"
+				android:key="settings_key_xmpp_server" />
+			<EditTextPreference android:singleLine="true"
+				android:dependency="settings_key_specific_server" android:name="port"
+				android:summary="@string/SettingsAdvancedPortOpt" android:title="@string/settings_xmpp_port"
+				android:defaultValue="5222" android:key="settings_key_xmpp_port" />
 		</PreferenceScreen>
-
 	</PreferenceCategory>
-	
 </PreferenceScreen>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/privacy_list.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="vertical" android:layout_width="fill_parent"
+	android:layout_height="fill_parent" android:padding="8dp">
+	<ListView android:id="@id/android:list" android:layout_width="fill_parent"
+		android:layout_height="fill_parent" android:layout_weight="1"
+		android:drawSelectorOnTop="false" />
+	<TextView android:id="@id/android:empty" android:layout_width="fill_parent"
+		android:layout_height="fill_parent" android:text="@string/privacy_list_no_data" />
+</LinearLayout>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/privacy_list_create_dialog.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,14 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent" android:layout_height="wrap_content"
+	android:orientation="vertical">
+	<TextView android:id="@+id/privacy_list_create_dialog_list_name_label"
+		android:layout_height="wrap_content" android:layout_width="wrap_content"
+		android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
+		android:text="@string/privacy_list_create_dialog_list_name_label" android:gravity="left"
+		style="@style/Label" />
+	<EditText android:id="@+id/privacy_list_create_dialog_list_name"
+		android:layout_height="wrap_content" android:layout_width="fill_parent"
+		android:layout_marginLeft="20dip" android:layout_marginRight="20dip"
+		android:scrollHorizontally="true" android:autoText="false"
+		android:capitalize="none" android:gravity="fill_horizontal" />
+</LinearLayout>
--- a/res/menu/edit_settings.xml	Mon Nov 16 22:39:11 2009 +0100
+++ b/res/menu/edit_settings.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -7,4 +7,8 @@
 		android:visible="true"
 		android:title="@string/settings_menu_login"
 		android:icon="@drawable/ic_menu_login" />
+	<item android:id="@+id/settings_menu_privacy_lists"
+		android:visible="true"
+		android:title="@string/settings_menu_privacy_lists"
+		android:icon="@drawable/ic_menu_blocked_user" />
 </menu>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/res/menu/privacy_list.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,4 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+	<item android:id="@+id/privacy_list_menu_create" android:visible="true"
+		android:title="@string/privacy_list_menu_create" android:icon="@drawable/ic_menu_add" />
+</menu>
--- a/res/values-fr/strings.xml	Mon Nov 16 22:39:11 2009 +0100
+++ b/res/values-fr/strings.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -65,11 +65,11 @@
 	<string name="SendIMSmiley">Insérer un sourire</string>
 	<string name="SendIMLoginHint">Nom d\'utilisateur</string>
 	<string name="SendIMNoStatusSet">Aucun statut défini</string>
-	
+
 	<!--  ChangeStatus class -->
 	<string name="ChangeStatusActTitle">Beem - Changer mon statut</string>
 
-	<string name="ChangeStatusType">Mon statut</string>	
+	<string name="ChangeStatusType">Mon statut</string>
 	<string name="ChangeStatusMessage">Mon message personnel</string>
 	<string name="MenuAddContact">Ajouter un nouveau contact</string>
 	<string name="MenuAccountAbout">Beem Project</string>
@@ -77,7 +77,7 @@
 	<string name="MenuConnection">Modifier un compte</string>
 	<string name="ChangeStatusOk">Mise à jour du statut</string>
 	<string name="ChangeStatusNoChange">Rien à changer</string>
-	
+
 	<!-- Settings class -->
 	<string name="SettingsText">Saisissez votre identifiant de connexion</string>
 	<string name="SettingsPassword">Saisissez votre mot de passe</string>
@@ -109,47 +109,47 @@
 	<string name="SubscriptRefused">Inscription refusée</string>
 	<string name="SubscriptText">%s vient de vous ajouter à sa liste de contacts. Souhaitez-vous l\'autoriser ?</string>
 	<string name="SubscriptTitle">Autoriser ce contact ?</string>
-	
+
 	<!-- ContactList class -->
 	<string name="ConListNotConnected">Non connecté(e)</string>
 
 	<!--  BeemChatManager class -->
 	<string name="BeemChatManagerNewMessage">Vous avez reçu un nouveau message</string>
-	
+
 	<!--  BeemBroadcastReceiver class -->
 	<string name="BeemBroadcastReceiverDisconnect">Vous avez été déconnecté(e)</string>
-	
+
 	<!--  XmppConnectionAdapter class -->
 	<string name="AcceptContactRequest">%s vient de vous ajouter à sa liste d\'amis.</string>
 	<string name="AcceptContactRequestFrom">Autoriser %s à vous contacter.</string>
-	
-    <!--
+
+	<!--
     	Services
     -->
-    
-    <!--
+
+	<!--
     	Activities
     -->
-    <string name="login_tag">Beem - Activité de connexion</string>
-    <string name="edit_settings_name">Beem - Paramètres</string>
+	<string name="login_tag">Beem - Activité de connexion</string>
+	<string name="edit_settings_name">Beem - Paramètres</string>
 	<string name="edit_settings_tag">Beem - EditSettings Activity</string>
-    <string name="create_account_name">Beem - Créer un compte</string>
-    <string name="create_account_tag">Beem - CreateAccount Activity</string>
-    <string name="contact_list_name">Beem - Contacts</string>
-    <string name="contact_list_tag">Beem - ContactList Activity</string>
-    <string name="user_info_name">Beem - Informations</string>
-    
-    <!--
+	<string name="create_account_name">Beem - Créer un compte</string>
+	<string name="create_account_tag">Beem - CreateAccount Activity</string>
+	<string name="contact_list_name">Beem - Contacts</string>
+	<string name="contact_list_tag">Beem - ContactList Activity</string>
+	<string name="user_info_name">Beem - Informations</string>
+
+	<!--
     	Buttons
     -->
-    <string name="button_reset">Réinitialiser</string>
-    <string name="button_login">Se connecter</string>
-    <string name="button_save">Enregistrer</string>
-    <string name="button_create_account">Créer ce compte</string>
-    <string name="button_create_login_account">Créer puis utiliser ce compte</string>
-    
-    
-    <!--
+	<string name="button_reset">Réinitialiser</string>
+	<string name="button_login">Se connecter</string>
+	<string name="button_save">Enregistrer</string>
+	<string name="button_create_account">Créer ce compte</string>
+	<string name="button_create_login_account">Créer puis utiliser ce compte</string>
+
+
+	<!--
     	LogAs Activity
     -->
 	<string name="login_username">Nom d\'utilisateur</string>
@@ -161,21 +161,25 @@
 	<string name="login_menu_about">A propos</string>
 	<string name="login_about_title">A propos</string>
 	<string name="login_about_msg">
-		Beem est un EPITECH Innovative Project. Rencontrez nous sur http://www.beem-project.com !
+		Beem est un EPITECH Innovative Project. Rencontrez
+		nous sur http://www.beem-project.com !
 	</string>
 	<string name="login_about_button">Fermer</string>
 	<string name="login_settings_button">Paramètres</string>
 	<string name="login_login_button">Connexion</string>
-	<string name="login_login_progress">Connexion en cours. Veuillez patienter...</string>	
-	<string name="login_error_msg">Malheureusement, une erreur est survenu.\n\nDétail de l\'erreur :\n%s</string>
-	
+	<string name="login_login_progress">Connexion en cours. Veuillez patienter...</string>
+	<string name="login_error_msg">Malheureusement, une erreur est survenu.\n\nDétail
+		de l\'erreur :\n%s</string>
+
 	<!--
 		EditSettings Activity
 	-->
 	<string name="settings_menu_create_account">Créer un compte</string>
 	<string name="settings_menu_login">Se connecter</string>
-	<string name="settings_saved_ok">Les paramètres ont été enregistrés avec succès.</string>
-	
+	<string name="settings_menu_privacy_lists">Gérer mes listes privées</string>
+	<string name="settings_saved_ok">Les paramètres ont été enregistrés avec succès.
+	</string>
+
 	<string name="settings_key_account_username">beem_account_username</string>
 	<string name="settings_key_account_password">beem_account_password</string>
 	<string name="settings_key_xmpp_server">beem_xmpp_server</string>
@@ -188,7 +192,7 @@
 	<string name="settings_key_proxy_password">beem_xmpp_proxy_password</string>
 	<string name="settings_key_proxy_type">beem_xmpp_proxy_type</string>
 	<string name="settings_key_hidden_contact">settings_key_hidden_contact</string>
-	
+
 	<!-- EditSettings Activity Categories -->
 	<string name="general_preferences">Préférences de l\'application</string>
 	<string name="user_preferences">Utilisateur</string>
@@ -203,10 +207,11 @@
 	<string name="settings_tab_label_xmpp">XMPP</string>
 	<string name="settings_tab_tag_proxy">edit_settings_tab_proxy</string>
 	<string name="settings_tab_label_proxy">Proxy</string>
-	
+
 	<!-- EditSettings Activity General Preferences Tabs -->
 	<string name="contact_list_preferences">Liste d\'ami(e)s</string>
-	<string name="contact_list_preferences_sum">Une série d\'options d\'affichage de votre liste d\'ami(e)s</string>
+	<string name="contact_list_preferences_sum">Une série d\'options d\'affichage de votre liste
+		d\'ami(e)s</string>
 	<string name="CLP_hidden_contact">Caché(e)s</string>
 	<string name="CLP_hidden_contact_sum">Cochez cette option pour cacher les ami(e)s déconnecté(e)s</string>
 	
@@ -215,7 +220,7 @@
 	<string name="settings_account_password">Mot de passe</string>
 	<string name="settings_account_server">Serveur</string>
 	<string name="settings_account_port">Port</string>
-	
+
 	<!-- EditSettings Activity Advanced Options tab -->
 	<string name="settings_advanced_service_behaviour">Comportement du service</string>
 	<string name="settings_advanced_sum">Une série d\'options pour les utilisateurs avertis</string>
@@ -224,7 +229,7 @@
 	<string name="settings_xmpp_use_tls">Utiliser SSL/TLS</string>
 	<string name="settings_reco_delay">Délai de reconnexion</string>
 
-	
+
 	<!-- EditSettings Activity Proxy tab -->
 	<string name="settings_proxy_sum">Paramètrez un serveur proxy</string>
 	<string name="settings_proxy_use">Utiliser un proxy</string>
@@ -233,7 +238,7 @@
 	<string name="settings_proxy_port">Port</string>
 	<string name="settings_proxy_username">Nom d\'utilisateur</string>
 	<string name="settings_proxy_password">Mot de passe</string>
-	
+
 	<!--
 		Create an account Activity
 	-->
@@ -247,14 +252,14 @@
 	<string name="create_account_username">Nom d\'utilisateur</string>
 	<string name="create_account_password">Mot de passe</string>
 	<string name="create_account_confirm_password">Confirmation du mot de passe</string>
-	
+
 	<!--
 		ContactList Activity 
 	 -->
-	 <string name="contact_list_menu_add_contact">Ajouter un contact</string>
-	 <string name="contact_list_menu_settings">Paramètres</string>
-	 <string name="contact_list_all_contact">Tous les contacts</string>
-	 <string name="contact_list_no_group">Aucun groupe</string>
+	<string name="contact_list_menu_add_contact">Ajouter un contact</string>
+	<string name="contact_list_menu_settings">Paramètres</string>
+	<string name="contact_list_all_contact">Tous les contacts</string>
+	<string name="contact_list_no_group">Aucun groupe</string>
 
 
 	<!-- 
@@ -274,16 +279,26 @@
 	<string name="chat_input_default_value">Saisissez votre message</string>
 	<string name="chat_name">Beem - Chat</string>
 	<string name="chat_self">Moi</string>
+	<string name="chat_send_message">Envoyer</string>
+	<string name="chat_menu_contacts_list">Liste de contacts</string>
+	<string name="chat_menu_change_chat">Changer de conversation</string>
+	<string name="chat_dialog_change_chat_title">Conversations en cours</string>
+	<string name="chat_menu_close_chat">Fermer cette conversation</string>
+	<string name="chat_no_more_chats">Aucune conversation en cours</string>
+
 	<string name="contact_status_msg_available">Disponible</string>
 	<string name="contact_status_msg_available_chat">Disponible pour clavarder</string>
 	<string name="contact_status_msg_dnd">Occupé(e)</string>
 	<string name="contact_status_msg_away">Parti(e)</string>
 	<string name="contact_status_msg_xa">Indisponible</string>
 	<string name="contact_status_msg_offline">Hors ligne</string>
-<string name="UpdateButton">Mettre à jour</string>
-<string name="chat_menu_contacts_list">Liste de contacts</string>
-<string name="chat_menu_change_chat">Changer de conversation</string>
-<string name="chat_dialog_change_chat_title">Conversations en cours</string>
-<string name="chat_menu_close_chat">Fermer cette conversation</string>
-<string name="chat_no_more_chats">Aucune conversation en cours</string>
+
+	<string name="privacy_list_name">Beem - Gérer mes listes privées</string>
+	<string name="privacy_list_no_data">Il n\'existe aucune liste privée enregistrée.</string>
+	<string name="privacy_list_menu_create">Créer une liste privée</string>
+	<string name="privacy_list_create_dialog_title">Créer une liste privée</string>
+	<string name="privacy_list_create_dialog_list_name_label">Titre</string>
+	<string name="privacy_list_create_dialog_create_button">Créer</string>
+
+	<string name="UpdateButton">Mettre à jour</string>
 </resources>
--- a/res/values/strings.xml	Mon Nov 16 22:39:11 2009 +0100
+++ b/res/values/strings.xml	Tue Nov 17 00:27:43 2009 +0100
@@ -65,9 +65,9 @@
 	<string name="SendIMSmiley">Insert a smiley</string>
 	<string name="SendIMLoginHint">login</string>
 	<string name="SendIMNoStatusSet">No status set</string>
-	
+
 	<!--  ChangeStatus class -->
-	<string name="ChangeStatusType">My status</string>	
+	<string name="ChangeStatusType">My status</string>
 	<string name="ChangeStatusMessage">My personal message</string>
 
 	<string name="ChangeStatusActTitle">Beem - Change my status</string>
@@ -77,7 +77,7 @@
 	<string name="MenuConnection">Edit account</string>
 	<string name="ChangeStatusOk">Updating status</string>
 	<string name="ChangeStatusNoChange">Nothing to change</string>
-	
+
 	<!-- Settings class -->
 	<string name="SettingsText">Edit your username</string>
 	<string name="SettingsPassword">Edit your password</string>
@@ -109,38 +109,38 @@
 	<string name="SubscriptRefused">Subscription refused</string>
 	<string name="SubscriptText">%s wants to add you to his/her buddy list. Do you want to authorize him/her ?</string>
 	<string name="SubscriptTitle">Authorize buddy ?</string>
-	
+
 	<!-- ContactList class -->
 	<string name="ConListNotConnected">Not connected</string>
 
 	<!--  BeemChatManager -->
 	<string name="BeemChatManagerNewMessage">You\'ve a new message</string>
-	
+
 	<!--  BeemBroadcastReceiver class -->
 	<string name="BeemBroadcastReceiverDisconnect">You have been disconnected</string>
-	
+
 	<!--  XmppConnectionAdapter class -->
 	<string name="AcceptContactRequest">%s has just added you to his/her buddy list.</string>
 	<string name="AcceptContactRequestFrom">Authorize %s to contact you.</string>
-    
-    <!-- Activities -->
-    <string name="login_tag">Beem - Login Activity</string>
-    <string name="edit_settings_name">Beem - Settings</string>
-	<string name="edit_settings_tag">Beem - EditSettings Activity</string>	
-    <string name="create_account_name">Beem - Create an account</string>
-    <string name="create_account_tag">Beem - CreateAccount Activity</string>
-    <string name="contact_list_name">Beem - Contacts</string>
-    <string name="contact_list_tag">Beem - ContactList Activity</string>
-    <string name="user_info_name">Beem - User Info</string>
 
-    <!-- Buttons -->
-    <string name="button_reset">Reset</string>
-    <string name="button_login">Login</string>
-    <string name="button_save">Save</string>
-    <string name="button_create_account">Create this account</string>
-    <string name="button_create_login_account">Create and use this account</string>
+	<!-- Activities -->
+	<string name="login_tag">Beem - Login Activity</string>
+	<string name="edit_settings_name">Beem - Settings</string>
+	<string name="edit_settings_tag">Beem - EditSettings Activity</string>
+	<string name="create_account_name">Beem - Create an account</string>
+	<string name="create_account_tag">Beem - CreateAccount Activity</string>
+	<string name="contact_list_name">Beem - Contacts</string>
+	<string name="contact_list_tag">Beem - ContactList Activity</string>
+	<string name="user_info_name">Beem - User Info</string>
 
-    <!-- LogAs Activity -->
+	<!-- Buttons -->
+	<string name="button_reset">Reset</string>
+	<string name="button_login">Login</string>
+	<string name="button_save">Save</string>
+	<string name="button_create_account">Create this account</string>
+	<string name="button_create_login_account">Create and use this account</string>
+
+	<!-- LogAs Activity -->
 	<string name="login_username">Username</string>
 	<string name="login_password">Password</string>
 	<string name="login_error_dialog_title">Login - Error</string>
@@ -150,18 +150,21 @@
 	<string name="login_menu_about">About</string>
 	<string name="login_about_title">About</string>
 	<string name="login_about_msg">
-		Beem is an EPITECH Innovative Project. Visit us at http://www.beem-project.com !
+		Beem is an EPITECH Innovative Project. Visit us at
+		http://www.beem-project.com !
 	</string>
 	<string name="login_about_button">Close</string>
 	<string name="login_settings_button">Settings</string>
 	<string name="login_login_button">Log in</string>
 	<string name="login_login_progress">Connecting. Please wait...</string>
 	<string name="login_max_retry">Max retry</string>
-	<string name="login_error_msg">Unfortunately, an error occured.\n\nError detail:\n%s</string>
+	<string name="login_error_msg">Unfortunately, an error occured.\n\nError
+		detail:\n%s</string>
 
 	<!-- EditSettings Activity -->
 	<string name="settings_menu_create_account">Create an account</string>
 	<string name="settings_menu_login">Login</string>
+	<string name="settings_menu_privacy_lists">Manage my privacy lists</string>
 	<string name="settings_saved_ok">The settings have been saved successfully.</string>
 
 	<string name="settings_key_account_username">beem_account_username</string>
@@ -176,7 +179,7 @@
 	<string name="settings_key_proxy_password">beem_xmpp_proxy_password</string>
 	<string name="settings_key_proxy_type">beem_xmpp_proxy_type</string>
 	<string name="settings_key_hidden_contact">settings_key_hidden_contact</string>
-	
+
 	<!-- EditSettings Activity Categories -->
 	<string name="general_preferences">General preferences</string>
 	<string name="user_preferences">User settings</string>
@@ -194,9 +197,11 @@
 
 	<!-- EditSettings Activity General Preferences Tabs -->
 	<string name="contact_list_preferences">Buddy list</string>
-	<string name="contact_list_preferences_sum">A set of display options for your buddy list</string>
+	<string name="contact_list_preferences_sum">A set of display options for your buddy list
+	</string>
 	<string name="CLP_hidden_contact">Hidden</string>
-	<string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies</string>
+	<string name="CLP_hidden_contact_sum">Check this option to hide unconnected buddies
+	</string>
 
 	<!-- EditSettings Activity Account tab -->
 	<string name="settings_account_username">Username</string>
@@ -220,7 +225,7 @@
 	<string name="settings_proxy_port">Port</string>
 	<string name="settings_proxy_username">Username</string>
 	<string name="settings_proxy_password">Password</string>
-	
+
 	<!-- Create an account Activity -->
 	<string name="create_account_instr_dialog_title">Create an account - Instructions</string>
 	<string name="create_account_err_dialog_title">Create an account - Error</string>
@@ -232,13 +237,13 @@
 	<string name="create_account_username">Username</string>
 	<string name="create_account_password">Password</string>
 	<string name="create_account_confirm_password">Confirm password</string>
-	
+
 	<!-- ContactList Activity  -->
 	<string name="contact_list_menu_add_contact">Add a contact</string>
 	<string name="contact_list_menu_settings">Settings</string>
 	<string name="contact_list_all_contact">All contacts</string>
 	<string name="contact_list_no_group">No group</string>
-	 
+
 	<!-- UserInfo Activity -->
 	<string name="userinfo_label_alias">Alias</string>
 	<string name="userinfo_label_chg_group">Manage groups</string>
@@ -246,7 +251,8 @@
 	<string name="userinfo_label_block">Block</string>
 	<string name="userinfo_label_delete">Delete</string>
 	<string name="userinfo_resend">Suscription resend</string>
-	<string name="userinfo_sure2delete">Are you sure you want to delete this contact ?</string>
+	<string name="userinfo_sure2delete">Are you sure you want to delete this contact ?
+	</string>
 	<string name="userinfo_yes">Yes</string>
 	<string name="userinfo_no">No</string>
 	<string name="userinfo_sureresend">Are you sure you want to resend invit ?</string>
@@ -254,6 +260,13 @@
 	<string name="chat_name">Beem - Chat</string>
 	<string name="chat_input_default_value">Type your message</string>
 	<string name="chat_self">Me</string>
+	<string name="chat_send_message">Send</string>
+	<string name="chat_menu_contacts_list">Contacts list</string>
+	<string name="chat_menu_change_chat">Switch chat</string>
+	<string name="chat_dialog_change_chat_title">Opened chats</string>
+	<string name="chat_menu_close_chat">Close this chat</string>
+	<string name="chat_no_more_chats">No more active chats</string>
+
 	<string name="contact_status_msg_available">Available</string>
 	<string name="contact_status_msg_available_chat">Available to chat</string>
 	<string name="contact_status_msg_dnd">Do not disturb</string>
@@ -261,11 +274,12 @@
 	<string name="contact_status_msg_xa">Unavailable</string>
 	<string name="contact_status_msg_offline">Disconnected</string>
 
-<string name="UpdateButton">Update</string>
+	<string name="privacy_list_name">Beem - Manage my privacy lists</string>
+	<string name="privacy_list_no_data">There aren\'t any privacy list registered.</string>
+	<string name="privacy_list_menu_create">Create a privacy list</string>
+	<string name="privacy_list_create_dialog_title">Create a privacy list</string>
+	<string name="privacy_list_create_dialog_list_name_label">Title</string>
+	<string name="privacy_list_create_dialog_create_button">Create</string>
 
-<string name="chat_menu_contacts_list">Contacts list</string>
-<string name="chat_menu_change_chat">Switch chat</string>
-<string name="chat_dialog_change_chat_title">Opened chats</string>
-<string name="chat_menu_close_chat">Close this chat</string>
-<string name="chat_no_more_chats">No more active chats</string>
+	<string name="UpdateButton">Update</string>
 </resources>
--- a/src/com/beem/project/beem/BeemService.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Tue Nov 17 00:27:43 2009 +0100
@@ -36,6 +36,8 @@
      * The id to use for status notification.
      */
     public static final int NOTIFICATION_STATUS_ID = 100;
+
+    private static final String TAG = "BeemService";
     private static final int DEFAULT_XMPP_PORT = 5222;
 
     private NotificationManager mNotificationManager;
@@ -95,15 +97,15 @@
      */
     @Override
     public IBinder onBind(Intent intent) {
-	Log.d("BEEMSERVICE", "ONBIND()");
+	Log.d(TAG, "ONBIND()");
 	return mBind;
     }
 
     @Override
     public boolean onUnbind(Intent intent) {
-	Log.d("BEEMSERVICE", "ONUNBIND()");
+	Log.d(TAG, "ONUNBIND()");
 	if (!mConnection.getAdaptee().isConnected()) {
-	    Log.d("BEEMSERVICE", "DESTROYED");
+	    Log.d(TAG, "DESTROYED");
 	    this.stopSelf();
 	}
 	return true;
@@ -140,7 +142,7 @@
 	Roster.setDefaultSubscriptionMode(SubscriptionMode.manual);
 	mJingle = new JingleService(mConnection.getAdaptee());
 	mBind = new XmppFacade(mConnection, this, mJingle);
-	Log.d("BEEEMSERVICE", "ONCREATE");
+	Log.d(TAG, "ONCREATE");
     }
 
     /**
@@ -152,7 +154,7 @@
 	mNotificationManager.cancel(NOTIFICATION_STATUS_ID);
 	if (mConnection.isAuthentificated())
 	    mConnection.disconnect();
-	Log.d("BEEEMSERVICE", "ONDESTROY");
+	Log.d(TAG, "ONDESTROY");
     }
 
     /**
@@ -161,7 +163,7 @@
     @Override
     public void onStart(Intent intent, int startId) {
 	super.onStart(intent, startId);
-	Log.d("BEEMSERVICE", "onStart");
+	Log.d(TAG, "onStart");
 	try {
 	    mConnection.connectAsync();
 	} catch (RemoteException e) {
@@ -196,13 +198,17 @@
     }
 
     /**
-     * init jingle from XmppConnectionAdapter.
-     * @param adaptee XmppConntection used for jingle.
+     * Initialize Jingle from an XmppConnectionAdapter.
+     * @param adaptee XmppConnection used for jingle.
      */
     public void initJingle(XMPPConnection adaptee) {
 	mJingle.initWhenConntected(adaptee);
     }
 
+    /**
+     * Return a bind to an XmppFacade instance.
+     * @return IXmppFacade a bind to an XmppFacade instance
+     */
     public IXmppFacade getBind() {
 	return mBind;
     }
--- a/src/com/beem/project/beem/service/BeemChatManager.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/BeemChatManager.java	Tue Nov 17 00:27:43 2009 +0100
@@ -71,8 +71,8 @@
 
 	/**
 	 * Create the PendingIntent to launch our activity if the user select this chat notification.
-	 * @param chat
-	 * @return
+	 * @param chat A ChatAdapter instance
+	 * @return A Chat activity PendingIntent
 	 */
 	private PendingIntent makeChatIntent(IChat chat) {
 	    Intent chatIntent = new Intent(mService, com.beem.project.beem.ui.Chat.class);
@@ -84,7 +84,7 @@
 	    }
 	    PendingIntent contentIntent = PendingIntent.getActivity(mService, 0, chatIntent,
 		PendingIntent.FLAG_UPDATE_CURRENT);
-	    return (contentIntent);
+	    return contentIntent;
 	}
 
 	/**
@@ -93,7 +93,8 @@
 	 */
 	private void notifyNewChat(IChat chat) {
 	    try {
-		CharSequence tickerText = mService.getBind().getRoster().getContact(chat.getParticipant().getJID()).getName();
+		CharSequence tickerText = mService.getBind().getRoster().getContact(chat.getParticipant().getJID())
+		    .getName();
 		Notification notification = new Notification(android.R.drawable.stat_notify_chat, tickerText, System
 		    .currentTimeMillis());
 		notification.defaults = Notification.DEFAULT_ALL;
@@ -243,15 +244,20 @@
 	return res;
     }
 
+    /**
+     * This methods permits to retrieve the list of contacts who have an opened chat session with us.
+     * @return An List containing Contact instances.
+     * @throws RemoteException If a Binder remote-invocation error occurred.
+     */
     public List<Contact> getOpenedChatList() throws RemoteException {
 	List<Contact> openedChats = new ArrayList<Contact>();
 	IRoster mRoster = mService.getBind().getRoster();
-	
+
 	for (ChatAdapter chat : mChats.values()) {
 	    if (chat.getMessages().size() > 0) //TODO check plutot le nombre de messages dans l'historique
 		openedChats.add(mRoster.getContact(chat.getParticipant().getJID()));
 	}
-	return (openedChats);
+	return openedChats;
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/PrivacyListItem.aidl	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,3 @@
+package com.beem.project.beem.service;
+
+parcelable PrivacyListItem;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/PrivacyListItem.java	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,110 @@
+package com.beem.project.beem.service;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * A simplified version of the Smack PrivacyItem class.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
+public class PrivacyListItem implements Parcelable {
+
+    /**
+     * Constructor. Needed to implements the Parcelable.Creator interface. Generates instances of PrivacyListItem from a
+     * Parcel.
+     */
+    public static final Parcelable.Creator<PrivacyListItem> CREATOR = new Parcelable.Creator<PrivacyListItem>() {
+	public PrivacyListItem createFromParcel(Parcel in) {
+	    return new PrivacyListItem(in);
+	}
+
+	public PrivacyListItem[] newArray(int size) {
+	    return new PrivacyListItem[size];
+	}
+    };
+
+    private int mType;
+    private String mValue;
+
+    /**
+     * Constructor.
+     */
+    public PrivacyListItem() {
+    }
+
+    /**
+     * Constructor. Generates instances of PrivacyListItem from a Parcel.
+     * @param in The Parcel used to initialize object's attributes.
+     */
+    public PrivacyListItem(final Parcel in) {
+	readFromParcel(in);
+    }
+
+    /**
+     * Constructor.
+     * @param type The type of the item.
+     * @param value The value of the item.
+     */
+    public PrivacyListItem(final int type, final String value) {
+	mType = type;
+	mValue = value;
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    public int describeContents() {
+	return 0;
+    }
+
+    /**
+     * Initialize object's attributes from a Parcel.
+     * @param in The Parcel used to initialize object's attributes.
+     */
+    public void readFromParcel(Parcel in) {
+	mType = in.readInt();
+	mValue = in.readString();
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+	dest.writeInt(mType);
+	dest.writeString(mValue);
+    }
+
+    /**
+     * PrivacyListItem type accessor.
+     * @return The type of the PrivacyListItem.
+     */
+    public int getType() {
+	return mType;
+    }
+
+    /**
+     * PrivacyListItem value accessor.
+     * @return The value of the PrivacyListItem.
+     */
+    public String getValue() {
+	return mValue;
+    }
+
+    /**
+     * PrivacyListItem type mutator.
+     * @param type The type of the PrivacyListItem.
+     */
+    public void setType(final int type) {
+	mType = type;
+    }
+
+    /**
+     * PrivacyListItem value mutator.
+     * @param value The value of the PrivacyListItem.
+     */
+    public void setValue(final String value) {
+	mValue = value;
+    }
+}
--- a/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/PrivacyListManagerAdapter.java	Tue Nov 17 00:27:43 2009 +0100
@@ -9,159 +9,250 @@
 import org.jivesoftware.smack.XMPPConnection;
 import org.jivesoftware.smack.XMPPException;
 import org.jivesoftware.smack.packet.PrivacyItem;
-import org.jivesoftware.smack.packet.PrivacyItem.PrivacyRule;
 
+import android.os.RemoteCallbackList;
 import android.os.RemoteException;
 import android.util.Log;
 
+import com.beem.project.beem.service.aidl.IPrivacyListListener;
 import com.beem.project.beem.service.aidl.IPrivacyListManager;
 
 /**
- * Privacy list manager in beem.
- * @author nikita
+ * An adapter for the Smack's PrivacyListManager.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
  */
 public class PrivacyListManagerAdapter extends IPrivacyListManager.Stub {
 
     /**
-     * Tag.
+     * Class's Tag.
      */
     public static final String TAG = "PrivacyListManagerAdapter";
-    /**
-     * default privacy list name.
-     */
-    public static final String DEFAULT_PRIVACYLIST = "BEEM_DEFAULT_PRIVACY_LIST";
-
-    private PrivacyListManager mAdaptee;
-    private List<String> mBlockedUsers = new ArrayList<String>();
-    private XMPPConnection mConnection;
-    private MyPrivacyListListener mPrivacyPacketListener = new MyPrivacyListListener();
 
-    /**
-     * Privacy list constructor.
-     * @param connection xmppconnection used.
-     */
-    public PrivacyListManagerAdapter(final XMPPConnection connection) {
-	mConnection = connection;
-	mAdaptee = PrivacyListManager.getInstanceFor(mConnection);
-	mAdaptee.addListener(mPrivacyPacketListener);
-    }
+    private final XMPPConnection mXmppConnection;
+    private final PrivacyListManager mPrivacyListManager;
+
+    private final RemoteCallbackList<IPrivacyListListener> mPrivacyListListeners = new RemoteCallbackList<IPrivacyListListener>();
+    private final PrivacyListListenerAdapter mPrivacyListListener = new PrivacyListListenerAdapter();
 
     /**
-     * Return the blocked user list.
-     * @return blocked user list
-     * @throws RemoteException
+     * Constructor.
+     * @param connection The XMPP connection that will be used by the PrivacyListManagerAdapter.
      */
-    public List<String> getBlockedUsers() {
-	return mBlockedUsers;
+    public PrivacyListManagerAdapter(final XMPPConnection connection) {
+	mXmppConnection = connection;
+	mPrivacyListManager = PrivacyListManager.getInstanceFor(mXmppConnection);
+	mPrivacyListManager.addListener(mPrivacyListListener);
+    }
+
+    @Override
+    public void blockUser(String listName, String jid) throws RemoteException {
+    }
+
+    @Override
+    public void createPrivacyList(String listName, List<PrivacyListItem> items) throws RemoteException {
+	try {
+	    mPrivacyListManager.createPrivacyList(listName, tranformPrivacyListItemsToPrivacyItems(items));
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+    }
+
+    @Override
+    public void declineActivePrivacyList() throws RemoteException {
+	try {
+	    mPrivacyListManager.declineActiveList();
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
     }
 
-    /**
-     * Add a user to the blocked user list.
-     * @param jid blocked user jid TODO: Ne bloque pas uniquement un utilisateur, fonction a dcouper/revoir
-     */
-    public synchronized void addBlockedUser(final String jid) {
-	Log.d(TAG, "BEGIN addBlockedUser.");
-	if (mAdaptee == null) {
-	    mAdaptee = PrivacyListManager.getInstanceFor(mConnection);
-	    mAdaptee.addListener(mPrivacyPacketListener);
+    @Override
+    public void declineDefaultPrivacyList() throws RemoteException {
+	try {
+	    mPrivacyListManager.declineDefaultList();
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+    }
+
+    @Override
+    public void editPrivacyList(String listName, List<PrivacyListItem> items) throws RemoteException {
+	try {
+	    mPrivacyListManager.updatePrivacyList(listName, tranformPrivacyListItemsToPrivacyItems(items));
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
 	}
-	List<PrivacyItem> pItemList = new ArrayList<PrivacyItem>();
-	PrivacyItem pItem = new PrivacyItem(PrivacyItem.Type.jid.name(), true, 1);
-	pItem.setFilterMessage(true);
-	pItem.setValue(jid);
-	pItemList.add(pItem);
+    }
 
-	pItem = new PrivacyItem(PrivacyItem.Type.subscription.name(), true, 2);
-	pItem.setValue(PrivacyRule.SUBSCRIPTION_BOTH);
-	pItemList.add(pItem);
+    @Override
+    public String getActivePrivacyList() throws RemoteException {
+	try {
+	    PrivacyList activePrivacyList = mPrivacyListManager.getActiveList();
+	    return activePrivacyList.toString();
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+	return null;
+    }
 
+    @Override
+    public List<String> getBlockedGroupsByList(String listName) throws RemoteException {
+	List<String> blockedGroups = new ArrayList<String>();
 	try {
-	    if (mAdaptee.getPrivacyList(DEFAULT_PRIVACYLIST) == null) {
-		mAdaptee.createPrivacyList(DEFAULT_PRIVACYLIST, pItemList);
+	    PrivacyList pL = mPrivacyListManager.getPrivacyList(listName);
+	    for (PrivacyItem pI : pL.getItems()) {
+		if (pI.getType().equals(PrivacyItem.Type.group) && !pI.isAllow())
+		    blockedGroups.add(pI.getValue());
 	    }
 	} catch (XMPPException e) {
 	    Log.e(TAG, e.getMessage());
-	} catch (ClassCastException e) {
-	    Log.e(TAG, e.getMessage());
-	    try {
-		mAdaptee.createPrivacyList(DEFAULT_PRIVACYLIST, pItemList);
-	    } catch (XMPPException e1) {
-		Log.e(TAG, e1.getMessage());
-	    }
 	}
-	try {
-	    mAdaptee.setActiveListName(DEFAULT_PRIVACYLIST);
-	    mAdaptee.setDefaultListName(DEFAULT_PRIVACYLIST);
-	} catch (XMPPException e) {
-	    Log.e(TAG, e.getMessage());
-	}
-	Log.d(TAG, "END addBlockedUser.");
+	return blockedGroups;
     }
 
-    /**
-     * Return a list of users blocked for a specified list.
-     */
     @Override
     public List<String> getBlockedUsersByList(String listName) throws RemoteException {
-	List<String> blockedUsersList = new ArrayList<String>();
+	List<String> blockedUsers = new ArrayList<String>();
 	try {
-	    PrivacyList pList = mAdaptee.getPrivacyList(listName);
-	    for (PrivacyItem p : pList.getItems()) {
-		if (p.getType().equals(PrivacyItem.Type.jid) && !p.isAllow()) {
-		    blockedUsersList.add(p.getValue());
-		}
+	    PrivacyList pL = mPrivacyListManager.getPrivacyList(listName);
+	    for (PrivacyItem pI : pL.getItems()) {
+		if (pI.getType().equals(PrivacyItem.Type.jid) && !pI.isAllow())
+		    blockedUsers.add(pI.getValue());
 	    }
 	} catch (XMPPException e) {
 	    Log.e(TAG, e.getMessage());
 	}
-	return blockedUsersList;
+	return blockedUsers;
+    }
+
+    @Override
+    public String getDefaultPrivacyList() throws RemoteException {
+	try {
+	    PrivacyList defaultPrivacyList = mPrivacyListManager.getDefaultList();
+	    return defaultPrivacyList.toString();
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+	return null;
     }
 
-    /**
-     * Return the user's PrivacyListManager.
-     * @return the current PrivacyListManager instance
-     */
-    public PrivacyListManager getManager() {
-	return mAdaptee;
+    @Override
+    public void removePrivacyList(String listName) throws RemoteException {
+	try {
+	    mPrivacyListManager.deletePrivacyList(listName);
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+    }
+
+    @Override
+    public void setActivePrivacyList(String listName) throws RemoteException {
+	try {
+	    mPrivacyListManager.setActiveListName(listName);
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+    }
+
+    @Override
+    public void setDefaultPrivacyList(String listName) throws RemoteException {
+	try {
+	    mPrivacyListManager.setDefaultListName(listName);
+	} catch (XMPPException e) {
+	    e.getMessage();
+	}
     }
 
     /**
-     * A class which allows listening on a PrivacyList
-     * 
-     * TODO: Besoin d'en discuter. Va t-on grer plusieurs listes ? Une seule ?
+     * From a List of PrivacyListItem get a List of PrivacyItem.
+     * @param items The List of PrivacyListItem.
+     * @return A list of PrivacyItem.
      */
-    class MyPrivacyListListener implements PrivacyListListener {
-	/**
-	 * constructor.
-	 */
-	public MyPrivacyListListener() {
+    private List<PrivacyItem> tranformPrivacyListItemsToPrivacyItems(List<PrivacyListItem> items) {
+	List<PrivacyItem> rItems = new ArrayList<PrivacyItem>();
+	PrivacyItem.Type[] itemTypes = PrivacyItem.Type.values();
+
+	for (int i = 0; i < items.size(); i++) {
+	    rItems.add(new PrivacyItem(itemTypes[items.get(i).getType()].name(), false, i));
 	}
 
+	return rItems;
+    }
+
+    /**
+     * From a List of PrivacyItem get a List of PrivacyListItem.
+     * @param items The List of PrivacyItem.
+     * @return A list of PrivacyListItem.
+     */
+    private List<PrivacyListItem> tranformPrivacyItemsToPrivacyListItems(List<PrivacyItem> items) {
+	List<PrivacyListItem> rItems = new ArrayList<PrivacyListItem>();
+	PrivacyItem.Type[] itemTypes = PrivacyItem.Type.values();
+
+	for (int i = 0; i < items.size(); i++) {
+	    rItems.add(new PrivacyListItem(items.get(i).getType().ordinal(), items.get(i).getValue()));
+	}
+	return rItems;
+    }
+
+    /**
+     * An adapter for the Smack's PrivacyListListener.
+     * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+     */
+    private class PrivacyListListenerAdapter implements PrivacyListListener {
+
 	@Override
 	public void setPrivacyList(String listName, List<PrivacyItem> listItem) {
-	    Log.d(TAG, "BEGIN setPrivacyList.");
-	    try {
-		if (mAdaptee.getPrivacyList(listName) == null)
-		    mAdaptee.createPrivacyList(listName, listItem);
-		else
-		    mAdaptee.updatePrivacyList(listName, listItem);
-	    } catch (XMPPException e) {
-		Log.e(TAG, e.getMessage());
+	    final int n = mPrivacyListListeners.beginBroadcast();
+	    for (int i = 0; i < n; i++) {
+		IPrivacyListListener listener = mPrivacyListListeners.getBroadcastItem(i);
+		try {
+		    listener.setPrivacyList(listName, tranformPrivacyItemsToPrivacyListItems(listItem));
+		} catch (RemoteException e) {
+		    Log.w(TAG, e.getMessage());
+		}
 	    }
-	    Log.d(TAG, "END setPrivacyList.");
+	    mPrivacyListListeners.finishBroadcast();
 	}
 
 	@Override
 	public void updatedPrivacyList(String listName) {
-	    Log.d(TAG, "BEGIN updatedPrivacyList.");
-	    if (listName.equals(DEFAULT_PRIVACYLIST)) {
+	    final int n = mPrivacyListListeners.beginBroadcast();
+	    for (int i = 0; i < n; i++) {
+		IPrivacyListListener listener = mPrivacyListListeners.getBroadcastItem(i);
 		try {
-		    mBlockedUsers = getBlockedUsersByList(DEFAULT_PRIVACYLIST);
+		    listener.updatedPrivacyList(listName);
 		} catch (RemoteException e) {
-		    Log.e(TAG, e.getMessage());
+		    Log.w(TAG, e.getMessage());
 		}
 	    }
-	    Log.d(TAG, "END updatedPrivacyList.");
+	    mPrivacyListListeners.finishBroadcast();
 	}
     }
+
+    @Override
+    public void addPrivacyListListener(IPrivacyListListener listener) throws RemoteException {
+	if (listener != null)
+	    mPrivacyListListeners.register(listener);
+    }
+
+    @Override
+    public void removePrivacyListListener(IPrivacyListListener listener) throws RemoteException {
+	if (listener != null)
+	    mPrivacyListListeners.unregister(listener);
+    }
+
+    @Override
+    public List<String> getPrivacyLists() throws RemoteException {
+	List<String> res = new ArrayList<String>();
+	try {
+	    PrivacyList[] serverPrivacyLists = mPrivacyListManager.getPrivacyLists();
+	    if (serverPrivacyLists.length > 0) {
+		for (int i = 0; i < serverPrivacyLists.length; i++)
+		    res.add(serverPrivacyLists[i].toString());
+	    }
+	} catch (XMPPException e) {
+	    Log.e(TAG, e.getMessage());
+	}
+	return res;
+    }
 }
--- a/src/com/beem/project/beem/service/RosterAdapter.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/RosterAdapter.java	Tue Nov 17 00:27:43 2009 +0100
@@ -24,19 +24,19 @@
 
 /**
  * This class implement a Roster adapter for BEEM.
- * @author darisk
  */
 public class RosterAdapter extends com.beem.project.beem.service.aidl.IRoster.Stub {
 
     private static final String TAG = "RosterAdapter";
-    private Roster mAdaptee;
-    private RemoteCallbackList<IBeemRosterListener> mRemoteRosListeners = new RemoteCallbackList<IBeemRosterListener>();
-    private Map<Integer, String> mDefaultStatusMessages;
-    private RosterListenerAdapter mRosterListener = new RosterListenerAdapter();
+    private final Roster mAdaptee;
+    private final RemoteCallbackList<IBeemRosterListener> mRemoteRosListeners = new RemoteCallbackList<IBeemRosterListener>();
+    private final Map<Integer, String> mDefaultStatusMessages;
+    private final RosterListenerAdapter mRosterListener = new RosterListenerAdapter();
 
     /**
      * Constructor.
-     * @param roster the roster to adapt
+     * @param roster The roster to adapt.
+     * @param context The context of the RosterAdapter.
      */
     public RosterAdapter(final Roster roster, Context context) {
 	mAdaptee = roster;
@@ -123,9 +123,18 @@
      */
     @Override
     public List<Contact> getContactList() throws RemoteException {
+	boolean add = true;
 	List<Contact> coList = new ArrayList<Contact>(mAdaptee.getEntries().size());
 	for (RosterEntry entry : mAdaptee.getEntries()) {
-	    coList.add(getContactFromRosterEntry(entry));
+	    for (Contact c : coList) {
+		if (c.getJID().equals(entry.getUser())) {
+		    add = false;
+		    break;
+		}
+	    }
+	    // Because getEntries return duplicated user.
+	    if (add == true)
+		coList.add(getContactFromRosterEntry(entry));
 	}
 	return coList;
     }
@@ -196,7 +205,7 @@
 	Contact c = new Contact(user);
 	Presence p = mAdaptee.getPresence(user);
 
-	if (p.getStatus() == null || p.getStatus().equals(""))
+	if (p.getStatus() == null || "".equals(p.getStatus()))
 	    p.setStatus(mDefaultStatusMessages.get(Status.getStatusFromPresence(p)));
 	c.setStatus(p);
 	try {
@@ -210,7 +219,8 @@
 
     /**
      * Create a map which contains default status messages.
-     * @return
+     * @param context The context of the roster adapter.
+     * @return A Map<Integer, String> which assigns a status to a message.
      */
     private Map<Integer, String> createDefaultStatusMessagesMap(Context context) {
 	Map<Integer, String> defaultStatusMessages = new HashMap<Integer, String>();
@@ -338,7 +348,7 @@
 		IBeemRosterListener listener = mRemoteRosListeners.getBroadcastItem(i);
 		try {
 		    Log.d(TAG, ">>> Presence changed.");
-		    if (presence.getStatus() == null || presence.getStatus().equals("")) {
+		    if (presence.getStatus() == null || "".equals(presence.getStatus())) {
 			presence.setStatus(mDefaultStatusMessages.get(Status.getStatusFromPresence(presence)));
 			Log.d(TAG, ">>> Default status added.");
 		    }
--- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java	Tue Nov 17 00:27:43 2009 +0100
@@ -53,7 +53,7 @@
     private String mResource;
     private RosterAdapter mRoster;
     private int mPreviousPriority;
-    private PrivacyListManagerAdapter mPrivacyList;
+    private PrivacyListManagerAdapter mPrivacyListManager;
     private final BeemService mService;
     private final RemoteCallbackList<IBeemConnectionListener> mRemoteConnListeners = new RemoteCallbackList<IBeemConnectionListener>();
 
@@ -145,7 +145,7 @@
 	    mAdaptee.login(mLogin, mPassword, mResource);
 
 	    mChatManager = new BeemChatManager(mAdaptee.getChatManager(), mService);
-	    mPrivacyList = new PrivacyListManagerAdapter(mAdaptee);
+	    mPrivacyListManager = new PrivacyListManagerAdapter(mAdaptee);
 
 	    this.initFeatures(); // pour declarer les features xmpp qu'on
 	    // supporte
@@ -306,19 +306,19 @@
     }
 
     /**
-     * Set the privacy list to use.
-     * @param privacyList the mPrivacyList to set
+     * PrivacyListManagerAdapter mutator.
+     * @param privacyList the PrivacyListManager to set
      */
-    public void setPrivacyList(PrivacyListManagerAdapter privacyList) {
-	this.mPrivacyList = privacyList;
+    public void setPrivacyListManager(PrivacyListManagerAdapter privacyListManager) {
+	this.mPrivacyListManager = privacyListManager;
     }
 
     /**
-     * Get the privacy list in use.
+     * PrivacyListManagerAdapter accessor.
      * @return the mPrivacyList
      */
-    public PrivacyListManagerAdapter getPrivacyList() {
-	return mPrivacyList;
+    public PrivacyListManagerAdapter getPrivacyListManager() {
+	return mPrivacyListManager;
     }
 
     /**
@@ -411,7 +411,8 @@
 		    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);
 		}
@@ -510,7 +511,8 @@
 		    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);
 		}
--- a/src/com/beem/project/beem/service/XmppFacade.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/XmppFacade.java	Tue Nov 17 00:27:43 2009 +0100
@@ -12,6 +12,7 @@
 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;
 import com.beem.project.beem.service.aidl.IRoster;
 import com.beem.project.beem.service.aidl.IXmppConnection;
 import com.beem.project.beem.service.aidl.IXmppFacade;
@@ -25,9 +26,9 @@
  */
 public class XmppFacade extends IXmppFacade.Stub {
 
-    private XmppConnectionAdapter mConnexion;
-    private BeemService mBeemService;
-    private JingleService mJingle;
+    private final XmppConnectionAdapter mConnexion;
+    private final BeemService mBeemService;
+    private final JingleService mJingle;
 
     /**
      * Constructor for XMPPFacade.
@@ -97,6 +98,14 @@
 	return mConnexion.getRoster();
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IPrivacyListManager getPrivacyListManager() {
+	return mConnexion.getPrivacyListManager();
+    }
+
     @Override
     public void sendPresencePacket(PresenceAdapter presence) throws RemoteException {
 	Presence presence2 = new Presence(PresenceType.getPresenceTypeFrom(presence.getType()));
@@ -105,11 +114,6 @@
     }
 
     @Override
-    public void blockUser(String jid) throws RemoteException {
-	mConnexion.getPrivacyList().addBlockedUser(jid);
-    }
-
-    @Override
     public void call(String jid) throws RemoteException {
 	mJingle.call(jid);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/service/aidl/IPrivacyListListener.aidl	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,8 @@
+package com.beem.project.beem.service.aidl;
+
+import  com.beem.project.beem.service.PrivacyListItem;
+
+interface IPrivacyListListener {
+	void updatedPrivacyList(in String listName);
+	void setPrivacyList(in String listName, in List<PrivacyListItem> listItem);
+}
--- a/src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/aidl/IPrivacyListManager.aidl	Tue Nov 17 00:27:43 2009 +0100
@@ -1,25 +1,22 @@
 package com.beem.project.beem.service.aidl;
 
-
-
-/**
- * An aidl interface for Privacy List Manager.
- */
-interface IPrivacyListManager {
+import  com.beem.project.beem.service.PrivacyListItem;
+import  com.beem.project.beem.service.aidl.IPrivacyListListener;
 
-	/**
-	 *	@return: return a list of blocked users
-	 */
-	List<String> getBlockedUsers();
-	
-	/**
-	 *	@return: return a list of blocked users
-	 */
+interface IPrivacyListManager {
+	void createPrivacyList(in String listName, in List<PrivacyListItem> items);
+	void removePrivacyList(in String listName);
+	void editPrivacyList(in String listName, in List<PrivacyListItem> items);
+	String getActivePrivacyList();
+	String getDefaultPrivacyList();
+	void setActivePrivacyList(in String listName);
+	void setDefaultPrivacyList(in String listName);
+	void declineActivePrivacyList();
+	void declineDefaultPrivacyList();
+	List<String> getPrivacyLists();
+	void blockUser(in String listName, in String jid);
 	List<String> getBlockedUsersByList(in String listName);
-	
-	/**
-	 *	@param: block an user
-	 */
-	void addBlockedUser(in String jid);
-    
+	List<String> getBlockedGroupsByList(in String listName);
+	void addPrivacyListListener(in IPrivacyListListener listener);
+	void removePrivacyListListener(in IPrivacyListListener listener);
 }
\ No newline at end of file
--- a/src/com/beem/project/beem/service/aidl/IXmppConnection.aidl	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/aidl/IXmppConnection.aidl	Tue Nov 17 00:27:43 2009 +0100
@@ -3,6 +3,7 @@
 import  com.beem.project.beem.service.aidl.IRoster;
 import  com.beem.project.beem.service.aidl.IBeemConnectionListener;
 import  com.beem.project.beem.service.aidl.IChatManager;
+import  com.beem.project.beem.service.aidl.IPrivacyListManager;
 
 interface IXmppConnection {
 
@@ -24,4 +25,6 @@
     void changeStatusAndPriority(in int status, in String msg, in int priority);
 
     void changeStatus(in int status, in String msg);
+
+    IPrivacyListManager getPrivacyListManager();
 }
--- a/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl	Tue Nov 17 00:27:43 2009 +0100
@@ -3,6 +3,7 @@
 import  com.beem.project.beem.service.aidl.IXmppConnection;
 import  com.beem.project.beem.service.aidl.IRoster;
 import  com.beem.project.beem.service.aidl.IChatManager;
+import  com.beem.project.beem.service.aidl.IPrivacyListManager;
 import com.beem.project.beem.service.PresenceAdapter;
 
 interface IXmppFacade {
@@ -45,18 +46,18 @@
     void changeStatus(in int status, in String msg);
     
     void sendPresencePacket(in PresenceAdapter presence);
-    
-    void blockUser(in String jid);
-    
+
     /**
      * make a jingle audio call
      * @param jid the receiver id
      */
      void call(in String jid);
      
-     /**
-      * get the user vcard avatar
-      * @param jid the user jid
-      */
-      byte[] getVcardAvatar(in String jid);
+	 /**
+	  * get the user vcard avatar
+	  * @param jid the user jid
+	  */
+	  byte[] getVcardAvatar(in String jid);
+	  
+	IPrivacyListManager getPrivacyListManager();
 }
--- a/src/com/beem/project/beem/ui/ChangeStatus.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/ui/ChangeStatus.java	Tue Nov 17 00:27:43 2009 +0100
@@ -43,6 +43,7 @@
     private static final int AWAY_IDX = 3;
     private static final int UNAVAILABLE_IDX = 4;
     private static final int DISCONNECTED_IDX = 5;
+
     private EditText mStatusMessageEditText;
     private Toast mToast;
     private Button mOk;
@@ -73,10 +74,10 @@
 
 	mOk = (Button) findViewById(R.id.ChangeStatusOk);
 	mOk.setOnClickListener(mOnClickOk);
-	
+
 	mClear = (Button) findViewById(R.id.ChangeStatusClear);
 	mClear.setOnClickListener(mOnClickOk);
-	
+
 	mSettings = PreferenceManager.getDefaultSharedPreferences(this);
 	mStatusMessageEditText = (EditText) findViewById(R.id.ChangeStatusMessage);
 	mStatusMessageEditText.setText(getPreferenceString(R.string.PreferenceStatusText));
--- a/src/com/beem/project/beem/ui/Chat.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java	Tue Nov 17 00:27:43 2009 +0100
@@ -31,8 +31,10 @@
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.View.OnClickListener;
 import android.view.View.OnKeyListener;
 import android.widget.BaseAdapter;
+import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -54,6 +56,10 @@
 import com.beem.project.beem.utils.BeemBroadcastReceiver;
 import com.beem.project.beem.utils.Status;
 
+/**
+ * This class represents an activity which allows the user to chat with his/her contacts.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
 public class Chat extends Activity implements OnKeyListener {
 
     private static final String TAG = "Chat";
@@ -61,7 +67,7 @@
     static {
 	SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
     }
-    private Handler mHandler = new Handler();
+    private Handler mHandler;
 
     private IRoster mRoster;
     private Contact mContact;
@@ -71,9 +77,10 @@
     private ImageView mContactStatusIcon;
     private ListView mMessagesListView;
     private EditText mInputField;
-    private Map<Integer, Bitmap> mStatusIconsMap = new HashMap<Integer, Bitmap>();
+    private Button mSendButton;
+    private final Map<Integer, Bitmap> mStatusIconsMap = new HashMap<Integer, Bitmap>();
 
-    private List<MessageText> mListMessages = new ArrayList<MessageText>();
+    private final List<MessageText> mListMessages = new ArrayList<MessageText>();
 
     private IChat mChat;
     private IChatManager mChatManager;
@@ -94,6 +101,7 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onCreate(Bundle savedBundle) {
 	super.onCreate(savedBundle);
 
@@ -118,6 +126,13 @@
 	mMessagesListView.setAdapter(mMessagesListAdapter);
 	mInputField = (EditText) findViewById(R.id.chat_input);
 	mInputField.setOnKeyListener(this);
+	mSendButton = (Button) findViewById(R.id.chat_send_message);
+	mSendButton.setOnClickListener(new OnClickListener() {
+	    @Override
+	    public void onClick(View v) {
+		sendMessage();
+	    }
+	});
 
 	prepareIconsStatus();
 
@@ -127,6 +142,7 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onDestroy() {
 	super.onDestroy();
 
@@ -145,6 +161,7 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onStart() {
 	super.onStart();
 
@@ -156,6 +173,7 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onStop() {
 	super.onStop();
 
@@ -176,6 +194,7 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onResume() {
 	super.onResume();
     }
@@ -183,6 +202,7 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onPause() {
 	super.onPause();
     }
@@ -190,12 +210,14 @@
     /**
      * {@inheritDoc}.
      */
+    @Override
     protected void onNewIntent(Intent intent) {
 	super.onNewIntent(intent);
 
 	Log.v(TAG, "BEGIN onNewIntent.");
 	try {
-	    changeCurrentChat((mContact = new Contact(intent.getData())));
+	    mContact = new Contact(intent.getData());
+	    changeCurrentChat(mContact);
 	} catch (RemoteException e) {
 	    Log.e(TAG, e.getMessage());
 	}
@@ -246,6 +268,7 @@
 	    case R.id.chat_menu_change_chat:
 		try {
 		    final List<Contact> openedChats = mChatManager.getOpenedChatList();
+
 		    if (openedChats.size() > 0)
 			createChatSwitcherDialog(openedChats);
 		    else
@@ -278,6 +301,7 @@
 	for (Contact c : openedChats) {
 	    items[i++] = c.getName();
 	}
+
 	AlertDialog.Builder builder = new AlertDialog.Builder(this);
 	builder.setTitle(getString(R.string.chat_dialog_change_chat_title));
 	builder.setItems(items, new DialogInterface.OnClickListener() {
@@ -291,6 +315,9 @@
 	chatSwitcherDialog.show();
     }
 
+    /**
+     * Create a dialog which notify the user that there're not another one active chat.
+     */
     private void createNoActiveChatsDialog() {
 	AlertDialog.Builder builder = new AlertDialog.Builder(this);
 	builder.setMessage(getString(R.string.chat_no_more_chats));
@@ -300,8 +327,8 @@
 
     /**
      * Change the displayed chat.
-     * @param contact
-     * @throws RemoteException
+     * @param contact the targeted contact of the new chat
+     * @throws RemoteException If a Binder remote-invocation error occurred.
      */
     private void changeCurrentChat(Contact contact) throws RemoteException {
 	Log.v(TAG, "BEGIN changeCurrentChat.");
@@ -309,6 +336,7 @@
 	    mChat.setOpen(false);
 	mChat = mChatManager.createChat(contact, mMessageListener);
 	mChat.setOpen(true);
+
 	mChatManager.deleteChatNotification(mChat);
 
 	mContact = mRoster.getContact(contact.getJID());
@@ -321,7 +349,7 @@
 
     /**
      * Get all messages from the current chat and refresh the activity with them.
-     * @throws RemoteException
+     * @throws RemoteException If a Binder remote-invocation error occurred.
      */
     private void playRegisteredTranscript() throws RemoteException {
 	String fromBareJid = null;
@@ -359,7 +387,7 @@
     }
 
     /**
-     * @author Jamu
+     * {@inheritDoc}.
      */
     private final class BeemServiceConnection implements ServiceConnection {
 
@@ -378,7 +406,8 @@
 		mChatManager = mXmppFacade.getChatManager();
 		mRoster = mXmppFacade.getRoster();
 		mRoster.addRosterListener(mBeemRosterListener);
-		changeCurrentChat((mContact = new Contact(getIntent().getData())));
+		mContact = new Contact(getIntent().getData());
+		changeCurrentChat(mContact);
 	    } catch (RemoteException e) {
 		Log.e(TAG, e.getMessage());
 	    }
@@ -403,7 +432,7 @@
     }
 
     /**
-     * @author Jamu
+     * {@inheritDoc}.
      */
     private class BeemRosterListener extends IBeemRosterListener.Stub {
 
@@ -466,7 +495,7 @@
     }
 
     /**
-     * @author Jamu
+     * {@inheritDoc}.
      */
     private class OnMessageListener extends IMessageListener.Stub {
 
@@ -524,7 +553,8 @@
     }
 
     /**
-     * @author Jamu
+     * This class serve to listen on ChatManager events.
+     * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
      */
     private class OnChatManagerListener extends IChatManagerListener.Stub {
 	/**
@@ -588,26 +618,54 @@
 	    R.drawable.status_requested));
     }
 
+    /**
+     * {@inheritDoc}.
+     */
     private class MessagesListAdapter extends BaseAdapter {
 
-	private Context mContext;
+	private final Context mContext;
 
-	public MessagesListAdapter(Context context) {
+	/**
+	 * Constructor.
+	 * @param context The MessagesListAdapter context.
+	 */
+	public MessagesListAdapter(final Context context) {
 	    mContext = context;
 	}
 
+	/**
+	 * Returns the number of messages contained in the messages list.
+	 * @return The number of messages contained in the messages list.
+	 */
 	public int getCount() {
 	    return mListMessages.size();
 	}
 
+	/**
+	 * Return an item from the messages list that is positioned at the position passed by parameter.
+	 * @param position The position of the requested item.
+	 * @return The item from the messages list at the requested position.
+	 */
 	public Object getItem(int position) {
 	    return position;
 	}
 
+	/**
+	 * Return the id of an item from the messages list that is positioned at the position passed by parameter.
+	 * @param position The position of the requested item.
+	 * @return The id of an item from the messages list at the requested position.
+	 */
 	public long getItemId(int position) {
 	    return position;
 	}
 
+	/**
+	 * Return the view of an item from the messages list.
+	 * @param position The position of the requested item.
+	 * @param convertView The old view to reuse if possible.
+	 * @param parent The parent that this view will eventually be attached to.
+	 * @return A View corresponding to the data at the specified position.
+	 */
 	public View getView(int position, View convertView, ViewGroup parent) {
 	    MessageView sv;
 	    if (convertView == null) {
@@ -633,39 +691,73 @@
 	}
     }
 
+    /**
+     * Class which simplify an Xmpp text message.
+     * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+     */
     private class MessageText {
 	private String mBareJid;
 	private String mName;
 	private String mMessage;
 
-	public MessageText(String bareJid, String name, String message) {
+	/**
+	 * Constructor.
+	 * @param bareJid A String containing the bare JID of the message's author.
+	 * @param name A String containing the name of the message's author.
+	 * @param message A String containing the message.
+	 */
+	public MessageText(final String bareJid, final String name, final String message) {
 	    mBareJid = bareJid;
 	    mName = name;
 	    mMessage = message;
 	}
 
+	/**
+	 * JID attribute accessor.
+	 * @return A String containing the bare JID of the message's author.
+	 */
 	public String getBareJid() {
 	    return mBareJid;
 	}
 
+	/**
+	 * Name attribute accessor.
+	 * @return A String containing the name of the message's author.
+	 */
 	public String getName() {
 	    return mName;
 	}
 
+	/**
+	 * Message attribute accessor.
+	 * @return A String containing the message.
+	 */
 	public String getMessage() {
 	    return mMessage;
 	}
 
+	/**
+	 * JID attribute mutator.
+	 * @param bareJid A String containing the author's bare JID of the message.
+	 */
 	@SuppressWarnings("unused")
 	public void setBareJid(String bareJid) {
 	    mBareJid = bareJid;
 	}
 
+	/**
+	 * Name attribute mutator.
+	 * @param name A String containing the author's name of the message.
+	 */
 	@SuppressWarnings("unused")
 	public void setName(String name) {
 	    mName = name;
 	}
 
+	/**
+	 * Message attribute mutator.
+	 * @param message A String containing a message.
+	 */
 	public void setMessage(String message) {
 	    mMessage = message;
 	}
@@ -675,16 +767,16 @@
      * We will use a MessageView to display each message.
      */
     private class MessageView extends LinearLayout {
-	private TextView mName;
-	private TextView mMessage;
+	private final TextView mName;
+	private final TextView mMessage;
 
 	/**
 	 * Constructor.
-	 * @param context
-	 * @param name
-	 * @param message
+	 * @param context The context of the MessageView
+	 * @param name A String containing the message's author.
+	 * @param message A String containing the message.
 	 */
-	public MessageView(Context context, String name, String message) {
+	public MessageView(final Context context, final String name, final String message) {
 	    super(context);
 
 	    this.setOrientation(VERTICAL);
@@ -699,14 +791,16 @@
 	}
 
 	/**
-	 * Convenience method to set the title of a MessageView
+	 * Convenience method to set the title of a MessageView.
+	 * @param name A String containing the message's author.
 	 */
 	public void setName(String name) {
 	    mName.setText(name);
 	}
 
 	/**
-	 * Convenience method to set the dialogue of a MessageView
+	 * Convenience method to set the dialogue of a MessageView.
+	 * @param message A String containing the message.
 	 */
 	public void setMessage(String message) {
 	    mMessage.setText(message);
@@ -732,13 +826,13 @@
     }
 
     /**
-     * Send an xmpp message.
+     * Send an XMPP message.
      */
     private void sendMessage() {
 	final String inputContent = mInputField.getText().toString();
 
 	Log.v(TAG, "BEGIN sendMessage.");
-	if (!inputContent.equals("")) {
+	if (!"".equals(inputContent)) {
 	    Message msgToSend = new Message(mContact.getJID(), Message.MSG_TYPE_CHAT);
 	    msgToSend.setBody(inputContent);
 
--- a/src/com/beem/project/beem/ui/ContactList.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java	Tue Nov 17 00:27:43 2009 +0100
@@ -654,6 +654,7 @@
 		    mListGroup.add(getString(R.string.contact_list_all_contact));
 		    mListGroup.addAll(tmpGroupList);
 		    mListGroup.add(getString(R.string.contact_list_no_group));
+		    mContactOnGroup.clear();
 		    if (tmpGroupList.size() > 0) {
 			List<Contact> tmpNoGroup = new ArrayList<Contact>();
 			for (String s : tmpGroupList) {
--- a/src/com/beem/project/beem/ui/CreateAccount.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/ui/CreateAccount.java	Tue Nov 17 00:27:43 2009 +0100
@@ -26,7 +26,7 @@
 
 /**
  * This class represents an activity which allows the user to create an account on the XMPP server saved in settings.
- * @author dasilvj
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
  */
 public class CreateAccount extends Activity {
 
@@ -138,7 +138,8 @@
      * @return Registered proxy port
      */
     private int getRegisteredProxyPort() {
-	return Integer.parseInt(mSettings.getString(getString(R.string.settings_key_proxy_port), DEFAULT_STRING_VALUE));
+	return Integer
+	    .parseInt(mSettings.getString(getString(R.string.settings_key_proxy_port), DEFAULT_STRING_VALUE));
     }
 
     /**
@@ -266,8 +267,10 @@
 		else {
 		    if (createAccount(username, passwordFieldValue)) {
 			SharedPreferences.Editor settingsEditor = mSettings.edit();
-			settingsEditor.putString(getString(R.string.settings_key_account_username), usernameFieldValue);
-			settingsEditor.putString(getString(R.string.settings_key_account_password), passwordFieldValue);
+			settingsEditor
+			    .putString(getString(R.string.settings_key_account_username), usernameFieldValue);
+			settingsEditor
+			    .putString(getString(R.string.settings_key_account_password), passwordFieldValue);
 			settingsEditor.putBoolean(getString(R.string.PreferenceIsConfigured), true);
 			settingsEditor.commit();
 			finish();
--- a/src/com/beem/project/beem/ui/Login.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/ui/Login.java	Tue Nov 17 00:27:43 2009 +0100
@@ -29,7 +29,7 @@
 
 /**
  * This class represents an activity which allows the user to connect to an XMPP server with his username/password.
- * @author dasilvj
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
  */
 public class Login extends Activity {
 
@@ -41,7 +41,7 @@
     }
 
     private final Handler mConnectionHandler = new Handler();
-    private ConnectionRunnable mConnectionRunnable = new ConnectionRunnable();
+    private final ConnectionRunnable mConnectionRunnable = new ConnectionRunnable();
     private ProgressDialog mProgressDialog;
 
     private boolean mIsConnectedService;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/PrivacyList.java	Tue Nov 17 00:27:43 2009 +0100
@@ -0,0 +1,229 @@
+package com.beem.project.beem.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import android.app.AlertDialog;
+import android.app.ListActivity;
+import android.content.ComponentName;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+
+import com.beem.project.beem.BeemService;
+import com.beem.project.beem.R;
+import com.beem.project.beem.service.PrivacyListItem;
+import com.beem.project.beem.service.aidl.IPrivacyListListener;
+import com.beem.project.beem.service.aidl.IPrivacyListManager;
+import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.utils.BeemBroadcastReceiver;
+
+/**
+ * This class represents an activity which allows the user to manage his privacy lists.
+ * @author Jean-Manuel Da Silva <dasilvj at beem-project dot com>
+ */
+public class PrivacyList extends ListActivity {
+
+    private static final String TAG = "PrivacyList";
+    private static final Intent SERVICE_INTENT = new Intent();
+    static {
+	SERVICE_INTENT.setComponent(new ComponentName("com.beem.project.beem", "com.beem.project.beem.BeemService"));
+    }
+    private Handler mHandler = new Handler();
+
+    private ArrayAdapter<String> mAdapter;
+    private final List<String> mPrivacyListNames = new ArrayList<String>();
+
+    private final ServiceConnection mConn = new BeemServiceConnection();
+    private BeemBroadcastReceiver mBroadcastReceiver;
+
+    private IPrivacyListManager mPrivacyListManager;
+    private IPrivacyListListener mPrivacyListListener;
+
+    /**
+     * Constructor.
+     */
+    public PrivacyList() {
+	super();
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+	super.onCreate(savedInstanceState);
+	Log.d(TAG, "BEGIN onCreate.");
+	setContentView(R.layout.privacy_list);
+
+	mHandler = new Handler();
+
+	mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mPrivacyListNames);
+	setListAdapter(mAdapter);
+
+	mPrivacyListListener = new PrivacyListListener();
+	mBroadcastReceiver = new BeemBroadcastReceiver(mConn);
+	this.registerReceiver(mBroadcastReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED));
+
+	Log.d(TAG, "END onCreate.");
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    protected void onDestroy() {
+	super.onDestroy();
+
+	Log.v(TAG, "BEGIN onDestroy.");
+	this.unregisterReceiver(mBroadcastReceiver);
+	Log.v(TAG, "END onDestroy.");
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    protected void onStart() {
+	super.onStart();
+
+	Log.v(TAG, "BEGIN onStart.");
+	bindService(new Intent(this, BeemService.class), mConn, BIND_AUTO_CREATE);
+	Log.v(TAG, "END onStart.");
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    protected void onStop() {
+	super.onStop();
+
+	Log.v(TAG, "BEGIN onStop.");
+	if (mBroadcastReceiver.isBinded()) {
+	    unbindService(mConn);
+	}
+	Log.v(TAG, "END onStop.");
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    public final boolean onCreateOptionsMenu(Menu menu) {
+	super.onCreateOptionsMenu(menu);
+
+	MenuInflater inflater = getMenuInflater();
+	inflater.inflate(R.menu.privacy_list, menu);
+	return true;
+    }
+
+    /**
+     * {@inheritDoc}.
+     */
+    @Override
+    public final boolean onOptionsItemSelected(MenuItem item) {
+	switch (item.getItemId()) {
+	    case R.id.privacy_list_menu_create:
+		createCreatePrivacyListDialog();
+		return true;
+	    default:
+		return false;
+	}
+    }
+
+    private final class BeemServiceConnection implements ServiceConnection {
+
+	private IXmppFacade mXmppFacade;
+
+	@Override
+	public void onServiceConnected(ComponentName name, IBinder service) {
+	    Log.v(TAG, "BEGIN onServiceConnected.");
+	    mXmppFacade = IXmppFacade.Stub.asInterface(service);
+	    mBroadcastReceiver.setBinded(true);
+	    try {
+		mPrivacyListManager = mXmppFacade.getPrivacyListManager();
+		mPrivacyListManager.addPrivacyListListener(mPrivacyListListener);
+		/**
+		 * FIXME: ERROR /AndroidRuntime(21999): java.lang.ClassCastException:
+		 * org.jivesoftware.smack.PacketReader$4 ERROR/AndroidRuntime(21999): at
+		 * org.jivesoftware.smack.PrivacyListManager.getRequest(PrivacyListManager.java:189) at
+		 * org.jivesoftware.smack.PrivacyListManager.getPrivacyWithListNames(PrivacyListManager.java:254)
+		 */
+		// mPrivacyListNames = mPrivacyListManager.getPrivacyLists();
+		// mAdapter.notifyDataSetChanged();
+	    } catch (RemoteException e) {
+		Log.e(TAG, e.getMessage());
+	    }
+	    Log.v(TAG, "END onServiceConnected.");
+	}
+
+	@Override
+	public void onServiceDisconnected(ComponentName name) {
+	    Log.v(TAG, "BEGIN onServiceDisconnected.");
+	    mXmppFacade = null;
+	    mBroadcastReceiver.setBinded(false);
+	    Log.v(TAG, "END onServiceDisconnected.");
+	}
+    }
+
+    private class PrivacyListListener extends IPrivacyListListener.Stub {
+
+	@Override
+	public void setPrivacyList(String listName, List<PrivacyListItem> listItem) throws RemoteException {
+	    Log.d(TAG, "BEGIN PrivacyListListener >> setPrivacyList.");
+	    Log.d(TAG, listName);
+	    Log.d(TAG, "END PrivacyListListener >> setPrivacyList.");
+	}
+
+	@Override
+	public void updatedPrivacyList(String listName) throws RemoteException {
+	    Log.d(TAG, "BEGIN PrivacyListListener >> updatedPrivacyList.");
+	    Log.d(TAG, listName);
+	    Log.d(TAG, "END PrivacyListListener >> updatedPrivacyList.");
+	}
+    }
+
+    private void createCreatePrivacyListDialog() {
+	LayoutInflater factory = LayoutInflater.from(this);
+	final View textEntryView = factory.inflate(R.layout.privacy_list_create_dialog, null);
+	AlertDialog.Builder builder = new AlertDialog.Builder(this);
+	builder.setTitle(R.string.privacy_list_create_dialog_title);
+	builder.setView(textEntryView);
+
+	builder.setPositiveButton(R.string.privacy_list_create_dialog_create_button,
+	    new DialogInterface.OnClickListener() {
+		public void onClick(DialogInterface dialog, int whichButton) {
+		    EditText listNameField = (EditText) textEntryView
+			.findViewById(R.id.privacy_list_create_dialog_list_name);
+		    try {
+			mPrivacyListManager.createPrivacyList(listNameField.getText().toString(),
+			    new ArrayList<PrivacyListItem>());
+		    } catch (RemoteException e) {
+			Log.e(TAG, e.getMessage());
+		    }
+		}
+	    });
+
+	builder.setNegativeButton(R.string.CancelButton, new DialogInterface.OnClickListener() {
+	    public void onClick(DialogInterface dialog, int whichButton) {
+	    }
+	});
+
+	AlertDialog createPrivacyListDialog = builder.create();
+	createPrivacyListDialog.show();
+    }
+}
--- a/src/com/beem/project/beem/ui/Settings.java	Mon Nov 16 22:39:11 2009 +0100
+++ b/src/com/beem/project/beem/ui/Settings.java	Tue Nov 17 00:27:43 2009 +0100
@@ -17,7 +17,6 @@
 
 /**
  * This class represents an activity which allows the user to change his account or proxy parameters.
- * @author nikita
  */
 public class Settings extends PreferenceActivity {
 
@@ -103,6 +102,10 @@
 		this.stopService(SERVICE_INTENT);
 		finish();
 		return true;
+	    case R.id.settings_menu_privacy_lists:
+		i = new Intent(this, PrivacyList.class);
+		startActivity(i);
+		return true;
 	    default:
 		return false;
 	}