Add an option to enable the smack debugger
authorDa Risk <darisk972@gmail.com>
Sun, 02 Jan 2011 17:00:53 +0100
changeset 845 5437786281e3
parent 844 7527ec12857d
child 846 53a2e0015adb
Add an option to enable the smack debugger
res/layout/preferences.xml
res/values-fr/strings.xml
res/values/strings.xml
src/com/beem/project/beem/BeemApplication.java
src/com/beem/project/beem/BeemService.java
--- a/res/layout/preferences.xml	Wed Dec 29 13:54:02 2010 +0100
+++ b/res/layout/preferences.xml	Sun Jan 02 17:00:53 2011 +0100
@@ -94,6 +94,8 @@
 			<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" />
+				<CheckBoxPreference android:title="@string/settings_smack_debug"
+					android:defaultValue="false" android:key="smack_debug" />
 				<EditTextPreference android:singleLine="true"
 					android:title="@string/settings_reco_delay" android:name="Reconnect delay"
 					android:summary="@string/SettingsAdvancedRecoDelay" android:key="settings_key_reco_delay"
--- a/res/values-fr/strings.xml	Wed Dec 29 13:54:02 2010 +0100
+++ b/res/values-fr/strings.xml	Sun Jan 02 17:00:53 2011 +0100
@@ -119,6 +119,7 @@
 	<string name="notification_snd_sum">Configurer la sonnerie des messages entrants</string>
 	<string name="settings_chat_compact">Chat compact</string>
 	<string name="settings_chat_compact_sum">Activer la fenetre Chat compact</string>
+	<string name="settings_smack_debug">Activer le debugger XMPP</string>
 	
 	<!-- Subscription class -->
 	<string name="SubscriptAccept">Inscription acceptée</string>
--- a/res/values/strings.xml	Wed Dec 29 13:54:02 2010 +0100
+++ b/res/values/strings.xml	Sun Jan 02 17:00:53 2011 +0100
@@ -121,7 +121,8 @@
 	<string name="settings_chat_compact_sum">Set the chat windows compact</string>
 	<string name="history">History</string>
 	<string name="history_mount">You need to have SDcard mounted and writable to enable history</string>
-	<string name="history_on_off">Enable/Disable history messages</string>
+	<string name="history_on_off">Enable history messages</string>
+	<string name="settings_smack_debug">Enable XMPPP debug</string>
 
 	<!-- Subscription class -->
 	<string name="SubscriptAccept">Subscription accepted</string>
--- a/src/com/beem/project/beem/BeemApplication.java	Wed Dec 29 13:54:02 2010 +0100
+++ b/src/com/beem/project/beem/BeemApplication.java	Sun Jan 02 17:00:53 2011 +0100
@@ -83,6 +83,8 @@
     public static final String NOTIFICATION_VIBRATE_KEY = "notification_vibrate";
     /** Preference key for notification sound. */
     public static final String NOTIFICATION_SOUND_KEY = "notification_sound";
+    /** Preference key for smack debugging. */
+    public static final String SMACK_DEBUG_KEY = "smack_debug";
 
     //TODO add the other one
 
--- a/src/com/beem/project/beem/BeemService.java	Wed Dec 29 13:54:02 2010 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Sun Jan 02 17:00:53 2011 +0100
@@ -154,7 +154,8 @@
 	    || mSettings.getBoolean("settings_key_gmail", false)) {
 	    mConnectionConfiguration.setSecurityMode(SecurityMode.required);
 	}
-	mConnectionConfiguration.setDebuggerEnabled(false);
+	if (mSettings.getBoolean(BeemApplication.SMACK_DEBUG_KEY, false))
+	    mConnectionConfiguration.setDebuggerEnabled(true);
 	mConnectionConfiguration.setSendPresence(true);
 	// maybe not the universal path, but it works on most devices (Samsung Galaxy, Google Nexus One)
 	mConnectionConfiguration.setTruststoreType("BKS");