service: Logging of console output to UI

Change-Id: I89fb0c0672581c1723a2216e63d7fd2be0e2f6e1
Refs: #2434
diff --git a/app/src/main/res/xml/pref_data_sync.xml b/app/src/main/res/xml/pref_data_sync.xml
deleted file mode 100644
index ffda831..0000000
--- a/app/src/main/res/xml/pref_data_sync.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
-         dismiss it. -->
-    <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
-    <ListPreference
-        android:key="sync_frequency"
-        android:title="@string/pref_title_sync_frequency"
-        android:entries="@array/pref_sync_frequency_titles"
-        android:entryValues="@array/pref_sync_frequency_values"
-        android:defaultValue="180"
-        android:negativeButtonText="@null"
-        android:positiveButtonText="@null" />
-
-    <!-- This preference simply launches an intent when selected. Use this UI sparingly, per
-         design guidelines. -->
-    <Preference android:title="@string/pref_title_system_sync_settings">
-        <intent android:action="android.settings.SYNC_SETTINGS" />
-    </Preference>
-
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
deleted file mode 100644
index c49cbed..0000000
--- a/app/src/main/res/xml/pref_general.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <CheckBoxPreference
-        android:key="example_checkbox"
-        android:title="@string/pref_title_social_recommendations"
-        android:summary="@string/pref_description_social_recommendations"
-        android:defaultValue="true" />
-
-    <!-- NOTE: EditTextPreference accepts EditText attributes. -->
-    <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
-    <EditTextPreference
-        android:key="example_text"
-        android:title="@string/pref_title_display_name"
-        android:defaultValue="@string/pref_default_display_name"
-        android:selectAllOnFocus="true"
-        android:inputType="textCapWords"
-        android:capitalize="words"
-        android:singleLine="true"
-        android:maxLines="1" />
-
-    <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
-         dismiss it. -->
-    <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
-    <ListPreference
-        android:key="example_list"
-        android:title="@string/pref_title_add_friends_to_messages"
-        android:defaultValue="-1"
-        android:entries="@array/pref_example_list_titles"
-        android:entryValues="@array/pref_example_list_values"
-        android:negativeButtonText="@null"
-        android:positiveButtonText="@null" />
-
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_headers.xml b/app/src/main/res/xml/pref_headers.xml
deleted file mode 100644
index f2af3f2..0000000
--- a/app/src/main/res/xml/pref_headers.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- These settings headers are only used on tablets. -->
-
-    <header
-        android:fragment="nfd.named_data.net.nfd.NfdSettingsActivity$GeneralPreferenceFragment"
-        android:title="@string/pref_header_general"/>
-
-    <header
-        android:fragment="nfd.named_data.net.nfd.NfdSettingsActivity$NotificationPreferenceFragment"
-        android:title="@string/pref_header_notifications"/>
-
-    <header
-        android:fragment="nfd.named_data.net.nfd.NfdSettingsActivity$DataSyncPreferenceFragment"
-        android:title="@string/pref_header_data_sync"/>
-
-</preference-headers>
diff --git a/app/src/main/res/xml/pref_nfd_log.xml b/app/src/main/res/xml/pref_nfd_log.xml
new file mode 100644
index 0000000..37a0432
--- /dev/null
+++ b/app/src/main/res/xml/pref_nfd_log.xml
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+    <PreferenceCategory
+        android:key="@string/pref_tags_log_level_title_key"
+        android:title="@string/pref_tags_log_level_title">
+
+        <ListPreference
+            android:key="@string/pref_tags_log_level_key"
+            android:title="@string/pref_tags_log_level"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:key="@string/pref_category_title_tags_key"
+        android:title="@string/pref_category_title_tags">
+
+        <ListPreference
+            android:key="@string/pref_tag_commandvalidator_key"
+            android:title="@string/pref_tag_commandvalidator"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_facemanager_key"
+            android:title="@string/pref_tag_facemanager"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_facetable_key"
+            android:title="@string/pref_tag_facetable"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_fibmanager_key"
+            android:title="@string/pref_tag_fibmanager"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_generalconfigsection_key"
+            android:title="@string/pref_tag_generalconfigsection"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_internalface_key"
+            android:title="@string/pref_tag_internalface"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_managerbase_key"
+            android:title="@string/pref_tag_managerbase"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_privilegehelper_key"
+            android:title="@string/pref_tag_privilegehelper"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_remoteregistrator_key"
+            android:title="@string/pref_tag_remoteregistrator"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_ribmanager_key"
+            android:title="@string/pref_tag_ribmanager"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_strategy_key"
+            android:title="@string/pref_tag_strategy"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_strategychoice_key"
+            android:title="@string/pref_tag_strategychoice"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_tablesconfigsection_key"
+            android:title="@string/pref_tag_tablesconfigsection"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_tcpchannel_key"
+            android:title="@string/pref_tag_tcpchannel"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_tcpfactory_key"
+            android:title="@string/pref_tag_tcpfactory"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_tcplocalface_key"
+            android:title="@string/pref_tag_tcplocalface"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+        <ListPreference
+            android:key="@string/pref_tag_udpfactory_key"
+            android:title="@string/pref_tag_udpfactory"
+            android:entries="@array/pref_log_levels"
+            android:entryValues="@array/pref_log_level_values"
+            android:defaultValue="I"
+            android:negativeButtonText="@null"
+            android:positiveButtonText="@null" />
+
+    </PreferenceCategory>
+</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml
deleted file mode 100644
index b4b8cae..0000000
--- a/app/src/main/res/xml/pref_notification.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- A 'parent' preference, which enables/disables child preferences (below)
-         when checked/unchecked. -->
-    <CheckBoxPreference
-        android:key="notifications_new_message"
-        android:title="@string/pref_title_new_message_notifications"
-        android:defaultValue="true" />
-
-    <!-- Allows the user to choose a ringtone in the 'notification' category. -->
-    <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
-    <!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. -->
-    <RingtonePreference
-        android:dependency="notifications_new_message"
-        android:key="notifications_new_message_ringtone"
-        android:title="@string/pref_title_ringtone"
-        android:ringtoneType="notification"
-        android:defaultValue="content://settings/system/notification_sound" />
-
-    <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
-    <CheckBoxPreference
-        android:dependency="notifications_new_message"
-        android:key="notifications_new_message_vibrate"
-        android:title="@string/pref_title_vibrate"
-        android:defaultValue="true" />
-
-</PreferenceScreen>