Merge "Refactor VPN settings refresh to reuse preferences"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 37edca7..43fe796 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1161,6 +1161,18 @@
         </activity>
         -->
 
+        <activity android:name="Settings$BackgroundCheckSummaryActivity"
+                android:label="@string/background_check_title"
+                android:taskAffinity=""
+                android:enabled="false">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.applications.BackgroundCheckSummary" />
+        </activity>
+
         <activity android:name="Settings$LocationSettingsActivity"
                 android:label="@string/location_settings_title"
                 android:icon="@drawable/ic_settings_location"
diff --git a/res/layout/app_ops_item.xml b/res/layout/app_ops_item.xml
index 8d21456..adba9da 100644
--- a/res/layout/app_ops_item.xml
+++ b/res/layout/app_ops_item.xml
@@ -25,7 +25,7 @@
     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
     android:paddingTop="8dip"
     android:paddingBottom="8dip"
-    android:columnCount="3">
+    android:columnCount="4">
 
     <ImageView
         android:id="@+id/app_icon"
@@ -47,6 +47,14 @@
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:textAlignment="viewStart" />
 
+    <Switch
+        android:id="@+id/op_switch"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_rowSpan="2"
+        android:focusable="false"
+        android:clickable="false" />
+
     <TextView
         android:id="@+id/op_name"
         android:layout_width="0dip"
diff --git a/res/layout/background_check_summary.xml b/res/layout/background_check_summary.xml
new file mode 100644
index 0000000..ee47194
--- /dev/null
+++ b/res/layout/background_check_summary.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2015, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/appops_content"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+</LinearLayout>
diff --git a/res/layout/preference_importance_slider.xml b/res/layout/preference_importance_slider.xml
new file mode 100644
index 0000000..737254b
--- /dev/null
+++ b/res/layout/preference_importance_slider.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minHeight="?android:attr/listPreferredItemHeight"
+        android:gravity="center_vertical"
+        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+        android:orientation="vertical"
+        android:clickable="false"
+        android:focusable="false"
+        android:paddingTop="8dip"
+        android:paddingBottom="8dip">
+
+        <TextView
+                android:id="@android:id/title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:singleLine="true"
+                android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+                android:textColor="?android:attr/textColorPrimary"
+                android:ellipsize="marquee"
+                android:fadingEdge="horizontal" />
+
+        <TextView
+                android:id="@android:id/summary"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignStart="@android:id/title"
+                android:textAlignment="viewStart"
+                android:textAppearance="@android:style/TextAppearance.Material.Body1"
+                android:textColor="?android:attr/textColorSecondary"
+                android:maxLines="10"
+                android:minLines="2" />
+
+        <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="6dp">
+
+            <ImageView
+                    android:id="@+id/low_importance"
+                    android:src="@android:drawable/ic_menu_close_clear_cancel"
+                    android:layout_gravity="center_vertical|start"
+                    android:layout_width="24dp"
+                    android:layout_height="24dp" />
+
+            <SeekBar
+                    android:id="@*android:id/seekbar"
+                    android:layout_marginStart="24dp"
+                    android:layout_marginEnd="24dp"
+                    android:layout_gravity="center_vertical"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:focusable="true"/>
+
+            <ImageView
+                    android:id="@+id/max_importance"
+                    android:src="@android:drawable/ic_popup_reminder"
+                    android:layout_gravity="center_vertical|end"
+                    android:layout_width="24dp"
+                    android:layout_height="24dp" />
+
+        </FrameLayout>
+
+</LinearLayout>
diff --git a/res/layout/preference_volume_slider.xml b/res/layout/preference_volume_slider.xml
index 878a710..d279eb6 100644
--- a/res/layout/preference_volume_slider.xml
+++ b/res/layout/preference_volume_slider.xml
@@ -20,7 +20,8 @@
     android:minHeight="?android:attr/listPreferredItemHeight"
     android:gravity="center_vertical"
     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:clickable="false" >
 
     <LinearLayout
         android:layout_width="match_parent"
diff --git a/res/layout/radio_info.xml b/res/layout/radio_info.xml
index a288224..16bf0f6 100644
--- a/res/layout/radio_info.xml
+++ b/res/layout/radio_info.xml
@@ -51,13 +51,13 @@
                 />
  
         <LinearLayout style="@style/entry_layout">
-            <TextView android:text="@string/radio_info_ping_ipaddr" style="@style/info_label" />
-            <TextView android:id="@+id/pingIpAddr" style="@style/info_value" />
+            <TextView android:text="@string/radio_info_ping_hostname_v4" style="@style/info_label" />
+            <TextView android:id="@+id/pingHostnameV4" style="@style/info_value" />
         </LinearLayout>
 
         <LinearLayout style="@style/entry_layout">
-            <TextView android:text="@string/radio_info_ping_hostname" style="@style/info_label" />
-            <TextView android:id="@+id/pingHostname" style="@style/info_value" />
+            <TextView android:text="@string/radio_info_ping_hostname_v6" style="@style/info_label" />
+            <TextView android:id="@+id/pingHostnameV6" style="@style/info_value" />
         </LinearLayout>
 
         <LinearLayout style="@style/entry_layout">
@@ -71,6 +71,14 @@
             <TextView android:id="@+id/dbm" style="@style/info_value" />
         </LinearLayout>
 
+        <!-- CellInfoListRate -->
+        <Button android:id="@+id/cell_info_list_rate"
+                android:textSize="14sp"
+                android:layout_marginTop="8dip"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                />
+
         <!-- Location -->
         <LinearLayout style="@style/entry_layout">
             <TextView android:text="@string/radio_info_signal_location_label" style="@style/info_label" />
@@ -88,6 +96,8 @@
         <LinearLayout style="@style/entry_layout">
             <TextView android:text="@string/radio_info_cellinfo_label"
                       style="@style/info_label" />
+        </LinearLayout>
+        <LinearLayout style="@style/entry_layout">
             <TextView android:id="@+id/cellinfo" style="@style/info_value" />
         </LinearLayout>
 
@@ -140,7 +150,6 @@
             <TextView android:id="@+id/call" style="@style/info_value" />
         </LinearLayout>
 
-
         <!-- Radio Resets -->
         <LinearLayout style="@style/entry_layout">
             <TextView android:text="@string/radio_info_radio_resets_label" style="@style/info_label" />
@@ -210,15 +219,7 @@
                 android:layout_height="wrap_content"
                 />
 
-        <!-- CellInfoListRate -->
-        <Button android:id="@+id/cell_info_list_rate"
-                android:textSize="14sp"
-                android:layout_marginTop="8dip"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                />
-
-        <!-- IMS registration required -->
+       <!-- IMS registration required -->
         <Button android:id="@+id/ims_reg_required"
                 android:textSize="14sp"
                 android:layout_marginTop="8dip"
diff --git a/res/layout/wifi_status_test.xml b/res/layout/wifi_status_test.xml
index 2bdfbfc..aac3207 100644
--- a/res/layout/wifi_status_test.xml
+++ b/res/layout/wifi_status_test.xml
@@ -111,11 +111,6 @@
                 />
 
         <LinearLayout style="@style/entry_layout">
-            <TextView android:text="@string/radio_info_ping_ipaddr" style="@style/info_label" />
-            <TextView android:id="@+id/pingIpAddr" style="@style/info_value" />
-        </LinearLayout>
-
-        <LinearLayout style="@style/entry_layout">
             <TextView android:text="@string/radio_info_ping_hostname" style="@style/info_label" />
             <TextView android:id="@+id/pingHostname" style="@style/info_value" />
         </LinearLayout>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index b3e2655..12a0172 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -620,11 +620,25 @@
         <item>monitor high power location</item>
         <item>get usage stats</item>
         <item>mute/unmute microphone</item>
+        <item>show toast</item>
         <item>project media</item>
         <item>activate VPN</item>
         <item>write wallpaper</item>
         <item>assist structure</item>
         <item>assist screenshot</item>
+        <item>read phone state</item>
+        <item>add voicemail</item>
+        <item>use sip</item>
+        <item>process outgoing call</item>
+        <item>fingerprint</item>
+        <item>body sensors</item>
+        <item>read cell broadcasts</item>
+        <item>mock location</item>
+        <item>read storage</item>
+        <item>write storage</item>
+        <item>turn on screen</item>
+        <item>get accounts</item>
+        <item>run in background</item>
     </string-array>
 
     <!-- User display names for app ops codes -->
@@ -674,11 +688,25 @@
         <item>Location</item>
         <item>Get usage stats</item>
         <item>Mute/unmute microphone</item>
+        <item>Show toast</item>
         <item>Project media</item>
         <item>Activate VPN</item>
         <item>Write wallpaper</item>
         <item>Assist structure</item>
         <item>Assist screenshot</item>
+        <item>Read phone state</item>
+        <item>Add voicemail</item>
+        <item>Use sip</item>
+        <item>Process outgoing call</item>
+        <item>Fingerprint</item>
+        <item>Body sensors</item>
+        <item>Read cell broadcasts</item>
+        <item>Mock location</item>
+        <item>Read storage</item>
+        <item>Write storage</item>
+        <item>Turn on screen</item>
+        <item>Get accounts</item>
+        <item>Run in background</item>
     </string-array>
 
     <!-- Titles for the list of long press timeout options. -->
@@ -880,237 +908,6 @@
         <item>-1</item>
     </integer-array>
 
-    <!-- Titles for logd limit size selection preference. [CHAR LIMIT=14] -->
-    <string-array name="select_logd_size_titles">
-        <item>64K</item>
-        <item>256K</item>
-        <item>1M</item>
-        <item>4M</item>
-        <item>16M</item>
-    </string-array>
-
-    <!-- Titles for logd limit size lowram selection preference. [CHAR LIMIT=14] -->
-    <string-array name="select_logd_size_lowram_titles">
-        <item>64K</item>
-        <item>256K</item>
-        <item>1M</item>
-    </string-array>
-
-    <!-- Values for logd limit size selection preference. -->
-    <string-array name="select_logd_size_values" translatable="false" >
-        <item>65536</item>
-        <item>262144</item>
-        <item>1048576</item>
-        <item>4194304</item>
-        <item>16777216</item>
-    </string-array>
-
-    <!-- Summaries for logd limit size selection preference. [CHAR LIMIT=30]-->
-    <string-array name="select_logd_size_summaries" >
-        <item>64K per log buffer</item>
-        <item>256K per log buffer</item>
-        <item>1M per log buffer</item>
-        <item>4M per log buffer</item>
-        <item>16M per log buffer</item>
-    </string-array>
-
-    <!-- Titles for HDCP checking preference. [CHAR LIMIT=35] -->
-    <string-array name="hdcp_checking_titles">
-        <item>Never check</item>
-        <item>Check for DRM content only</item>
-        <item>Always check</item>
-    </string-array>
-
-    <!-- Values for HDCP checking preference. -->
-    <string-array name="hdcp_checking_values" translatable="false" >
-        <item>never</item>
-        <item>drm-only</item>
-        <item>always</item>
-    </string-array>
-
-    <!-- Summaries for HDCP checking preference. [CHAR LIMIT=100]-->
-    <string-array name="hdcp_checking_summaries" >
-        <item>Never use HDCP checking</item>
-        <item>Use HDCP checking for DRM content only</item>
-        <item>Always use HDCP checking</item>
-    </string-array>
-
-    <!-- Titles for window animation scale preference. [CHAR LIMIT=35] -->
-    <string-array name="window_animation_scale_entries">
-        <item>Animation off</item>
-        <item>Animation scale .5x</item>
-        <item>Animation scale 1x</item>
-        <item>Animation scale 1.5x</item>
-        <item>Animation scale 2x</item>
-        <item>Animation scale 5x</item>
-        <item>Animation scale 10x</item>
-    </string-array>
-
-    <!-- Values for window animation scale preference. -->
-    <string-array name="window_animation_scale_values" translatable="false" >
-        <item>0</item>
-        <item>.5</item>
-        <item>1</item>
-        <item>1.5</item>
-        <item>2</item>
-        <item>5</item>
-        <item>10</item>
-    </string-array>
-
-    <!-- Titles for transition animation scale preference. [CHAR LIMIT=35] -->
-    <string-array name="transition_animation_scale_entries">
-        <item>Animation off</item>
-        <item>Animation scale .5x</item>
-        <item>Animation scale 1x</item>
-        <item>Animation scale 1.5x</item>
-        <item>Animation scale 2x</item>
-        <item>Animation scale 5x</item>
-        <item>Animation scale 10x</item>
-    </string-array>
-
-    <!-- Values for transition animation scale preference. -->
-    <string-array name="transition_animation_scale_values" translatable="false" >
-        <item>0</item>
-        <item>.5</item>
-        <item>1</item>
-        <item>1.5</item>
-        <item>2</item>
-        <item>5</item>
-        <item>10</item>
-    </string-array>
-
-    <!-- Titles for animator duration scale preference. [CHAR LIMIT=35] -->
-    <string-array name="animator_duration_scale_entries">
-        <item>Animation off</item>
-        <item>Animation scale .5x</item>
-        <item>Animation scale 1x</item>
-        <item>Animation scale 1.5x</item>
-        <item>Animation scale 2x</item>
-        <item>Animation scale 5x</item>
-        <item>Animation scale 10x</item>
-    </string-array>
-
-    <!-- Values for animator duration scale preference. -->
-    <string-array name="animator_duration_scale_values" translatable="false" >
-        <item>0</item>
-        <item>.5</item>
-        <item>1</item>
-        <item>1.5</item>
-        <item>2</item>
-        <item>5</item>
-        <item>10</item>
-    </string-array>
-
-    <!-- Titles for overlay display devices preference. [CHAR LIMIT=35] -->
-    <string-array name="overlay_display_devices_entries">
-        <item>None</item>
-        <item>480p</item>
-        <item>480p (secure)</item>
-        <item>720p</item>
-        <item>720p (secure)</item>
-        <item>1080p</item>
-        <item>1080p (secure)</item>
-        <item>4K</item>
-        <item>4K (secure)</item>
-        <item>4K (upscaled)</item>
-        <item>4K (upscaled, secure)</item>
-        <item>720p, 1080p (dual screen)</item>
-    </string-array>
-
-    <!-- Values for overlay display devices preference. -->
-    <string-array name="overlay_display_devices_values" translatable="false" >
-        <item></item>
-        <item>720x480/142</item>
-        <item>720x480/142,secure</item>
-        <item>1280x720/213</item>
-        <item>1280x720/213,secure</item>
-        <item>1920x1080/320</item>
-        <item>1920x1080/320,secure</item>
-        <item>3840x2160/320</item>
-        <item>3840x2160/320,secure</item>
-        <item>1920x1080/320|3840x2160/640</item>
-        <item>1920x1080/320|3840x2160/640,secure</item>
-        <item>1280x720/213;1920x1080/320</item>
-    </string-array>
-
-    <!-- Titles for OpenGL traces preference. [CHAR LIMIT=35] -->
-    <string-array name="enable_opengl_traces_entries">
-        <item>None</item>
-        <item>Logcat</item>
-        <item>Systrace (Graphics)</item>
-        <item>Call stack on glGetError</item>
-    </string-array>
-
-    <!-- Values for OpenGL traces preference. -->
-    <string-array name="enable_opengl_traces_values" translatable="false" >
-        <item>0</item>
-        <item>1</item>
-        <item>systrace</item>
-        <item>error</item>
-    </string-array>
-
-    <!-- Titles for non-rectangular clipping preference. [CHAR LIMIT=35] -->
-    <string-array name="show_non_rect_clip_entries">
-        <item>Off</item>
-        <item>Draw non-rectangular clip region in blue</item>
-        <item>Highlight tested drawing commands in green</item>
-    </string-array>
-
-    <!-- Values for non-rectangular clipping preference. -->
-    <string-array name="show_non_rect_clip_values" translatable="false" >
-        <item>hide</item>
-        <item>region</item>
-        <item>highlight</item>
-    </string-array>
-
-    <!-- Titles for frame time tracking preference. [CHAR LIMIT=35] -->
-    <string-array name="track_frame_time_entries">
-        <item>Off</item>
-        <item>On screen as bars</item>
-        <item>In adb shell dumpsys gfxinfo</item>
-    </string-array>
-
-    <!-- Values for frame time tracking preference. -->
-    <string-array name="track_frame_time_values" translatable="false" >
-        <item>false</item>
-        <item>visual_bars</item>
-        <item>true</item>
-    </string-array>
-
-    <!-- Titles for debug overdraw preference. [CHAR LIMIT=50] -->
-    <string-array name="debug_hw_overdraw_entries">
-        <item>Off</item>
-        <item>Show overdraw areas</item>
-        <item>Show areas for Deuteranomaly</item>
-    </string-array>
-
-    <!-- Values for debug overdraw preference. -->
-    <string-array name="debug_hw_overdraw_values" translatable="false" >
-        <item>false</item>
-        <item>show</item>
-        <item>show_deuteranomaly</item>
-    </string-array>
-
-    <!-- Titles for app process limit preference. [CHAR LIMIT=35] -->
-    <string-array name="app_process_limit_entries">
-        <item>Standard limit</item>
-        <item>No background processes</item>
-        <item>At most 1 process</item>
-        <item>At most 2 processes</item>
-        <item>At most 3 processes</item>
-        <item>At most 4 processes</item>
-    </string-array>
-
-    <!-- Values for app process limit preference. -->
-    <string-array name="app_process_limit_values" translatable="false" >
-        <item>-1</item>
-        <item>0</item>
-        <item>1</item>
-        <item>2</item>
-        <item>3</item>
-        <item>4</item>
-    </string-array>
-
     <!-- Match this with the constants in VpnProfile. --> <skip />
     <!-- Short names for each VPN type, not really translatable. [CHAR LIMIT=20] -->
     <string-array name="vpn_types" translatable="false">
@@ -1213,24 +1010,6 @@
         <item>13</item>
     </string-array>
 
-    <!-- Display color space adjustment modes for developers -->
-    <string-array name="simulate_color_space_entries" translatable="false">
-        <item>@string/daltonizer_mode_disabled</item>
-        <item>@string/daltonizer_mode_monochromacy</item>
-        <item>@string/daltonizer_mode_deuteranomaly</item>
-        <item>@string/daltonizer_mode_protanomaly</item>
-        <item>@string/daltonizer_mode_tritanomaly</item>
-    </string-array>
-
-    <!-- Values for display color space adjustment modes for developers -->
-    <string-array name="simulate_color_space_values" translatable="false">
-        <item>-1</item>
-        <item>0</item>
-        <item>2</item>
-        <item>1</item>
-        <item>3</item>
-    </string-array>
-
     <!-- Battery saver mode: allowable trigger threshold levels. -->
     <integer-array name="battery_saver_trigger_values" translatable="false" >
         <item>0</item>
@@ -1274,56 +1053,4 @@
         <item>Red</item>
     </string-array>
 
-    <!-- USB configuration names for Developer Settings.
-         This can be overridden by devices with additional USB configurations. -->
-    <string-array name="usb_configuration_titles">
-        <item>@string/usb_use_charging_only</item>
-        <item>MTP (Media Transfer Protocol)</item>
-        <item>PTP (Picture Transfer Protocol)</item>
-        <item>RNDIS (USB Ethernet)</item>
-        <item>Audio Source</item>
-        <item>MIDI</item>
-    </string-array>
-
-    <!-- USB configuration values for Developer Settings.
-         These are lists of USB functions passed to the USB Manager to change USB configuraton.
-         This can be overridden by devices with additional USB configurations.
-         Do not translate. -->
-    <string-array name="usb_configuration_values" translatable="false">
-        <!-- Do not translate. -->
-        <item>none</item>
-        <!-- Do not translate. -->
-        <item>mtp</item>
-        <!-- Do not translate. -->
-        <item>ptp</item>
-        <!-- Do not translate. -->
-        <item>rndis</item>
-        <!-- Do not translate. -->
-        <item>audio_source</item>
-        <!-- Do not translate. -->
-        <item>midi</item>
-    </string-array>
-
-    <!-- Possible values for user theme in Display Settings.
-         Do not translate. -->
-    <string-array name="night_mode_entries" translatable="false">
-        <!-- Do not translate. -->
-        <item>@string/night_mode_no</item>
-        <!-- Do not translate. -->
-        <item>@string/night_mode_yes</item>
-        <!-- Do not translate. -->
-        <item>@string/night_mode_auto</item>
-    </string-array>
-
-    <!-- These values should match up with the MODE_NIGHT constants in UiModeManager.
-         Do not translate. -->
-    <string-array name="night_mode_values" translatable="false">
-        <!-- Do not translate. -->
-        <item>1</item>
-        <!-- Do not translate. -->
-        <item>2</item>
-        <!-- Do not translate. -->
-        <item>0</item>
-    </string-array>
-
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8928307..c043607 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -403,7 +403,7 @@
     <string name="radio_info_data_attempts_label">Data attempts:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
 
-    <string name="radio_info_gprs_service_label">GPRS service:</string>
+    <string name="radio_info_gprs_service_label">Data Technology:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_roaming_label">Roaming:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
@@ -421,7 +421,7 @@
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_ppp_received_label">PPP received:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
-    <string name="radio_info_gsm_service_label">GSM service:</string>
+    <string name="radio_info_gsm_service_label">Voice Technology:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_signal_strength_label">Signal strength:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
@@ -441,9 +441,9 @@
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_set_perferred_label">Set preferred network type:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
-    <string name="radio_info_ping_ipaddr">Ping IpAddr:</string>
+    <string name="radio_info_ping_hostname_v4">Ping Hostname(www.google.com) IPv4:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
-    <string name="radio_info_ping_hostname">Ping Hostname(www.google.com):</string>
+    <string name="radio_info_ping_hostname_v6">Ping Hostname(www.google.com) IPv6:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_http_client_test">HTTP Client test:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
@@ -1486,6 +1486,8 @@
     <string name="wifi_menu_scan">Scan</string>
     <!-- Menu option to Wi-Fi advanced settings -->
     <string name="wifi_menu_advanced">Advanced</string>
+    <!-- Menu option to Wi-Fi configure settings -->
+    <string name="wifi_menu_configure">Configure</string>
     <!-- Menu option to connect to a Wi-Fi network -->
     <string name="wifi_menu_connect">Connect to network</string>
     <!-- Menu option to remember a temporary Wi-Fi network -->
@@ -1656,6 +1658,8 @@
     <string name="wifi_saved_access_points_titlebar">Saved networks</string>
     <!-- Wi-Fi settings screen, advanced, settings section.  This is a header shown above advanced wifi settings. [CHAR LIMIT=30] -->
     <string name="wifi_advanced_titlebar">Advanced Wi\u2011Fi</string>
+    <!-- Wi-Fi settings screen, configure, settings section.  This is a header shown above configure wifi settings. [CHAR LIMIT=30] -->
+    <string name="wifi_configure_titlebar">Configure Wi\u2011Fi</string>
     <!-- Wi-Fi settings screen, setting title for setting the band [CHAR LIMIT=50]-->
     <string name="wifi_setting_frequency_band_title">Wi\u2011Fi frequency band</string>
     <!-- Wi-Fi settings screen, setting summary for setting the wifi frequency band [CHAR LIMIT=50]-->
@@ -1998,33 +2002,6 @@
     <string name="auto_brightness_title">Adaptive brightness</string>
     <!-- Sound & display settings screen, setting option summary to enable adaptive brightness [CHAR LIMIT=100] -->
     <string name="auto_brightness_summary">Optimize brightness level for available light</string>
-    <!-- Sound & display settings screen, setting option name to change the user interface theme [CHAR LIMIT=30] -->
-    <string name="night_mode_title">Night mode</string>
-    <!-- Sound & display settings screen, setting option summary to change the user interface theme [CHAR LIMIT=100] -->
-    <string name="night_mode_summary">%s</string>
-    <!-- Sound & display settings screen, theme setting value to prefer a light-colored user interface [CHAR LIMIT=30] -->
-    <string name="night_mode_no">Disabled</string>
-    <!-- Sound & display settings screen, theme setting value to prefer a dark-colored user interface [CHAR LIMIT=30] -->
-    <string name="night_mode_yes">Always on</string>
-    <!-- Sound & display settings screen, theme setting value to automatically switch between a light- or dark-colored user interface [CHAR LIMIT=30] -->
-    <string name="night_mode_auto">Automatic</string>
-
-    <!-- Developer settings screen, convert userdata to file encryption option name -->
-    <string name="convert_to_file_encryption">Convert to file encryption</string>
-    <!-- Developer settings screen, convert userdata to file encryption summary when option is available -->
-    <string name="convert_to_file_encryption_enabled">Convert\u2026</string>
-    <!-- Developer settings screen, convert userdata to file encryption summary when option is already done -->
-    <string name="convert_to_file_encryption_done">Already file encrypted</string>
-    <!-- Title used on dialog with final prompt for converting to file encryption -->
-    <string name="title_convert_fbe">Converting to file based encryption</string>
-    <!-- Warning displayed on dialog with final prompt for converting to file encryption -->
-    <string name="convert_to_fbe_warning">
-      Convert data partition to file based encryption.\n
-      !!Warning!! This will erase all your data.\n
-      This feature is alpha, and may not work correctly.\n
-      Press \'Wipe and convert\u2026\' to continue.</string>
-    <!-- Button on dialog that triggers convertion to file encryption -->
-    <string name="button_convert_fbe">Wipe and convert\u2026</string>
 
     <!-- Sound & display settings screen, setting option name to change screen timeout -->
     <string name="screen_timeout">Sleep</string>
@@ -2806,8 +2783,6 @@
 
     <!-- Security & location settings screen, section header for settings relating to location -->
     <string name="location_title">My Location</string>
-    <!-- Title for managed profile preference category [CHAR_LIMIT=25] -->
-    <string name="managed_profile_location_category">Work profile</string>
     <!-- [CHAR LIMIT=30] Title for managed profile location switch  -->
     <string name="managed_profile_location_switch_title">Location for work profile</string>
     <!-- [CHAR LIMIT=30] Text to show on managed profile location switch if MDM has locked down location access for managed profile-->
@@ -3325,10 +3300,6 @@
     <!-- Services settings screen, setting option summary for the user to go to the screen to app storage use -->
     <string name="storageuse_settings_summary">View storage used by apps</string>
 
-    <!-- Services settings screen, setting option name for the user to go to the screen to view running services -->
-    <string name="runningservices_settings_title">Running services</string>
-    <!-- Services settings screen, setting option summary for the user to go to the screen to view running services  -->
-    <string name="runningservices_settings_summary">View and control currently running services</string>
     <!-- Label for a service item when it is restarting -->
     <string name="service_restarting">Restarting</string>
     <!-- Label for a process item representing a background process -->
@@ -3591,140 +3562,6 @@
     <!-- Summary for built-in keyboard settings -->
     <string name="builtin_keyboard_settings_summary">Physical keyboard settings</string>
 
-    <!-- Development Settings.  the title for the item to take the user to Development settings.  Development settings are settings meant for application developers.  -->
-    <string name="development_settings_title">Developer options</string>
-    <!-- Development Settings summary.  The summary of the item to take the user to Development settings.  Development settings are settings meant for application developers. -->
-    <string name="development_settings_summary">Set options for app development</string>
-    <!-- Setting checkbox title for Whether to enable USB debugging support on the phone. -->
-    <!-- Error message for users that aren't allowed to modify developer options [CHAR LIMIT=none] -->
-    <string name="development_settings_not_available">Developer options are not available for this user</string>
-    <!-- Error message for users that aren't allowed to modify VPN settings [CHAR LIMIT=none] -->
-    <string name="vpn_settings_not_available">VPN settings are not available for this user</string>
-    <!-- Error message for users that aren't allowed to modify Tethering settings [CHAR LIMIT=none] -->
-    <string name="tethering_settings_not_available">Tethering settings are not available for this user</string>
-    <!-- Error message for users that aren't allowed to modify Access Point Names settings [CHAR LIMIT=none] -->
-    <string name="apn_settings_not_available">Access Point Name settings are not available for this user</string>
-    <string name="enable_adb">USB debugging</string>
-    <!-- Setting checkbox summary for Whether to enable USB debugging support on the phone -->
-    <string name="enable_adb_summary">Debug mode when USB is connected</string>
-    <!-- Setting title to revoke secure USB debugging authorizations -->
-    <string name="clear_adb_keys">Revoke USB debugging authorizations</string>
-    <!-- [CHAR LIMIT=NONE] Setting checkbox title for Whether to include bug report item in power menu. -->
-    <string name="bugreport_in_power">Bug report shortcut</string>
-    <!-- [CHAR LIMIT=NONE] Setting checkbox summary for Whether to include bug report item in power -->
-    <string name="bugreport_in_power_summary">Show a button in the power menu for taking a bug report</string>
-    <!-- Setting Checkbox title whether to keep the screen on when plugged in to a power source -->
-    <string name="keep_screen_on">Stay awake</string>
-    <!-- setting Checkbox summary whether to keep the screen on when plugged in  -->
-    <string name="keep_screen_on_summary">Screen will never sleep while charging</string>
-    <!-- Setting Checkbox title whether to enable bluetooth HCI snoop log -->
-    <string name="bt_hci_snoop_log">Enable Bluetooth HCI snoop log</string>
-    <!-- setting Checkbox summary whether to capture all bluetooth HCI packets in a file -->
-    <string name="bt_hci_snoop_log_summary">Capture all bluetooth HCI packets in a file</string>
-    <!-- setting Checkbox title whether to enable OEM unlock [CHAR_LIMIT=35] -->
-    <string name="oem_unlock_enable">OEM unlocking</string>
-    <!-- setting Checkbox summary whether to enable OEM unlock [CHAR_LIMIT=50] -->
-    <string name="oem_unlock_enable_summary">Allow the bootloader to be unlocked</string>
-    <!-- Confirmation dialog title to ensure user wishes to enable OEM unlock and disable theft protection features -->
-    <string name="confirm_enable_oem_unlock_title">Allow OEM unlocking?</string>
-    <!-- Warning dialog message to confirm user wishes to enable OEM unlock and disable theft protection features -->
-    <string name="confirm_enable_oem_unlock_text">WARNING: Device protection features will not work on this device while this setting is turned on.</string>
-
-    <!-- UI debug setting: limit size of Android logger buffers -->
-    <string name="select_logd_size_title">Logger buffer sizes</string>
-    <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
-    <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
-
-    <!-- UI debug setting: select current app to mock location [CHAR LIMIT=50] -->
-    <string name="mock_location_app">Select mock location app</string>
-    <!-- UI debug setting: no mock location app has been set [CHAR LIMIT=50] -->
-    <string name="mock_location_app_not_set">No mock location app set</string>
-    <!-- UI debug setting: mock location app has been set [CHAR LIMIT=50] -->
-    <string name="mock_location_app_set">Mock location app: <xliff:g id="app_name">%1$s</xliff:g></string>
-
-    <!-- Setting Checkbox title whether to enable view attribute inspection -->
-    <string name="debug_view_attributes">Enable view attribute inspection</string>
-    <!-- Title of warning dialog about the implications of enabling USB debugging -->
-
-    <!-- Preference category for networking debugging development settings. [CHAR LIMIT=50] -->
-    <string name="debug_networking_category">Networking</string>
-
-    <!-- Setting Checkbox title whether to show options for wireless display certification -->
-    <string name="wifi_display_certification">Wireless display certification</string>
-    <!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
-    <string name="wifi_verbose_logging">Enable Wi\u2011Fi Verbose Logging</string>
-    <!-- Setting Checkbox title whether to enable WiFi Aggressive Handover. [CHAR LIMIT=40] -->
-    <string name="wifi_aggressive_handover">Aggressive Wi\u2011Fi to Cellular handover</string>
-    <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
-    <string name="wifi_allow_scan_with_traffic">Always allow Wi\u2011Fi Roam Scans</string>
-    <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
-    <string name="legacy_dhcp_client">Use legacy DHCP client</string>
-    <!-- Setting Checkbox title whether to always keep cellular data active. [CHAR LIMIT=80] -->
-    <string name="mobile_data_always_on">Cellular data always active</string>
-
-    <!-- setting Checkbox summary whether to show options for wireless display certification  -->
-    <string name="wifi_display_certification_summary">Show options for wireless display certification</string>
-    <!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR LIMIT=80] -->
-    <string name="wifi_verbose_logging_summary">Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker</string>
-    <!-- Setting Checkbox summary whether to enable Wifi aggressive handover [CHAR LIMIT=130] -->
-    <string name="wifi_aggressive_handover_summary">When enabled, Wi\u2011Fi will be more aggressive in handing over the data connection to Cellular, when Wi\u2011Fi signal is low</string>
-    <!-- Setting Checkbox summary whether to always allow WiFi Roam Scans [CHAR LIMIT=130] -->
-    <string name="wifi_allow_scan_with_traffic_summary">Allow/Disallow Wi\u2011Fi Roam Scans based on the amount of data traffic present at the interface</string>
-    <!-- UI debug setting: limit size of Android logger buffers -->
-    <string name="select_logd_size_title">Logger buffer sizes</string>
-    <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
-    <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
-    <!-- UI debug setting: select USB configuration -->
-    <string name="select_usb_configuration_title">Select USB Configuration</string>
-    <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
-    <string name="select_usb_configuration_dialog_title">Select USB Configuration</string>
-    <!-- Setting Checkbox title whether to allow mock locations -->
-    <string name="allow_mock_location">Allow mock locations</string>
-    <!-- setting Checkbox summary whether to allow mock locations  -->
-    <string name="allow_mock_location_summary">Allow mock locations</string>
-    <!-- Setting Checkbox title whether to enable view attribute inspection -->
-    <string name="debug_view_attributes">Enable view attribute inspection</string>
-    <!-- Title of warning dialog about the implications of enabling USB debugging -->
-    <!-- Setting Checkbox summary whether to use DHCP client from Lollipop (Android 5.0) [CHAR LIMIT=130] -->
-    <string name="legacy_dhcp_client_summary">Use the DHCP client from Lollipop instead of the new Android DHCP client.</string>
-    <string name="mobile_data_always_on_summary">Always keep mobile data active, even when Wi\u2011Fi is active (for fast network switching).</string>
-    <string name="adb_warning_title">Allow USB debugging?</string>
-    <!-- Warning text to user about the implications of enabling USB debugging -->
-    <string name="adb_warning_message">USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data.</string>
-    <!-- Message of dialog confirming that user wants to revoke access to adb from all computers they have authorized -->
-    <string name="adb_keys_warning_message">Revoke access to USB debugging from all computers you\u2019ve previously authorized?</string>
-    <!-- Title of warning dialog about the implications of enabling developer settings -->
-    <string name="dev_settings_warning_title">Allow development settings?</string>
-    <!-- Warning text to user about the implications of enabling USB debugging -->
-    <string name="dev_settings_warning_message">These settings are intended for development use only.  They can cause your device and the applications on it to break or misbehave.</string>
-    <!-- Title of checkbox setting to perform package verification on apps installed over USB/ADT/ADB [CHAR LIMIT=32] -->
-    <string name="verify_apps_over_usb_title">Verify apps over USB</string>
-    <!-- Summary of checkbox setting to perform package verification on apps installed over USB/ADT/ADB [CHAR LIMIT=NONE] -->
-    <string name="verify_apps_over_usb_summary">Check apps installed via ADB/ADT for harmful behavior.</string>
-
-    <!-- Title of checkbox setting that protects external storage. [CHAR LIMIT=32] -->
-    <string name="enforce_read_external_title" product="nosdcard">Protect USB storage</string>
-    <!-- Summary of checkbox setting that protects external storage. [CHAR LIMIT=64] -->
-    <string name="enforce_read_external_summary" product="nosdcard">Apps must request permission to read USB storage</string>
-    <!-- Title of dialog confirming that user wants to protect external storage. [CHAR LIMIT=32] -->
-    <string name="enforce_read_external_confirm_title" product="nosdcard">Protect USB storage?</string>
-    <!-- Message of dialog confirming that user wants to protect external storage. [CHAR LIMIT=NONE] -->
-    <string name="enforce_read_external_confirm_message" product="nosdcard">When USB storage is protected, apps must request permission to read data from external storage.\n\nSome apps may not work until updated by their developers.</string>
-
-    <!-- Title of checkbox setting that protects external storage. [CHAR LIMIT=32] -->
-    <string name="enforce_read_external_title" product="default">Protect SD card</string>
-    <!-- Summary of checkbox setting that protects external storage. [CHAR LIMIT=64] -->
-    <string name="enforce_read_external_summary" product="default">Apps must request permission to read SD card</string>
-    <!-- Title of dialog confirming that user wants to protect external storage. [CHAR LIMIT=32] -->
-    <string name="enforce_read_external_confirm_title" product="default">Protect SD card?</string>
-    <!-- Message of dialog confirming that user wants to protect external storage. [CHAR LIMIT=NONE] -->
-    <string name="enforce_read_external_confirm_message" product="default">When SD card is protected, apps must request permission to read data from external storage.\n\nSome apps may not work until updated by their developers.</string>
-
-    <!-- Title of checkbox setting that enables the terminal app. [CHAR LIMIT=32] -->
-    <string name="enable_terminal_title">Local terminal</string>
-    <!-- Summary of checkbox setting that enables the terminal app. [CHAR LIMIT=64] -->
-    <string name="enable_terminal_summary">Enable terminal app that offers local shell access</string>
-
     <!-- Title for the screen that lets the user choose a gadget to add to the home screen
          (or other screens that can host gadgets).  Note to translators: we're still determining
          the final name for Gadgets/Widgets, so please translate both for now. -->
@@ -3828,10 +3665,6 @@
     <string name="accessibility_display_inversion_preference_title">Color inversion</string>
     <!-- Subtitle for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
     <string name="accessibility_display_inversion_preference_subtitle">(Experimental) May affect performance</string>
-    <!-- Title for the accessibility preference to configure display color space correction. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_display_daltonizer_preference_title">Color correction</string>
-    <!-- Subtitle for the accessibility preference to configure display color space correction. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_display_daltonizer_preference_subtitle">This feature is experimental and may affect performance.</string>
     <!-- Title for accessibility preference for configuring feature that performs click action soon after mouse/trackpad pointer stops moving. [CHAR LIMIT=NONE] -->
     <string name="accessibility_autoclick_preference_title">Click after pointer stops moving</string>
     <!-- Title for accessibility preference for configuring amount of time that has to pass after pointer stops moving before click action can be performed (if automatic click after pointer stops moving feature is enabled). [CHAR LIMIT=NONE] -->
@@ -3841,19 +3674,6 @@
     <string name="enable_quick_setting">Show in Quick Settings</string>
     <!-- Title for the preference to configure the type of color space correction to apply. [CHAR LIMIT=NONE] -->
     <string name="daltonizer_type">Correction mode</string>
-    <!-- Summary shown for color space correction preference when its value is overridden by another preference [CHAR LIMIT=35] -->
-    <string name="daltonizer_type_overridden">Overridden by <xliff:g id="title" example="Simulate color space">%1$s</xliff:g></string>
-
-    <!-- Label for disabling color space adjustment [CHAR LIMIT=45] -->
-    <string name="daltonizer_mode_disabled">Disabled</string>
-    <!-- Label for converting display colors to grayscale, which simulates monochromacy (complete color blindness). [CHAR LIMIT=45] -->
-    <string name="daltonizer_mode_monochromacy">Monochromacy</string>
-    <!-- Label for deuteranomaly (red-green color blindness) [CHAR LIMIT=45] -->
-    <string name="daltonizer_mode_deuteranomaly">Deuteranomaly (red-green)</string>
-    <!-- Label for protanomaly (red-green color blindness) [CHAR LIMIT=45] -->
-    <string name="daltonizer_mode_protanomaly">Protanomaly (red-green)</string>
-    <!-- Label for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
-    <string name="daltonizer_mode_tritanomaly">Tritanomaly (blue-yellow)</string>
 
     <!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
     <plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay">
@@ -4593,20 +4413,6 @@
     <!-- Default summary text of the "Configure backup account" setting [CHAR LIMIT=80]-->
     <string name="backup_configure_account_default_summary">No account is currently storing backed up data</string>
 
-    <!-- Local (desktop) backup password menu title [CHAR LIMIT=25] -->
-    <string name="local_backup_password_title">Desktop backup password</string>
-    <!-- Summary text of the "local backup password" setting when the user has not supplied a password -->
-    <string name="local_backup_password_summary_none">Desktop full backups aren\u2019t currently protected</string>
-    <!-- Summary text of the "local backup password" setting when the user has already supplied a password -->
-    <string name="local_backup_password_summary_change">Touch to change or remove the password for desktop full backups</string>
-
-    <!-- Toast message shown when the user successfully sets a new local backup password [CHAR LIMIT=80] -->
-    <string name="local_backup_password_toast_success">New backup password set</string>
-    <!-- Toast message shown when setting a new local backup password fails due to the user not correctly typing the password again for confirmation [CHAR LIMIT=80] -->
-    <string name="local_backup_password_toast_confirmation_mismatch">New password and confirmation don\u2019t match</string>
-    <!-- Toast message shown when setting a new local backup password fails due to the user not supplying the correct existing password. The phrasing here is deliberately quite general. [CHAR LIMIT=80] -->
-    <string name="local_backup_password_toast_validation_failure">Failure setting backup password</string>
-
     <!-- Dialog title for confirmation to erase backup data from server -->
     <string name="backup_erase_dialog_title"></string>
     <!-- Dialog title for confirmation to erase backup data from server -->
@@ -4905,168 +4711,6 @@
     <!--  action to select all [CHAR LIMIT=30] -->
     <string name="select_all">Select all</string>
 
-    <!-- HDCP checking title, used for debug purposes only. [CHAR LIMIT=25] -->
-    <string name="hdcp_checking_title">HDCP checking</string>
-    <!-- HDCP checking dialog title, used for debug purposes only. [CHAR LIMIT=25] -->
-    <string name="hdcp_checking_dialog_title">Set HDCP checking behavior</string>
-
-    <!-- Preference category for app debugging development settings. [CHAR LIMIT=50] -->
-    <string name="debug_debugging_category">Debugging</string>
-
-    <!-- UI debug setting: select current app to debug [CHAR LIMIT=50] -->
-    <string name="debug_app">Select debug app</string>
-    <!-- UI debug setting: no debug app has been set [CHAR LIMIT=50] -->
-    <string name="debug_app_not_set">No debug application set</string>
-    <!-- UI debug setting: debug app has been set [CHAR LIMIT=50] -->
-    <string name="debug_app_set">Debugging application: <xliff:g id="app_name">%1$s</xliff:g></string>
-
-    <!-- UI debug setting: title for app picker dialog [CHAR LIMIT=50] -->
-    <string name="select_application">Select application</string>
-    <!-- UI debug setting: label for app picker to select no applicatiojn [CHAR LIMIT=50] -->
-    <string name="no_application">Nothing</string>
-
-    <!-- UI debug setting: wait for debugger to attach to debugging process? [CHAR LIMIT=50] -->
-    <string name="wait_for_debugger">Wait for debugger</string>
-    <!-- UI debug setting: wait for debugger to attach to debugging process summary [CHAR LIMIT=500] -->
-    <string name="wait_for_debugger_summary">Debugged application waits for debugger to
-            attach before executing</string>
-
-    <!-- Preference category for input debugging development settings. [CHAR LIMIT=25] -->
-    <string name="debug_input_category">Input</string>
-
-    <!-- Preference category for drawing debugging development settings. [CHAR LIMIT=25] -->
-    <string name="debug_drawing_category">Drawing</string>
-
-    <!-- Preference category for hardware accelerated drawing debugging development settings. [CHAR LIMIT=50] -->
-    <string name="debug_hw_drawing_category">Hardware accelerated rendering</string>
-
-    <!-- Preference category for media development settings. [CHAR LIMIT=50] -->
-    <string name="media_category">Media</string>
-
-    <!-- Preference category for monitoring debugging development settings. [CHAR LIMIT=25] -->
-    <string name="debug_monitoring_category">Monitoring</string>
-
-    <!-- UI debug setting: always enable strict mode? [CHAR LIMIT=25] -->
-    <string name="strict_mode">Strict mode enabled</string>
-    <!-- UI debug setting: show strict mode summary [CHAR LIMIT=50] -->
-    <string name="strict_mode_summary">Flash screen when apps do long operations
-            on main thread</string>
-
-    <!-- UI debug setting: show pointer location? [CHAR LIMIT=25] -->
-    <string name="pointer_location">Pointer location</string>
-    <!-- UI debug setting: show pointer location summary [CHAR LIMIT=50] -->
-    <string name="pointer_location_summary">Screen overlay showing current touch data</string>
-
-    <!-- UI debug setting: show touches? [CHAR LIMIT=25] -->
-    <string name="show_touches">Show touches</string>
-    <!-- UI debug setting: show touches location summary [CHAR LIMIT=50] -->
-    <string name="show_touches_summary">Show visual feedback for touches</string>
-
-    <!-- UI debug setting: show where surface updates happen? [CHAR LIMIT=25] -->
-    <string name="show_screen_updates">Show surface updates</string>
-    <!-- UI debug setting: show surface updates summary [CHAR LIMIT=50] -->
-    <string name="show_screen_updates_summary">Flash entire window surfaces when they update</string>
-
-    <!-- UI debug setting: show where window updates happen with GPU rendering? [CHAR LIMIT=25] -->
-    <string name="show_hw_screen_updates">Show GPU view updates</string>
-    <!-- UI debug setting: show GPU rendering screen updates summary [CHAR LIMIT=50] -->
-    <string name="show_hw_screen_updates_summary">Flash views inside windows when drawn with the GPU</string>
-
-    <!-- UI debug setting: show when hardware layers get updated [CHAR LIMIT=25] -->
-    <string name="show_hw_layers_updates">Show hardware layers updates</string>
-    <!-- UI debug setting: show hardware layers updates summary [CHAR LIMIT=50] -->
-    <string name="show_hw_layers_updates_summary">Flash hardware layers green when they update</string>
-
-    <!-- UI debug setting: show the amount of overdraw in apps using the GPU [CHAR LIMIT=25] -->
-    <string name="debug_hw_overdraw">Debug GPU overdraw</string>
-
-    <!-- UI debug setting: disable use of overlays? [CHAR LIMIT=25] -->
-    <string name="disable_overlays">Disable HW overlays</string>
-    <!-- UI debug setting: disable use of overlays summary [CHAR LIMIT=50] -->
-    <string name="disable_overlays_summary">Always use GPU for screen compositing</string>
-
-    <!-- UI debug setting: simulate color space anomalies. [CHAR LIMIT=25] -->
-    <string name="simulate_color_space">Simulate color space</string>
-
-    <!-- UI debug setting: enable various types of OpenGL traces [CHAR LIMIT=25] -->
-    <string name="enable_opengl_traces_title">Enable OpenGL traces</string>
-
-    <!-- UI debug setting: disable USB audio routing title [CHAR LIMIT=32] -->
-    <string name="usb_audio_disable_routing">Disable USB audio routing</string>
-    <!-- UI debug setting: disable USB audio routing summary [CHAR LIMIT=50] -->
-    <string name="usb_audio_disable_routing_summary">Disable automatic routing to USB audio peripherals</string>
-
-    <!-- UI debug setting: show layout bounds information [CHAR LIMIT=25] -->
-    <string name="debug_layout">Show layout bounds</string>
-    <!-- UI debug setting: show layout bounds information summary [CHAR LIMIT=50] -->
-    <string name="debug_layout_summary">Show clip bounds, margins, etc.</string>
-
-    <!-- UI debug setting: force right to left layout [CHAR LIMIT=37] -->
-    <string name="force_rtl_layout_all_locales">Force RTL layout direction</string>
-    <!-- UI debug setting: force right to left layout summary [CHAR LIMIT=100] -->
-    <string name="force_rtl_layout_all_locales_summary">Force screen layout direction to RTL for all locales</string>
-
-    <!-- UI debug setting: show how CPU is being used? [CHAR LIMIT=25] -->
-    <string name="show_cpu_usage">Show CPU usage</string>
-    <!-- UI debug setting: show cpu usage summary [CHAR LIMIT=50] -->
-    <string name="show_cpu_usage_summary">Screen overlay showing current CPU usage</string>
-
-    <!-- UI debug setting: force hardware acceleration to render apps [CHAR LIMIT=25] -->
-    <string name="force_hw_ui">Force GPU rendering</string>
-    <!-- UI debug setting: force hardware acceleration summary [CHAR LIMIT=50] -->
-    <string name="force_hw_ui_summary">Force use of GPU for 2d drawing</string>
-
-    <!-- UI debug setting: force anti-aliasing to render apps [CHAR LIMIT=25] -->
-    <string name="force_msaa">Force 4x MSAA</string>
-    <!-- UI debug setting: force anti-aliasing summary [CHAR LIMIT=50] -->
-    <string name="force_msaa_summary">Enable 4x MSAA in OpenGL ES 2.0 apps</string>
-
-    <!-- UI debug setting: show when non-rectangular clip operations are used [CHAR LIMIT=100] -->
-    <string name="show_non_rect_clip">Debug non-rectangular clip operations</string>
-
-    <!-- UI debug setting: profile time taken by hardware acceleration to render apps [CHAR LIMIT=25] -->
-    <string name="track_frame_time">Profile GPU rendering</string>
-
-    <!-- UI debug setting: scaling factor for window animations [CHAR LIMIT=25] -->
-    <string name="window_animation_scale_title">Window animation scale</string>
-
-    <!-- UI debug setting: scaling factor for transition animations [CHAR LIMIT=25] -->
-    <string name="transition_animation_scale_title">Transition animation scale</string>
-
-    <!-- UI debug setting: scaling factor for all Animator-based animations [CHAR LIMIT=25] -->
-    <string name="animator_duration_scale_title">Animator duration scale</string>
-
-    <!-- UI debug setting: simulate secondary display devices using overlays [CHAR LIMIT=25] -->
-    <string name="overlay_display_devices_title">Simulate secondary displays</string>
-
-    <!-- Preference category for application debugging development settings. [CHAR LIMIT=25] -->
-    <string name="debug_applications_category">Apps</string>
-
-    <!-- UI debug setting: immediately destroy activities? [CHAR LIMIT=25] -->
-    <string name="immediately_destroy_activities">Don\u2019t keep activities</string>
-    <!-- UI debug setting: immediately destroy activities summary [CHAR LIMIT=50] -->
-    <string name="immediately_destroy_activities_summary">Destroy every activity as soon as
-            the user leaves it</string>
-
-    <!-- UI debug setting: limit number of running background processes [CHAR LIMIT=25] -->
-    <string name="app_process_limit_title">Background process limit</string>
-
-    <!-- UI debug setting: show all ANRs? [CHAR LIMIT=25] -->
-    <string name="show_all_anrs">Show all ANRs</string>
-    <!-- UI debug setting: show all ANRs summary [CHAR LIMIT=50] -->
-    <string name="show_all_anrs_summary">Show App Not Responding dialog
-        for background apps</string>
-
-    <!-- UI debug setting: force allow apps on external storage [CHAR LIMIT=50] -->
-    <string name="force_allow_on_external">Force allow apps on external</string>
-    <!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
-    <string name="force_allow_on_external_summary">Makes any app elligible to be written to external storage, regardless of manifest values</string>
-
-    <!-- UI debug setting: force all activites to be resizable for multiwindow [CHAR LIMIT=50] -->
-    <string name="force_resizable_activities">Force activities to be resizable</string>
-    <!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
-    <string name="force_resizable_activities_summary">Makes all activities resizable for multi-window, regardless of manifest values.</string>
-
     <!-- Activity title for network data usage summary. [CHAR LIMIT=25] -->
     <string name="data_usage_summary_title">Data usage</string>
     <!-- Activity title for Appk data usage summary. [CHAR LIMIT=25] -->
@@ -6124,6 +5768,9 @@
     <!-- [CHAR LIMIT=20] Notification settings: App notifications dialog dismiss button caption -->
     <string name="app_notifications_dialog_done">Done</string>
 
+    <!-- [CHAR LIMIT=150] App notification settings: App notifications Importance title -->
+    <string name="app_notification_importance_title">Importance</string>
+
     <!-- [CHAR LIMIT=40] Zen mode settings: Rule name option and edit dialog title -->
     <string name="zen_mode_rule_name">Rule name</string>
 
@@ -6778,12 +6425,11 @@
          usb_use_file_transfer, use_use_photo_transfer, and usb_use_MIDI -->
     <string name="usb_use">Use USB for</string>
 
-    <!-- Settings item title for inactive apps [CHAR LIMIT=35] -->
-    <string name="inactive_apps_title">Inactive apps</string>
-    <!-- Settings item summary for inactive app [CHAR LIMIT=100] -->
-    <string name="inactive_app_inactive_summary">Inactive. Touch to toggle.</string>
-    <!-- Settings item summary for active app [CHAR LIMIT=100] -->
-    <string name="inactive_app_active_summary">Active. Touch to toggle.</string>
+    <!-- Settings item title for background check prefs [CHAR LIMIT=35] -->
+    <string name="background_check_pref">Background check</string>
+
+    <!-- Settings screen title for background check prefs [CHAR LIMIT=35] -->
+    <string name="background_check_title">Full background access</string>
 
     <!-- Title for the "context" preference to determine whether assist can access the data currently displayed on-screen [CHAR LIMIT=40] -->
     <string name="assist_access_context_title">Use text from screen</string>
@@ -6965,26 +6611,6 @@
     <!-- Description of setting that controls gesture to open camera by double tapping the power button [CHAR LIMIT=NONE] -->
     <string name="camera_double_tap_power_gesture_desc">Quickly open camera without unlocking your screen</string>
 
-    <!-- Name of each color mode for the display. [CHAR LIMIT=40] -->
-    <string-array name="color_mode_names">
-        <item>Vibrant (default)</item>
-        <item>Natural</item>
-        <item>Standard</item>
-    </string-array>
-
-    <!-- Description of each color mode for the display. [CHAR LIMIT=NONE] -->
-    <string-array name="color_mode_descriptions">
-        <item>Enhanced colors</item>
-        <item>Natural colors as seen by the eye</item>
-        <item>Colors optimized for digital content</item>
-    </string-array>
-
-    <!-- Name of feature to change color setting for the display [CHAR LIMIT=60] -->
-    <string name="picture_color_mode">Picture color mode</string>
-
-    <!-- Description of feature to change color setting for the display [CHAR LIMIT=NONE] -->
-    <string name="picture_color_mode_desc">Use sRGB</string>
-
     <!-- Title of setting that controls display scale (e.g. density). [CHAR LIMIT=40] -->
     <string name="force_density_preference_title">Display scale</string>
     <!-- Keywords for setting that controls display scale (e.g. density). [CHAR LIMIT=NONE] -->
diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml
index 84c3cbf..d3c8852 100644
--- a/res/xml/development_prefs.xml
+++ b/res/xml/development_prefs.xml
@@ -340,6 +340,10 @@
             android:entries="@array/app_process_limit_entries"
             android:entryValues="@array/app_process_limit_values" />
 
+        <Preference
+                android:key="background_check"
+                android:title="@string/background_check_pref" />
+
         <SwitchPreference
             android:key="show_all_anrs"
             android:title="@string/show_all_anrs"
diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml
index 2cd86f5..4ccc14a 100644
--- a/res/xml/location_settings.xml
+++ b/res/xml/location_settings.xml
@@ -27,19 +27,13 @@
             android:summary="@string/location_mode_location_off_title" />
 
         <!-- This preference category gets removed if there is no managed profile -->
-        <PreferenceCategory
-            android:key="managed_profile_location_category"
-            android:title="@string/managed_profile_location_category">
-
-            <Preference
-                android:key="managed_profile_location_switch"
-                android:title="@string/managed_profile_location_switch_title"
-                android:summary="@string/managed_profile_location_switch_lockdown"
-                android:persistent="false"
-                android:enabled="false"
-                android:selectable="false" />
-
-        </PreferenceCategory>
+        <SwitchPreference
+            android:key="managed_profile_location_switch"
+            android:title="@string/managed_profile_location_switch_title"
+            android:summary="@string/managed_profile_location_switch_lockdown"
+            android:persistent="false"
+            android:enabled="false"
+            android:selectable="true" />
 
         <PreferenceCategory
             android:key="recent_location_requests"
diff --git a/res/xml/topic_notification_settings.xml b/res/xml/topic_notification_settings.xml
index 6826070..174c273 100644
--- a/res/xml/topic_notification_settings.xml
+++ b/res/xml/topic_notification_settings.xml
@@ -18,6 +18,13 @@
         android:title="@string/topic_notifications_title"
         android:key="topic_notification_settings">
 
+    <!-- Importance -->
+    <com.android.settings.notification.ImportanceSeekBarPreference
+            android:key="importance"
+            android:title="@string/app_notification_importance_title"
+            android:order="1"
+            android:persistent="false" />
+
     <!-- Bypass DND -->
     <SwitchPreference
             android:key="bypass_dnd"
diff --git a/res/xml/wifi_advanced_settings.xml b/res/xml/wifi_advanced_settings.xml
index ed6cfbd..8d9a6cd 100644
--- a/res/xml/wifi_advanced_settings.xml
+++ b/res/xml/wifi_advanced_settings.xml
@@ -17,35 +17,6 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
         android:title="@string/wifi_advanced_titlebar">
 
-    <!-- android:dependency="enable_wifi" -->
-    <SwitchPreference
-            android:key="notify_open_networks"
-            android:title="@string/wifi_notify_open_networks"
-            android:summary="@string/wifi_notify_open_networks_summary"
-            android:persistent="false" />
-
-    <ListPreference
-            android:key="sleep_policy"
-            android:title="@string/wifi_setting_sleep_policy_title"
-            android:persistent="false"
-            android:entries="@array/wifi_sleep_policy_entries"
-            android:entryValues="@array/wifi_sleep_policy_values" />
-
-    <com.android.settings.AppListSwitchPreference
-            android:key="wifi_assistant"
-            android:title="@string/wifi_automatically_connect_title"
-            android:summary="@string/wifi_automatically_connect_summary"
-            android:dialogTitle="@string/wifi_select_assistant_dialog_title"
-            android:persistent="false" />
-
-    <ListPreference
-            android:key="frequency_band"
-            android:title="@string/wifi_setting_frequency_band_title"
-            android:summary="@string/wifi_setting_frequency_band_summary"
-            android:persistent="false"
-            android:entries="@array/wifi_frequency_band_entries"
-            android:entryValues="@array/wifi_frequency_band_values" />
-
     <Preference
             android:key="install_credentials"
             android:title="@string/wifi_install_credentials"
@@ -66,14 +37,4 @@
             android:title="@string/wifi_menu_wps_pin"
             android:persistent="false" />
 
-    <Preference
-            android:key="mac_address"
-            android:title="@string/wifi_advanced_mac_address_title"
-            android:layout="@layout/wifi_advance_layout" />
-
-    <Preference
-            android:key="current_ip_address"
-            android:title="@string/wifi_advanced_ip_address_title"
-            android:layout="@layout/wifi_advance_layout" />
-
-</PreferenceScreen>   
+</PreferenceScreen>
diff --git a/res/xml/wifi_configure_settings.xml b/res/xml/wifi_configure_settings.xml
new file mode 100644
index 0000000..15e524a
--- /dev/null
+++ b/res/xml/wifi_configure_settings.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+        android:title="@string/wifi_configure_titlebar">
+
+    <Preference
+        android:key="saved_networks"
+        android:title="@string/wifi_saved_access_points_label"
+        android:fragment="com.android.settings.wifi.SavedAccessPointsWifiSettings" />
+
+    <!-- android:dependency="enable_wifi" -->
+    <SwitchPreference
+        android:key="notify_open_networks"
+        android:title="@string/wifi_notify_open_networks"
+        android:summary="@string/wifi_notify_open_networks_summary"
+        android:persistent="false" />
+
+    <ListPreference
+        android:key="sleep_policy"
+        android:title="@string/wifi_setting_sleep_policy_title"
+        android:persistent="false"
+        android:entries="@array/wifi_sleep_policy_entries"
+        android:entryValues="@array/wifi_sleep_policy_values" />
+
+    <com.android.settings.AppListSwitchPreference
+        android:key="wifi_assistant"
+        android:title="@string/wifi_automatically_connect_title"
+        android:summary="@string/wifi_automatically_connect_summary"
+        android:dialogTitle="@string/wifi_select_assistant_dialog_title"
+        android:persistent="false" />
+
+    <ListPreference
+        android:key="frequency_band"
+        android:title="@string/wifi_setting_frequency_band_title"
+        android:summary="@string/wifi_setting_frequency_band_summary"
+        android:persistent="false"
+        android:entries="@array/wifi_frequency_band_entries"
+        android:entryValues="@array/wifi_frequency_band_values" />
+
+    <Preference
+        android:key="mac_address"
+        android:title="@string/wifi_advanced_mac_address_title"
+        android:layout="@layout/wifi_advance_layout" />
+
+    <Preference
+        android:key="current_ip_address"
+        android:title="@string/wifi_advanced_ip_address_title"
+        android:layout="@layout/wifi_advance_layout" />
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 9bccbcf..950af3c 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -76,6 +76,7 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.MetricsLogger;
+import com.android.settings.applications.BackgroundCheckSummary;
 import com.android.settings.fuelgauge.InactiveApps;
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
@@ -170,6 +171,8 @@
             = "immediately_destroy_activities";
     private static final String APP_PROCESS_LIMIT_KEY = "app_process_limit";
 
+    private static final String BACKGROUND_CHECK_KEY = "background_check";
+
     private static final String SHOW_ALL_ANRS_KEY = "show_all_anrs";
 
     private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
@@ -1718,6 +1721,8 @@
             writeForceResizableOptions();
         } else if (INACTIVE_APPS_KEY.equals(preference.getKey())) {
             startInactiveAppsFragment();
+        } else if (BACKGROUND_CHECK_KEY.equals(preference.getKey())) {
+            startBackgroundCheckFragment();
         } else {
             return super.onPreferenceTreeClick(preference);
         }
@@ -1731,6 +1736,12 @@
                 null, R.string.inactive_apps_title, null, null, 0);
     }
 
+    private void startBackgroundCheckFragment() {
+        ((SettingsActivity) getActivity()).startPreferencePanel(
+                BackgroundCheckSummary.class.getName(),
+                null, R.string.background_check_title, null, null, 0);
+    }
+
     private boolean showKeyguardConfirmation(Resources resources, int requestCode) {
         return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(
                 requestCode, resources.getString(R.string.oem_unlock_enable));
diff --git a/src/com/android/settings/InstrumentedFragment.java b/src/com/android/settings/InstrumentedFragment.java
index 80e1131..44fd110 100644
--- a/src/com/android/settings/InstrumentedFragment.java
+++ b/src/com/android/settings/InstrumentedFragment.java
@@ -31,6 +31,7 @@
     public static final int ACCESSIBILITY_TOGGLE_AUTOCLICK = UNDECLARED + 1;
     public static final int SOUND = UNDECLARED + 2;
     public static final int CONFIGURE_NOTIFICATION = UNDECLARED + 3;
+    public static final int CONFIGURE_WIFI = UNDECLARED + 4;
 
     /**
      * Declare the view of this category.
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 2f10bb5..7ed70c7 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -22,6 +22,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
+import android.graphics.Typeface;
 import android.net.TrafficStats;
 import android.net.Uri;
 import android.os.AsyncResult;
@@ -30,11 +31,24 @@
 import android.os.Message;
 import android.os.SystemProperties;
 import android.telephony.CellInfo;
+import android.telephony.CellInfoCdma;
+import android.telephony.CellInfoGsm;
+import android.telephony.CellInfoLte;
+import android.telephony.CellInfoWcdma;
+import android.telephony.CellIdentityCdma;
+import android.telephony.CellIdentityGsm;
+import android.telephony.CellIdentityLte;
+import android.telephony.CellIdentityWcdma;
 import android.telephony.CellLocation;
+import android.telephony.CellSignalStrengthCdma;
+import android.telephony.CellSignalStrengthGsm;
+import android.telephony.CellSignalStrengthLte;
+import android.telephony.CellSignalStrengthWcdma;
 import android.telephony.DataConnectionRealTimeInfo;
 import android.telephony.NeighboringCellInfo;
 import android.telephony.PhoneStateListener;
 import android.telephony.ServiceState;
+import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.telephony.cdma.CdmaCellLocation;
 import android.telephony.gsm.GsmCellLocation;
@@ -57,6 +71,7 @@
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.PhoneFactory;
 import com.android.internal.telephony.PhoneStateIntentReceiver;
+import com.android.internal.telephony.RILConstants;
 import com.android.internal.telephony.TelephonyProperties;
 
 import java.io.IOException;
@@ -76,7 +91,6 @@
 
     private static final int EVENT_QUERY_PREFERRED_TYPE_DONE = 1000;
     private static final int EVENT_SET_PREFERRED_TYPE_DONE = 1001;
-    private static final int EVENT_QUERY_NEIGHBORING_CIDS_DONE = 1002;
     private static final int EVENT_QUERY_SMSC_DONE = 1005;
     private static final int EVENT_UPDATE_SMSC_DONE = 1006;
 
@@ -112,8 +126,8 @@
     private TextView sentSinceReceived;
     private TextView sent;
     private TextView received;
-    private TextView mPingIpAddr;
-    private TextView mPingHostname;
+    private TextView mPingHostnameV4;
+    private TextView mPingHostnameV6;
     private TextView mHttpClientTest;
     private TextView dnsCheckState;
     private EditText smsc;
@@ -127,15 +141,21 @@
     private Spinner preferredNetworkType;
 
     private TelephonyManager mTelephonyManager;
+    private ImsManager mImsManager = null;
     private Phone phone = null;
     private PhoneStateIntentReceiver mPhoneStateReceiver;
 
-    private String mPingIpAddrResult;
-    private String mPingHostnameResult;
+    private String mPingHostnameResultV4;
+    private String mPingHostnameResultV6;
     private String mHttpClientTestResult;
     private boolean mMwiValue = false;
     private boolean mCfiValue = false;
-    private List<CellInfo> mCellInfoValue;
+
+    private List<CellInfo> mCellInfoResult = null;
+    private CellLocation mCellLocationResult = null;
+    private List<NeighboringCellInfo> mNeighboringCellResult = null;
+
+    private int mPreferredNetworkTypeResult;
 
     private PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
         @Override
@@ -171,7 +191,8 @@
         @Override
         public void onCellInfoChanged(List<CellInfo> arrayCi) {
             log("onCellInfoChanged: arrayCi=" + arrayCi);
-            updateCellInfoTv(arrayCi);
+            mCellInfoResult = arrayCi;
+            updateCellInfo(mCellInfoResult);
         }
 
         @Override
@@ -181,7 +202,19 @@
         }
     };
 
+    private void updatePreferredNetworkType(int type) {
+        if (type >= mPreferredNetworkLabels.length || type < 0) {
+            log("EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " +
+                    "type=" + type);
+            type = mPreferredNetworkLabels.length - 1; //set to Unknown
+        }
+        mPreferredNetworkTypeResult = type;
+
+        preferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
+    }
+
     private Handler mHandler = new Handler() {
+        @Override
         public void handleMessage(Message msg) {
             AsyncResult ar;
             switch (msg.what) {
@@ -201,31 +234,17 @@
 
                 case EVENT_QUERY_PREFERRED_TYPE_DONE:
                     ar= (AsyncResult) msg.obj;
-                    if (ar.exception == null) {
-                        int type = ((int[])ar.result)[0];
-                        if (type >= mPreferredNetworkLabels.length) {
-                            log("EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " +
-                                    "type=" + type);
-                            type = mPreferredNetworkLabels.length - 1;
-                        }
-                        preferredNetworkType.setSelection(type, true);
+                    if (ar.exception == null && ar.result != null) {
+                        updatePreferredNetworkType(((int[])ar.result)[0]);
                     } else {
-                        preferredNetworkType.setSelection(mPreferredNetworkLabels.length - 1, true);
+                        //In case of an exception, we will set this to unknown
+                        updatePreferredNetworkType(mPreferredNetworkLabels.length-1);
                     }
                     break;
                 case EVENT_SET_PREFERRED_TYPE_DONE:
                     ar= (AsyncResult) msg.obj;
                     if (ar.exception != null) {
-                        phone.getPreferredNetworkType(
-                                obtainMessage(EVENT_QUERY_PREFERRED_TYPE_DONE));
-                    }
-                    break;
-                case EVENT_QUERY_NEIGHBORING_CIDS_DONE:
-                    ar= (AsyncResult) msg.obj;
-                    if (ar.exception == null) {
-                        updateNeighboringCids((ArrayList<NeighboringCellInfo>)ar.result);
-                    } else {
-                        mNeighboringCids.setText("unknown");
+                        log("Set preferred network type success.");
                     }
                     break;
                 case EVENT_QUERY_SMSC_DONE:
@@ -244,6 +263,7 @@
                     }
                     break;
                 default:
+                    super.handleMessage(msg);
                     break;
 
             }
@@ -256,9 +276,16 @@
 
         setContentView(R.layout.radio_info);
 
+        log("Started onCreate");
+
         mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
         phone = PhoneFactory.getDefaultPhone();
 
+        //TODO: Need to update this if the default phoneId changes?
+        //      Better to have an instance per phone?
+        mImsManager = ImsManager.getInstance(getApplicationContext(),
+                SubscriptionManager.getDefaultVoicePhoneId());
+
         mDeviceId= (TextView) findViewById(R.id.imei);
         number = (TextView) findViewById(R.id.number);
         callState = (TextView) findViewById(R.id.call);
@@ -273,6 +300,7 @@
         mLocation = (TextView) findViewById(R.id.location);
         mNeighboringCids = (TextView) findViewById(R.id.neighboring);
         mCellInfo = (TextView) findViewById(R.id.cellinfo);
+        mCellInfo.setTypeface(Typeface.MONOSPACE);
         mDcRtInfoTv = (TextView) findViewById(R.id.dcrtinfo);
 
         resets = (TextView) findViewById(R.id.resets);
@@ -284,9 +312,8 @@
         received = (TextView) findViewById(R.id.received);
         smsc = (EditText) findViewById(R.id.smsc);
         dnsCheckState = (TextView) findViewById(R.id.dnsCheckState);
-
-        mPingIpAddr = (TextView) findViewById(R.id.pingIpAddr);
-        mPingHostname = (TextView) findViewById(R.id.pingHostname);
+        mPingHostnameV4 = (TextView) findViewById(R.id.pingHostnameV4);
+        mPingHostnameV6 = (TextView) findViewById(R.id.pingHostnameV6);
         mHttpClientTest = (TextView) findViewById(R.id.httpClientTest);
 
         preferredNetworkType = (Spinner) findViewById(R.id.preferredNetworkType);
@@ -337,28 +364,26 @@
         mPhoneStateReceiver.notifyServiceState(EVENT_SERVICE_STATE_CHANGED);
         mPhoneStateReceiver.notifyPhoneCallState(EVENT_PHONE_STATE_CHANGED);
 
+        mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
+
+        //FIXME: Replace with TelephonyManager call
         phone.getPreferredNetworkType(
                 mHandler.obtainMessage(EVENT_QUERY_PREFERRED_TYPE_DONE));
-        phone.getNeighboringCids(
-                mHandler.obtainMessage(EVENT_QUERY_NEIGHBORING_CIDS_DONE));
 
-        CellLocation.requestLocationUpdate();
-
-        // Get current cell info
-        mCellInfoValue = mTelephonyManager.getAllCellInfo();
-        log("onCreate: mCellInfoValue=" + mCellInfoValue);
+        restoreFromBundle(icicle);
     }
 
     @Override
     protected void onResume() {
         super.onResume();
 
+        log("Started onResume");
+
         updatePhoneState();
         updateSignalStrength();
         updateMessageWaiting();
         updateCallRedirect();
         updateServiceState();
-        updateLocation(mTelephonyManager.getCellLocation());
         updateDataState();
         updateDataStats();
         updateDataStats2();
@@ -371,7 +396,13 @@
         updateProperties();
         updateDnsCheckState();
 
-        log("onResume: register phone & data intents");
+        updateNeighboringCids(mNeighboringCellResult);
+        updateLocation(mCellLocationResult);
+        updateCellInfo(mCellInfoResult);
+
+        mPingHostnameV4.setText(mPingHostnameResultV4);
+        mPingHostnameV6.setText(mPingHostnameResultV6);
+        mHttpClientTest.setText(mHttpClientTestResult);
 
         mPhoneStateReceiver.registerIntent();
         mTelephonyManager.listen(mPhoneStateListener,
@@ -385,7 +416,7 @@
     }
 
     @Override
-    public void onPause() {
+    protected void onPause() {
         super.onPause();
 
         log("onPause: unregister phone & data intents");
@@ -394,6 +425,30 @@
         mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
     }
 
+    private void restoreFromBundle(Bundle b) {
+        if( b == null) {
+            return;
+        }
+
+        mPingHostnameResultV4 = b.getString("mPingHostnameResultV4","");
+        mPingHostnameResultV6 = b.getString("mPingHostnameResultV6","");
+        mHttpClientTestResult = b.getString("mHttpClientTestResult","");
+
+        mPingHostnameV4.setText(mPingHostnameResultV4);
+        mPingHostnameV6.setText(mPingHostnameResultV6);
+        mHttpClientTest.setText(mHttpClientTestResult);
+
+        mPreferredNetworkTypeResult = b.getInt("mPreferredNetworkTypeResult", 0);
+    }
+
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        outState.putString("mPingHostnameResultV4", mPingHostnameResultV4);
+        outState.putString("mPingHostnameResultV6", mPingHostnameResultV6);
+        outState.putString("mHttpClientTestResult", mHttpClientTestResult);
+        outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
+    }
+
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         menu.add(0, MENU_ITEM_SELECT_BAND, 0, R.string.radio_info_band_mode_label)
@@ -436,6 +491,7 @@
     }
 
     private boolean isRadioOn() {
+        //FIXME: Replace with a TelephonyManager call
         return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
     }
 
@@ -447,11 +503,24 @@
     }
 
     private void updateCellInfoListRate() {
-        cellInfoListRateButton.setText("CellInfoListRate " + mCellInfoListRateHandler.getRate());
-        updateCellInfoTv(mTelephonyManager.getAllCellInfo());
+        int rate = mCellInfoListRateHandler.getRate();
+        String rateStr;
+        switch(rate) {
+            case Integer.MAX_VALUE:
+                rateStr = "Off";
+                break;
+            case 0:
+                rateStr = "Immediate";
+                break;
+            default:
+                rateStr = (new Integer(rate)).toString() + "ms";
+                break;
+        }
+        cellInfoListRateButton.setText("CellInfoListRate "+ rateStr);
     }
 
     private void updateDnsCheckState() {
+        //FIXME: Replace with a TelephonyManager call
         dnsCheckState.setText(phone.isDnsCheckDisabled() ?
                 "0.0.0.0 allowed" :"0.0.0.0 not allowed");
     }
@@ -521,7 +590,7 @@
 
     }
 
-    private final void updateNeighboringCids(ArrayList<NeighboringCellInfo> cids) {
+    private final void updateNeighboringCids(List<NeighboringCellInfo> cids) {
         StringBuilder sb = new StringBuilder();
 
         if (cids != null) {
@@ -538,22 +607,128 @@
         mNeighboringCids.setText(sb.toString());
     }
 
-    private final void updateCellInfoTv(List<CellInfo> arrayCi) {
-        mCellInfoValue = arrayCi;
-        StringBuilder value = new StringBuilder();
-        if (mCellInfoValue != null) {
-            int index = 0;
-            for (CellInfo ci : mCellInfoValue) {
-                value.append('[');
-                value.append(index);
-                value.append("]=");
-                value.append(ci.toString());
-                if (++index < mCellInfoValue.size()) {
-                    value.append("\n");
+    private final String getCellInfoDisplayString(int i) {
+        return (i != Integer.MAX_VALUE) ? Integer.toString(i) : "";
+    }
+
+    private final String getCellInfoDisplayString(long i) {
+        return (i != Long.MAX_VALUE) ? Long.toString(i) : "";
+    }
+
+    private final String buildCdmaInfoString(CellInfoCdma ci) {
+        CellIdentityCdma cidCdma = ci.getCellIdentity();
+        CellSignalStrengthCdma ssCdma = ci.getCellSignalStrength();
+
+        return String.format("%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s",
+                ci.isRegistered() ? "S  " : "   ",
+                getCellInfoDisplayString(cidCdma.getSystemId()),
+                getCellInfoDisplayString(cidCdma.getNetworkId()),
+                getCellInfoDisplayString(cidCdma.getBasestationId()),
+                getCellInfoDisplayString(ssCdma.getCdmaDbm()),
+                getCellInfoDisplayString(ssCdma.getCdmaEcio()),
+                getCellInfoDisplayString(ssCdma.getEvdoDbm()),
+                getCellInfoDisplayString(ssCdma.getEvdoEcio()),
+                getCellInfoDisplayString(ssCdma.getEvdoSnr()));
+    }
+
+    private final String buildGsmInfoString(CellInfoGsm ci) {
+        CellIdentityGsm cidGsm = ci.getCellIdentity();
+        CellSignalStrengthGsm ssGsm = ci.getCellSignalStrength();
+
+        return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-4.4s %-4.4s\n",
+                ci.isRegistered() ? "S  " : "   ",
+                getCellInfoDisplayString(cidGsm.getMcc()),
+                getCellInfoDisplayString(cidGsm.getMnc()),
+                getCellInfoDisplayString(cidGsm.getLac()),
+                getCellInfoDisplayString(cidGsm.getCid()),
+                // TODO: Add BSIC support once integrated
+                // getCellInfoDisplayString(cidGsm.getBsic()),
+                "    ",
+                getCellInfoDisplayString(ssGsm.getDbm()));
+    }
+
+    private final String buildLteInfoString(CellInfoLte ci) {
+        CellIdentityLte cidLte = ci.getCellIdentity();
+        CellSignalStrengthLte ssLte = ci.getCellSignalStrength();
+
+        return String.format(
+                "%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-4.4s %-4.4s %-2.2s\n",
+                ci.isRegistered() ? "S  " : "   ",
+                getCellInfoDisplayString(cidLte.getMcc()),
+                getCellInfoDisplayString(cidLte.getMnc()),
+                getCellInfoDisplayString(cidLte.getTac()),
+                getCellInfoDisplayString(cidLte.getCi()),
+                getCellInfoDisplayString(cidLte.getPci()),
+                getCellInfoDisplayString(ssLte.getDbm()),
+                getCellInfoDisplayString(ssLte.getRsrq()),
+                getCellInfoDisplayString(ssLte.getTimingAdvance()));
+    }
+
+    private final String buildWcdmaInfoString(CellInfoWcdma ci) {
+        CellIdentityWcdma cidWcdma = ci.getCellIdentity();
+        CellSignalStrengthWcdma ssWcdma = ci.getCellSignalStrength();
+
+        return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-5.5s %-4.4s\n",
+                ci.isRegistered() ? "S  " : "   ",
+                getCellInfoDisplayString(cidWcdma.getMcc()),
+                getCellInfoDisplayString(cidWcdma.getMnc()),
+                getCellInfoDisplayString(cidWcdma.getLac()),
+                getCellInfoDisplayString(cidWcdma.getCid()),
+                getCellInfoDisplayString(cidWcdma.getPsc()),
+                getCellInfoDisplayString(ssWcdma.getDbm()));
+    }
+
+    private final String buildCellInfoString(List<CellInfo> arrayCi) {
+        String value = new String();
+        StringBuilder cdmaCells = new StringBuilder(),
+                gsmCells = new StringBuilder(),
+                lteCells = new StringBuilder(),
+                wcdmaCells = new StringBuilder();
+
+        if (arrayCi != null) {
+            for (CellInfo ci : arrayCi) {
+
+                if (ci instanceof CellInfoLte) {
+                    lteCells.append(buildLteInfoString((CellInfoLte) ci));
+                } else if (ci instanceof CellInfoWcdma) {
+                    wcdmaCells.append(buildWcdmaInfoString((CellInfoWcdma) ci));
+                } else if (ci instanceof CellInfoGsm) {
+                    gsmCells.append(buildGsmInfoString((CellInfoGsm) ci));
+                } else if (ci instanceof CellInfoCdma) {
+                    cdmaCells.append(buildCdmaInfoString((CellInfoCdma) ci));
                 }
             }
+            if (lteCells.length() != 0) {
+                value += String.format(
+                        "LTE\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-4.4s %-4.4s %-2.2s\n",
+                        "SRV", "MCC", "MNC", "TAC", "CID", "PCI", "RSRP", "RSRQ", "TA");
+                value += lteCells.toString();
+            }
+            if (wcdmaCells.length() != 0) {
+                value += String.format("WCDMA\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-5.5s %-4.4s\n",
+                        "SRV", "MCC", "MNC", "LAC", "CID", "PSC", "RSCP");
+                value += wcdmaCells.toString();
+            }
+            if (gsmCells.length() != 0) {
+                value += String.format("GSM\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-4.4s %-4.4s\n",
+                        "SRV", "MCC", "MNC", "LAC", "CID", "BSIC", "RSSI");
+                value += gsmCells.toString();
+            }
+            if (cdmaCells.length() != 0) {
+                value += String.format(
+                        "CDMA/EVDO\n%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s\n",
+                        "SRV", "SID", "NID", "BSID", "C-RSSI", "C-ECIO", "E-RSSI", "E-ECIO", "E-SNR");
+                value += cdmaCells.toString();
+            }
+        } else {
+            value ="unknown";
         }
-        mCellInfo.setText(value.toString());
+
+        return value.toString();
+    }
+
+    private final void updateCellInfo(List<CellInfo> arrayCi) {
+        mCellInfo.setText(buildCellInfoString(arrayCi));
     }
 
     private final void updateDcRtInfoTv(DataConnectionRealTimeInfo dcRtInfo) {
@@ -664,7 +839,7 @@
         if (s == null) s = r.getString(R.string.radioInfo_unknown);
         mDeviceId.setText(s);
 
-
+        //FIXME: Replace with a TelephonyManager call
         s = phone.getLine1Number();
         if (s == null) s = r.getString(R.string.radioInfo_unknown);
         number.setText(s);
@@ -705,45 +880,34 @@
     }
 
     /**
-     * Ping a IP address.
-     */
-    private final void pingIpAddr() {
-        try {
-            // This is hardcoded IP addr. This is for testing purposes.
-            // We would need to get rid of this before release.
-            String ipAddress = "74.125.47.104";
-            Process p = Runtime.getRuntime().exec("ping -c 1 " + ipAddress);
-            int status = p.waitFor();
-            if (status == 0) {
-                mPingIpAddrResult = "Pass";
-            } else {
-                mPingIpAddrResult = "Fail: IP addr not reachable";
-            }
-        } catch (IOException e) {
-            mPingIpAddrResult = "Fail: IOException";
-        } catch (InterruptedException e) {
-            mPingIpAddrResult = "Fail: InterruptedException";
-        }
-    }
-
-    /**
      *  Ping a host name
      */
     private final void pingHostname() {
         try {
-            Process p = Runtime.getRuntime().exec("ping -c 1 www.google.com");
-            int status = p.waitFor();
-            if (status == 0) {
-                mPingHostnameResult = "Pass";
-            } else {
-                mPingHostnameResult = "Fail: Host unreachable";
+            try {
+                Process p4 = Runtime.getRuntime().exec("ping -c 1 www.google.com");
+                int status4 = p4.waitFor();
+                if (status4 == 0) {
+                    mPingHostnameResultV4 = "Pass";
+                } else {
+                    mPingHostnameResultV4 = String.format("Fail(%d)", status4);
+                }
+            } catch (IOException e) {
+                mPingHostnameResultV4 = "Fail: IOException";
             }
-        } catch (UnknownHostException e) {
-            mPingHostnameResult = "Fail: Unknown Host";
-        } catch (IOException e) {
-            mPingHostnameResult= "Fail: IOException";
+            try {
+                Process p6 = Runtime.getRuntime().exec("ping6 -c 1 www.google.com");
+                int status6 = p6.waitFor();
+                if (status6 == 0) {
+                    mPingHostnameResultV6 = "Pass";
+                } else {
+                    mPingHostnameResultV6 = String.format("Fail(%d)", status6);
+                }
+            } catch (IOException e) {
+                mPingHostnameResultV6 = "Fail: IOException";
+            }
         } catch (InterruptedException e) {
-            mPingHostnameResult = "Fail: InterruptedException";
+            mPingHostnameResultV4 = mPingHostnameResultV6 = "Fail: InterruptedException";
         }
     }
 
@@ -771,41 +935,60 @@
     }
 
     private void refreshSmsc() {
+        //FIXME: Replace with a TelephonyManager call
         phone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
     }
 
+    private final void updateAllCellInfo() {
+
+        mCellInfo.setText("");
+        mNeighboringCids.setText("");
+        mLocation.setText("");
+
+        final Runnable updateAllCellInfoResults = new Runnable() {
+            public void run() {
+                updateNeighboringCids(mNeighboringCellResult);
+                updateLocation(mCellLocationResult);
+                updateCellInfo(mCellInfoResult);
+            }
+        };
+
+        Thread locThread = new Thread() {
+            @Override
+            public void run() {
+                mCellInfoResult = mTelephonyManager.getAllCellInfo();
+                mCellLocationResult = mTelephonyManager.getCellLocation();
+                mNeighboringCellResult = mTelephonyManager.getNeighboringCellInfo();
+
+                mHandler.post(updateAllCellInfoResults);
+            }
+        };
+        locThread.start();
+    }
+
     private final void updatePingState() {
-        final Handler handler = new Handler();
         // Set all to unknown since the threads will take a few secs to update.
-        mPingIpAddrResult = getResources().getString(R.string.radioInfo_unknown);
-        mPingHostnameResult = getResources().getString(R.string.radioInfo_unknown);
+        mPingHostnameResultV4 = getResources().getString(R.string.radioInfo_unknown);
+        mPingHostnameResultV6 = getResources().getString(R.string.radioInfo_unknown);
         mHttpClientTestResult = getResources().getString(R.string.radioInfo_unknown);
 
-        mPingIpAddr.setText(mPingIpAddrResult);
-        mPingHostname.setText(mPingHostnameResult);
+        mPingHostnameV4.setText(mPingHostnameResultV4);
+        mPingHostnameV6.setText(mPingHostnameResultV6);
         mHttpClientTest.setText(mHttpClientTestResult);
 
         final Runnable updatePingResults = new Runnable() {
             public void run() {
-                mPingIpAddr.setText(mPingIpAddrResult);
-                mPingHostname.setText(mPingHostnameResult);
+                mPingHostnameV4.setText(mPingHostnameResultV4);
+                mPingHostnameV6.setText(mPingHostnameResultV6);
                 mHttpClientTest.setText(mHttpClientTestResult);
             }
         };
-        Thread ipAddr = new Thread() {
-            @Override
-            public void run() {
-                pingIpAddr();
-                handler.post(updatePingResults);
-            }
-        };
-        ipAddr.start();
 
         Thread hostname = new Thread() {
             @Override
             public void run() {
                 pingHostname();
-                handler.post(updatePingResults);
+                mHandler.post(updatePingResults);
             }
         };
         hostname.start();
@@ -814,7 +997,7 @@
             @Override
             public void run() {
                 httpClientTest();
-                handler.post(updatePingResults);
+                mHandler.post(updatePingResults);
             }
         };
         httpClient.start();
@@ -910,6 +1093,7 @@
 
     private MenuItem.OnMenuItemClickListener mGetPdpList = new MenuItem.OnMenuItemClickListener() {
         public boolean onMenuItemClick(MenuItem item) {
+            //FIXME: Replace with a TelephonyManager call
             phone.getDataCallList(null);
             return true;
         }
@@ -929,9 +1113,11 @@
             int state = mTelephonyManager.getDataState();
             switch (state) {
                 case TelephonyManager.DATA_CONNECTED:
+                    //FIXME: Replace with a TelephonyManager call
                     phone.setDataEnabled(false);
                     break;
                 case TelephonyManager.DATA_DISCONNECTED:
+                    //FIXME: Replace with a TelephonyManager call
                     phone.setDataEnabled(true);
                     break;
                 default:
@@ -945,12 +1131,13 @@
     OnClickListener mPowerButtonHandler = new OnClickListener() {
         public void onClick(View v) {
             //log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
+            //FIXME: Replace with a TelephonyManager call
             phone.setRadioPower(!isRadioOn());
         }
     };
 
     class CellInfoListRateHandler implements OnClickListener {
-        int rates[] = {Integer.MAX_VALUE, 0, 1000};
+        int rates[] = {Integer.MAX_VALUE, 0, 5000};
         int index = 0;
 
         public int getRate() {
@@ -960,11 +1147,13 @@
         @Override
         public void onClick(View v) {
             index += 1;
-            if (index >= rates.length) {
-                index = 0;
-            }
+            index %= rates.length;
+
+            // FIXME: Replace with a TelephonyManager call
             phone.setCellInfoListRate(rates[index]);
             updateCellInfoListRate();
+
+            updateAllCellInfo();
         }
     }
     CellInfoListRateHandler mCellInfoListRateHandler = new CellInfoListRateHandler();
@@ -1020,12 +1209,12 @@
                     (isImsVoLteProvisioned() ? "on":"off")));
             final boolean newValue = !isImsVoLteProvisioned();
             if (phone != null) {
-                final ImsManager imsManager = ImsManager.getInstance(phone.getContext(), phone.getSubId());
-                if (imsManager != null) {
+                //TODO: Why does this have to be called within the phone's context?
+                if (mImsManager != null) {
                     QueuedWork.singleThreadExecutor().submit(new Runnable() {
                         public void run() {
                             try {
-                                imsManager.getConfigInterface().setProvisionedValue(
+                                mImsManager.getConfigInterface().setProvisionedValue(
                                         ImsConfig.ConfigConstants.VLT_SETTING_ENABLED,
                                         newValue? 1 : 0);
                             } catch (ImsException e) {
@@ -1041,8 +1230,10 @@
 
     private boolean isImsVoLteProvisioned() {
         if (phone != null) {
-            ImsManager imsManager = ImsManager.getInstance(phone.getContext(), phone.getSubId());
-            return imsManager.isVolteProvisionedOnDevice(phone.getContext());
+            //TODO: Why does this have to be called within the phone's context?
+            if(mImsManager != null ) {
+              return mImsManager.isVolteProvisionedOnDevice(phone.getContext());
+            }
         }
         return false;
     }
@@ -1090,6 +1281,7 @@
 
     OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
         public void onClick(View v) {
+            //FIXME: Replace with a TelephonyManager call
             phone.disableDnsCheck(!phone.isDnsCheckDisabled());
             updateDnsCheckState();
         }
@@ -1128,12 +1320,15 @@
         }
     };
 
-    AdapterView.OnItemSelectedListener
-            mPreferredNetworkHandler = new AdapterView.OnItemSelectedListener() {
+    AdapterView.OnItemSelectedListener mPreferredNetworkHandler =
+            new AdapterView.OnItemSelectedListener() {
+
         public void onItemSelected(AdapterView parent, View v, int pos, long id) {
-            Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
-            if (pos>=0 && pos<=(mPreferredNetworkLabels.length - 2)) {
-                phone.setPreferredNetworkType(pos, msg);
+            if (mPreferredNetworkTypeResult != pos && pos >= 0
+                    && pos <= mPreferredNetworkLabels.length - 2) {
+                mPreferredNetworkTypeResult = pos;
+                Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
+                phone.setPreferredNetworkType(mPreferredNetworkTypeResult, msg);
             }
         }
 
@@ -1149,11 +1344,21 @@
             "CDMA auto (PRL)",
             "CDMA only",
             "EvDo only",
-            "GSM/CDMA auto (PRL)",
+            "Global auto (PRL)",
             "LTE/CDMA auto (PRL)",
-            "LTE/GSM auto (PRL)",
-            "LTE/GSM/CDMA auto (PRL)",
+            "LTE/UMTS auto (PRL)",
+            "LTE/CDMA/UMTS auto (PRL)",
             "LTE only",
+            "LTE/WCDMA",
+            "TD-SCDMA only",
+            "TD-SCDMA/WCDMA",
+            "LTE/TD-SCDMA",
+            "TD-SCDMA/GSM",
+            "TD-SCDMA/UMTS",
+            "LTE/TD-SCDMA/WCDMA",
+            "LTE/TD-SCDMA/UMTS",
+            "TD-SCDMA/CDMA/UMTS",
+            "Global/TD-SCDMA",
             "Unknown"};
 
     private void log(String s) {
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index 9050448..4615a99 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -31,6 +31,7 @@
 import android.widget.Button;
 import android.widget.Toast;
 
+import com.android.ims.ImsManager;
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.telephony.PhoneConstants;
 
@@ -94,6 +95,8 @@
                 btManager.getAdapter().factoryReset();
             }
 
+            ImsManager.factoryReset(context);
+
             Toast.makeText(context, R.string.reset_network_complete_toast, Toast.LENGTH_SHORT)
                     .show();
         }
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 4380d1e..149ef45 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -61,6 +61,7 @@
             return super.isValidFragment(className);
             }
     }
+    public static class BackgroundCheckSummaryActivity extends SettingsActivity { /* empty */ }
     public static class StorageUseActivity extends SettingsActivity { /* empty */ }
     public static class DevelopmentSettingsActivity extends SettingsActivity { /* empty */ }
     public static class AccessibilitySettingsActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index ce07299..f98d2a6 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -737,9 +737,6 @@
     @Override
     protected void onResume() {
         super.onResume();
-        if (mIsShowingDashboard) {
-            MetricsLogger.visible(this, MetricsLogger.MAIN_SETTINGS);
-        }
 
         mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
             @Override
@@ -763,9 +760,6 @@
     @Override
     protected void onPause() {
         super.onPause();
-        if (mIsShowingDashboard) {
-            MetricsLogger.hidden(this, MetricsLogger.MAIN_SETTINGS);
-        }
         unregisterReceiver(mBatteryInfoReceiver);
         mDynamicIndexableContentMonitor.unregister();
     }
diff --git a/src/com/android/settings/applications/AppOpsCategory.java b/src/com/android/settings/applications/AppOpsCategory.java
index 3ccd6bb..4b54891 100644
--- a/src/com/android/settings/applications/AppOpsCategory.java
+++ b/src/com/android/settings/applications/AppOpsCategory.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.applications;
 
+import android.app.AppOpsManager;
 import android.app.ListFragment;
 import android.app.LoaderManager;
 import android.content.AsyncTaskLoader;
@@ -34,6 +35,7 @@
 import android.widget.BaseAdapter;
 import android.widget.ImageView;
 import android.widget.ListView;
+import android.widget.Switch;
 import android.widget.TextView;
 
 import com.android.settings.R;
@@ -48,6 +50,7 @@
     private static final int RESULT_APP_DETAILS = 1;
 
     AppOpsState mState;
+    boolean mUserControlled;
 
     // This is the Adapter being used to display the list's data.
     AppListAdapter mAdapter;
@@ -58,8 +61,13 @@
     }
 
     public AppOpsCategory(AppOpsState.OpsTemplate template) {
+        this(template, false);
+    }
+
+    public AppOpsCategory(AppOpsState.OpsTemplate template, boolean userControlled) {
         Bundle args = new Bundle();
         args.putParcelable("template", template);
+        args.putBoolean("userControlled", userControlled);
         setArguments(args);
     }
 
@@ -117,18 +125,22 @@
         final InterestingConfigChanges mLastConfig = new InterestingConfigChanges();
         final AppOpsState mState;
         final AppOpsState.OpsTemplate mTemplate;
+        final boolean mUserControlled;
 
         List<AppOpEntry> mApps;
         PackageIntentReceiver mPackageObserver;
 
-        public AppListLoader(Context context, AppOpsState state, AppOpsState.OpsTemplate template) {
+        public AppListLoader(Context context, AppOpsState state, AppOpsState.OpsTemplate template,
+                boolean userControlled) {
             super(context);
             mState = state;
             mTemplate = template;
+            mUserControlled = userControlled;
         }
 
         @Override public List<AppOpEntry> loadInBackground() {
-            return mState.buildState(mTemplate);
+            return mState.buildState(mTemplate, 0, null,
+                    mUserControlled ? AppOpsState.LABEL_COMPARATOR : AppOpsState.RECENCY_COMPARATOR);
         }
 
         /**
@@ -247,13 +259,15 @@
         private final Resources mResources;
         private final LayoutInflater mInflater;
         private final AppOpsState mState;
+        private final boolean mUserControlled;
 
         List<AppOpEntry> mList;
 
-        public AppListAdapter(Context context, AppOpsState state) {
+        public AppListAdapter(Context context, AppOpsState state, boolean userControlled) {
             mResources = context.getResources();
             mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             mState = state;
+            mUserControlled = userControlled;
         }
 
         public void setData(List<AppOpEntry> data) {
@@ -292,9 +306,18 @@
             ((ImageView)view.findViewById(R.id.app_icon)).setImageDrawable(
                     item.getAppEntry().getIcon());
             ((TextView)view.findViewById(R.id.app_name)).setText(item.getAppEntry().getLabel());
-            ((TextView)view.findViewById(R.id.op_name)).setText(item.getSummaryText(mState));
-            ((TextView)view.findViewById(R.id.op_time)).setText(
-                    item.getTimeText(mResources, false));
+            if (mUserControlled) {
+                ((TextView) view.findViewById(R.id.op_name)).setText(
+                        item.getTimeText(mResources, false));
+                view.findViewById(R.id.op_time).setVisibility(View.GONE);
+                ((Switch) view.findViewById(R.id.op_switch)).setChecked(
+                        item.getPrimaryOpMode() == AppOpsManager.MODE_ALLOWED);
+            } else {
+                ((TextView) view.findViewById(R.id.op_name)).setText(item.getSummaryText(mState));
+                ((TextView) view.findViewById(R.id.op_time)).setText(
+                        item.getTimeText(mResources, false));
+                view.findViewById(R.id.op_switch).setVisibility(View.GONE);
+            }
 
             return view;
         }
@@ -304,6 +327,7 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         mState = new AppOpsState(getActivity());
+        mUserControlled = getArguments().getBoolean("userControlled");
     }
 
     @Override public void onActivityCreated(Bundle savedInstanceState) {
@@ -317,7 +341,7 @@
         setHasOptionsMenu(true);
 
         // Create an empty adapter we will use to display the loaded data.
-        mAdapter = new AppListAdapter(getActivity(), mState);
+        mAdapter = new AppListAdapter(getActivity(), mState, mUserControlled);
         setListAdapter(mAdapter);
 
         // Start out with a progress indicator.
@@ -341,8 +365,22 @@
     @Override public void onListItemClick(ListView l, View v, int position, long id) {
         AppOpEntry entry = mAdapter.getItem(position);
         if (entry != null) {
-            mCurrentPkgName = entry.getAppEntry().getApplicationInfo().packageName;
-            startApplicationDetailsActivity();
+            if (mUserControlled) {
+                // We treat this as tapping on the check box, toggling the app op state.
+                Switch sw = ((Switch) v.findViewById(R.id.op_switch));
+                boolean checked = !sw.isChecked();
+                sw.setChecked(checked);
+                AppOpsManager.OpEntry op = entry.getOpEntry(0);
+                int mode = checked ? AppOpsManager.MODE_ALLOWED : AppOpsManager.MODE_IGNORED;
+                mState.getAppOpsManager().setMode(op.getOp(),
+                        entry.getAppEntry().getApplicationInfo().uid,
+                        entry.getAppEntry().getApplicationInfo().packageName,
+                        mode);
+                entry.overridePrimaryOpMode(mode);
+            } else {
+                mCurrentPkgName = entry.getAppEntry().getApplicationInfo().packageName;
+                startApplicationDetailsActivity();
+            }
         }
     }
 
@@ -352,7 +390,7 @@
         if (fargs != null) {
             template = (AppOpsState.OpsTemplate)fargs.getParcelable("template");
         }
-        return new AppListLoader(getActivity(), mState, template);
+        return new AppListLoader(getActivity(), mState, template, mUserControlled);
     }
 
     @Override public void onLoadFinished(Loader<List<AppOpEntry>> loader, List<AppOpEntry> data) {
diff --git a/src/com/android/settings/applications/AppOpsState.java b/src/com/android/settings/applications/AppOpsState.java
index c3189d6..237eac6 100644
--- a/src/com/android/settings/applications/AppOpsState.java
+++ b/src/com/android/settings/applications/AppOpsState.java
@@ -180,6 +180,7 @@
                     false,
                     false,
                     false,
+                    false,
                     false }
             );
 
@@ -206,9 +207,14 @@
                     false }
             );
 
+    public static final OpsTemplate RUN_IN_BACKGROUND_TEMPLATE = new OpsTemplate(
+            new int[] { AppOpsManager.OP_RUN_IN_BACKGROUND },
+            new boolean[] { false }
+            );
+
     public static final OpsTemplate[] ALL_TEMPLATES = new OpsTemplate[] {
             LOCATION_TEMPLATE, PERSONAL_TEMPLATE, MESSAGING_TEMPLATE,
-            MEDIA_TEMPLATE, DEVICE_TEMPLATE
+            MEDIA_TEMPLATE, DEVICE_TEMPLATE, RUN_IN_BACKGROUND_TEMPLATE
     };
 
     /**
@@ -306,6 +312,7 @@
                 = new ArrayList<AppOpsManager.OpEntry>();
         private final AppEntry mApp;
         private final int mSwitchOrder;
+        private int mOverriddenPrimaryMode = -1;
 
         public AppOpEntry(AppOpsManager.PackageOps pkg, AppOpsManager.OpEntry op, AppEntry app,
                 int switchOrder) {
@@ -363,6 +370,14 @@
             return mOps.get(pos);
         }
 
+        public int getPrimaryOpMode() {
+            return mOverriddenPrimaryMode >= 0 ? mOverriddenPrimaryMode : mOps.get(0).getMode();
+        }
+
+        public void overridePrimaryOpMode(int mode) {
+            mOverriddenPrimaryMode = mode;
+        }
+
         private CharSequence getCombinedText(ArrayList<AppOpsManager.OpEntry> ops,
                 CharSequence[] items) {
             if (ops.size() == 1) {
@@ -418,9 +433,9 @@
     }
 
     /**
-     * Perform alphabetical comparison of application entry objects.
+     * Perform app op state comparison of application entry objects.
      */
-    public static final Comparator<AppOpEntry> APP_OP_COMPARATOR = new Comparator<AppOpEntry>() {
+    public static final Comparator<AppOpEntry> RECENCY_COMPARATOR = new Comparator<AppOpEntry>() {
         private final Collator sCollator = Collator.getInstance();
         @Override
         public int compare(AppOpEntry object1, AppOpEntry object2) {
@@ -440,6 +455,18 @@
         }
     };
 
+    /**
+     * Perform alphabetical comparison of application entry objects.
+     */
+    public static final Comparator<AppOpEntry> LABEL_COMPARATOR = new Comparator<AppOpEntry>() {
+        private final Collator sCollator = Collator.getInstance();
+        @Override
+        public int compare(AppOpEntry object1, AppOpEntry object2) {
+            return sCollator.compare(object1.getAppEntry().getLabel(),
+                    object2.getAppEntry().getLabel());
+        }
+    };
+
     private void addOp(List<AppOpEntry> entries, AppOpsManager.PackageOps pkgOps,
             AppEntry appEntry, AppOpsManager.OpEntry opEntry, boolean allowMerge, int switchOrder) {
         if (allowMerge && entries.size() > 0) {
@@ -466,8 +493,12 @@
         entries.add(entry);
     }
 
+    public AppOpsManager getAppOpsManager() {
+        return mAppOps;
+    }
+
     public List<AppOpEntry> buildState(OpsTemplate tpl) {
-        return buildState(tpl, 0, null);
+        return buildState(tpl, 0, null, RECENCY_COMPARATOR);
     }
 
     private AppEntry getAppEntry(final Context context, final HashMap<String, AppEntry> appEntries,
@@ -492,6 +523,11 @@
     }
 
     public List<AppOpEntry> buildState(OpsTemplate tpl, int uid, String packageName) {
+        return buildState(tpl, uid, packageName, RECENCY_COMPARATOR);
+    }
+
+    public List<AppOpEntry> buildState(OpsTemplate tpl, int uid, String packageName,
+            Comparator<AppOpEntry> comparator) {
         final Context context = mContext;
 
         final HashMap<String, AppEntry> appEntries = new HashMap<String, AppEntry>();
@@ -593,7 +629,7 @@
         }
 
         // Sort the list.
-        Collections.sort(entries, APP_OP_COMPARATOR);
+        Collections.sort(entries, comparator);
 
         // Done!
         return entries;
diff --git a/src/com/android/settings/applications/BackgroundCheckSummary.java b/src/com/android/settings/applications/BackgroundCheckSummary.java
new file mode 100644
index 0000000..dfd4c49
--- /dev/null
+++ b/src/com/android/settings/applications/BackgroundCheckSummary.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.android.settings.applications;
+
+import android.app.Fragment;
+import android.app.FragmentManager;
+import android.app.FragmentTransaction;
+import android.content.res.TypedArray;
+import android.os.Bundle;
+import android.preference.PreferenceFrameLayout;
+import android.support.v13.app.FragmentPagerAdapter;
+import android.support.v4.view.PagerTabStrip;
+import android.support.v4.view.ViewPager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.android.internal.logging.MetricsLogger;
+import com.android.settings.InstrumentedFragment;
+import com.android.settings.R;
+
+public class BackgroundCheckSummary extends InstrumentedFragment {
+    // layout inflater object used to inflate views
+    private LayoutInflater mInflater;
+
+    @Override
+    protected int getMetricsCategory() {
+        return MetricsLogger.BACKGROUND_CHECK_SUMMARY;
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        // initialize the inflater
+        mInflater = inflater;
+
+        View rootView = mInflater.inflate(R.layout.background_check_summary,
+                container, false);
+
+        // We have to do this now because PreferenceFrameLayout looks at it
+        // only when the view is added.
+        if (container instanceof PreferenceFrameLayout) {
+            ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
+        }
+
+        FragmentTransaction ft = getChildFragmentManager().beginTransaction();
+        ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE,
+                        true), "appops");
+        ft.commitAllowingStateLoss();
+
+        return rootView;
+    }
+}
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
index 2ed48e9..9974e89 100644
--- a/src/com/android/settings/location/LocationSettings.java
+++ b/src/com/android/settings/location/LocationSettings.java
@@ -17,7 +17,9 @@
 package com.android.settings.location;
 
 import android.app.Activity;
+import android.app.admin.DevicePolicyManager;
 import android.content.BroadcastReceiver;
+import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -30,6 +32,7 @@
 import android.support.v7.preference.PreferenceCategory;
 import android.support.v7.preference.PreferenceGroup;
 import android.support.v7.preference.PreferenceScreen;
+import android.support.v14.preference.SwitchPreference;
 import android.util.Log;
 import android.view.Menu;
 import android.view.MenuInflater;
@@ -81,16 +84,10 @@
     private static final String TAG = "LocationSettings";
 
     /**
-     * Key for managed profile location preference category. Category is shown only
-     * if there is a managed profile
+     * Key for managed profile location switch preference. Shown only
+     * if there is a managed profile.
      */
-    private static final String KEY_MANAGED_PROFILE_CATEGORY = "managed_profile_location_category";
-    /**
-     * Key for managed profile location preference. Note it used to be a switch pref and we had to
-     * keep the key as strings had been submitted for string freeze before the decision to
-     * demote this to a simple preference was made. TODO: Candidate for refactoring.
-     */
-    private static final String KEY_MANAGED_PROFILE_PREFERENCE = "managed_profile_location_switch";
+    private static final String KEY_MANAGED_PROFILE_SWITCH = "managed_profile_location_switch";
     /** Key for preference screen "Mode" */
     private static final String KEY_LOCATION_MODE = "location_mode";
     /** Key for preference category "Recent location requests" */
@@ -104,7 +101,7 @@
     private Switch mSwitch;
     private boolean mValidListener = false;
     private UserHandle mManagedProfile;
-    private Preference mManagedProfilePreference;
+    private SwitchPreference mManagedProfileSwitch;
     private Preference mLocationMode;
     private PreferenceCategory mCategoryRecentLocationRequests;
     /** Receives UPDATE_INTENT  */
@@ -250,20 +247,39 @@
         mManagedProfile = Utils.getManagedProfile(mUm);
         if (mManagedProfile == null) {
             // There is no managed profile
-            root.removePreference(root.findPreference(KEY_MANAGED_PROFILE_CATEGORY));
-            mManagedProfilePreference = null;
+            root.removePreference(root.findPreference(KEY_MANAGED_PROFILE_SWITCH));
+            mManagedProfileSwitch = null;
         } else {
-            mManagedProfilePreference = root.findPreference(KEY_MANAGED_PROFILE_PREFERENCE);
-            mManagedProfilePreference.setOnPreferenceClickListener(null);
+            mManagedProfileSwitch = (SwitchPreference)root
+                    .findPreference(KEY_MANAGED_PROFILE_SWITCH);
+            mManagedProfileSwitch.setOnPreferenceClickListener(null);
         }
     }
 
-    private void changeManagedProfileLocationAccessStatus(boolean enabled, int summaryResId) {
-        if (mManagedProfilePreference == null) {
+    private void changeManagedProfileLocationAccessStatus(boolean mainSwitchOn) {
+        if (mManagedProfileSwitch == null) {
             return;
         }
-        mManagedProfilePreference.setEnabled(enabled);
-        mManagedProfilePreference.setSummary(summaryResId);
+        boolean enabled = mainSwitchOn;
+        int summaryResId = R.string.switch_off_text;
+        if (mUm.hasUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, mManagedProfile)
+                && getAdminRestrictingManagedProfile() != null) {
+                    summaryResId = R.string.managed_profile_location_switch_lockdown;
+                    enabled = false;
+        }
+
+        mManagedProfileSwitch.setEnabled(enabled);
+        mManagedProfileSwitch.setOnPreferenceClickListener(null);
+        if (!enabled) {
+            mManagedProfileSwitch.setChecked(false);
+        } else {
+            final boolean isRestricted = isManagedProfileRestrictedByBase();
+            mManagedProfileSwitch.setChecked(!isRestricted);
+            summaryResId = (isRestricted ?
+                    R.string.switch_off_text : R.string.switch_on_text);
+            mManagedProfileSwitch.setOnPreferenceClickListener(mManagedProfileSwitchClickListener);
+        }
+        mManagedProfileSwitch.setSummary(summaryResId);
     }
 
     /**
@@ -374,18 +390,7 @@
             }
         }
 
-        if (mManagedProfilePreference != null) {
-            if (mUm.hasUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, mManagedProfile)) {
-                changeManagedProfileLocationAccessStatus(false,
-                        R.string.managed_profile_location_switch_lockdown);
-            } else {
-                if (enabled) {
-                    changeManagedProfileLocationAccessStatus(true, R.string.switch_on_text);
-                } else {
-                    changeManagedProfileLocationAccessStatus(false, R.string.switch_off_text);
-                }
-            }
-        }
+        changeManagedProfileLocationAccessStatus(enabled);
 
         // As a safety measure, also reloads on location mode change to ensure the settings are
         // up-to-date even if an affected app doesn't send the setting changed broadcast.
@@ -404,6 +409,47 @@
         }
     }
 
+    private ComponentName getAdminRestrictingManagedProfile() {
+        if (mManagedProfile == null) {
+            return null;
+        }
+        DevicePolicyManager dpm = (DevicePolicyManager)getActivity().getSystemService(
+                Context.DEVICE_POLICY_SERVICE);
+        if (dpm == null) {
+            return null;
+        }
+        List<ComponentName> admins = dpm.getActiveAdminsAsUser(mManagedProfile.getIdentifier());
+        for (int i = 0; i < admins.size(); ++i) {
+            final ComponentName admin = admins.get(i);
+            Bundle restrictions = dpm.getUserRestrictions(admin, mManagedProfile.getIdentifier());
+            if (restrictions != null && restrictions.getBoolean(UserManager.DISALLOW_SHARE_LOCATION,
+                    false)) {
+                return admin;
+            }
+        }
+        return null;
+    }
+
+    private boolean isManagedProfileRestrictedByBase() {
+        if (mManagedProfile == null) {
+            return false;
+        }
+        return mUm.hasBaseUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, mManagedProfile);
+    }
+
+    private Preference.OnPreferenceClickListener mManagedProfileSwitchClickListener =
+            new Preference.OnPreferenceClickListener() {
+                @Override
+                public boolean onPreferenceClick(Preference preference) {
+                    final boolean switchState = mManagedProfileSwitch.isChecked();
+                    mUm.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION,
+                            !switchState, mManagedProfile);
+                    mManagedProfileSwitch.setSummary(switchState ?
+                            R.string.switch_on_text : R.string.switch_off_text);
+                    return true;
+                }
+            };
+
     private class PackageEntryClickedListener
             implements Preference.OnPreferenceClickListener {
         private String mPackage;
diff --git a/src/com/android/settings/nfc/PaymentSettings.java b/src/com/android/settings/nfc/PaymentSettings.java
index 42545b9..985a1e6 100644
--- a/src/com/android/settings/nfc/PaymentSettings.java
+++ b/src/com/android/settings/nfc/PaymentSettings.java
@@ -115,8 +115,10 @@
                 PaymentBackend paymentBackend = new PaymentBackend(mContext);
                 paymentBackend.refresh();
                 PaymentAppInfo app = paymentBackend.getDefaultApp();
-                mSummaryLoader.setSummary(this, mContext.getString(R.string.payment_summary,
-                        app.label));
+                if (app != null) {
+                    mSummaryLoader.setSummary(this, mContext.getString(R.string.payment_summary,
+                            app.label));
+                }
             }
         }
     }
diff --git a/src/com/android/settings/notification/ImportanceSeekBarPreference.java b/src/com/android/settings/notification/ImportanceSeekBarPreference.java
new file mode 100644
index 0000000..fdba42c
--- /dev/null
+++ b/src/com/android/settings/notification/ImportanceSeekBarPreference.java
@@ -0,0 +1,118 @@
+/**
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import com.android.settings.R;
+import com.android.settings.SeekBarPreference;
+
+import android.content.Context;
+import android.service.notification.NotificationListenerService;
+import android.support.v7.preference.PreferenceViewHolder;
+import android.util.AttributeSet;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+/**
+ * A slider preference that controls notification importance.
+ **/
+public class ImportanceSeekBarPreference extends SeekBarPreference implements
+        SeekBar.OnSeekBarChangeListener {
+    private static final String TAG = "ImportanceSeekBarPref";
+
+    public static final int IMPORTANCE_PROGRESS_OFFSET = 2;
+    private Callback mCallback;
+    private TextView mSummaryTextView;
+    private String mSummary;
+
+    public ImportanceSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr,
+            int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+        setLayoutResource(R.layout.preference_importance_slider);
+    }
+
+    public ImportanceSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
+        this(context, attrs, defStyleAttr, 0);
+    }
+
+    public ImportanceSeekBarPreference(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public ImportanceSeekBarPreference(Context context) {
+        this(context, null);
+    }
+
+    public void setCallback(Callback callback) {
+        mCallback = callback;
+    }
+
+    @Override
+    public void onBindViewHolder(PreferenceViewHolder view) {
+        super.onBindViewHolder(view);
+        mSummaryTextView = (TextView) view.findViewById(com.android.internal.R.id.summary);
+    }
+
+    @Override
+    public void setProgress(int progress) {
+        mSummary = getProgressSummary(progress);
+        super.setProgress(progress);
+    }
+
+    @Override
+    public void onProgressChanged(SeekBar seekBar, final int progress, boolean fromTouch) {
+        super.onProgressChanged(seekBar, progress, fromTouch);
+        if (mSummaryTextView != null) {
+            mSummaryTextView.setText(getProgressSummary(progress));
+        }
+        if (fromTouch) {
+            mCallback.onImportanceChanged(progress);
+        }
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        return mSummary;
+    }
+
+    private String getProgressSummary(int progress) {
+        // Map progress 0-4 values to Importance's -2-2.
+        progress = progress - IMPORTANCE_PROGRESS_OFFSET;
+        switch (progress) {
+            case NotificationListenerService.Ranking.IMPORTANCE_NONE:
+                return getContext().getString(
+                        com.android.internal.R.string.notification_importance_blocked);
+            case NotificationListenerService.Ranking.IMPORTANCE_LOW:
+                return getContext().getString(
+                        com.android.internal.R.string.notification_importance_low);
+            case NotificationListenerService.Ranking.IMPORTANCE_DEFAULT:
+                return getContext().getString(
+                        com.android.internal.R.string.notification_importance_default);
+            case NotificationListenerService.Ranking.IMPORTANCE_HIGH:
+                return getContext().getString(
+                        com.android.internal.R.string.notification_importance_high);
+            case NotificationListenerService.Ranking.IMPORTANCE_MAX:
+                return getContext().getString(
+                        com.android.internal.R.string.notification_importance_max);
+            default:
+                return "";
+        }
+    }
+
+    public interface Callback {
+        void onImportanceChanged(int progress);
+    }
+}
diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java
index dcebf8b..4c1f6ea 100644
--- a/src/com/android/settings/notification/NotificationBackend.java
+++ b/src/com/android/settings/notification/NotificationBackend.java
@@ -62,6 +62,7 @@
         row.priority = getBypassZenMode(row.pkg, row.uid, row.topic);
         row.sensitive = getSensitive(row.pkg, row.uid, row.topic);
         row.banned = getNotificationsBanned(row.pkg, row.uid);
+        row.importance = getImportance(row.pkg, row.uid, row.topic);
         return row;
     }
 
@@ -128,6 +129,25 @@
         }
     }
 
+    public boolean setImportance(String pkg, int uid, Notification.Topic topic, int importance) {
+        try {
+            sINM.setTopicImportance(pkg, uid, topic, importance);
+            return true;
+        } catch (Exception e) {
+            Log.w(TAG, "Error calling NoMan", e);
+            return false;
+        }
+    }
+
+    public int getImportance(String pkg, int uid, Notification.Topic topic) {
+        try {
+            return sINM.getTopicImportance(pkg, uid, topic);
+        } catch (Exception e) {
+            Log.w(TAG, "Error calling NoMan", e);
+            return NotificationListenerService.Ranking.IMPORTANCE_DEFAULT;
+        }
+    }
+
     public List<Notification.Topic> getTopics(String pkg, int uid) {
         try {
             final ParceledListSlice<Notification.Topic> parceledList = sINM.getTopics(pkg, uid);
@@ -156,6 +176,7 @@
         public Notification.Topic topic;
         public boolean priority;
         public boolean sensitive;
+        public int importance;
     }
 
 }
diff --git a/src/com/android/settings/notification/TopicNotificationSettings.java b/src/com/android/settings/notification/TopicNotificationSettings.java
index 48c611e..71196b7 100644
--- a/src/com/android/settings/notification/TopicNotificationSettings.java
+++ b/src/com/android/settings/notification/TopicNotificationSettings.java
@@ -30,14 +30,13 @@
 import android.content.Intent;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.Bundle;
 import android.os.UserHandle;
 import android.provider.Settings;
+import android.service.notification.NotificationListenerService;
 import android.support.v14.preference.SwitchPreference;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.Preference.OnPreferenceChangeListener;
-import android.text.TextUtils;
 import android.util.Log;
 import android.widget.Toast;
 
@@ -50,10 +49,12 @@
     protected static final String ARG_PACKAGE_INFO = "arg_info";
     private static final String KEY_BYPASS_DND = "bypass_dnd";
     private static final String KEY_SENSITIVE = "sensitive";
+    private static final String KEY_IMPORTANCE = "importance";
 
     private final NotificationBackend mBackend = new NotificationBackend();
 
     private Context mContext;
+    private ImportanceSeekBarPreference mImportance;
     private SwitchPreference mPriority;
     private SwitchPreference mSensitive;
     private TopicRow mTopicRow;
@@ -122,11 +123,27 @@
         mIsSystemPackage = Utils.isSystemPackage(pm, info);
 
         addPreferencesFromResource(R.xml.topic_notification_settings);
+        mImportance = (ImportanceSeekBarPreference) findPreference(KEY_IMPORTANCE);
         mPriority = (SwitchPreference) findPreference(KEY_BYPASS_DND);
         mSensitive = (SwitchPreference) findPreference(KEY_SENSITIVE);
 
         mTopicRow = mBackend.loadTopicRow(pm, info.applicationInfo, topic);
 
+        mImportance.setMax(4);
+        // TODO: stop defaulting to 'normal' in the UI when there are mocks for this scenario.
+        int importance =
+                mTopicRow.importance == NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED
+                ? NotificationListenerService.Ranking.IMPORTANCE_DEFAULT
+                        : mTopicRow.importance;
+        mImportance.setProgress(
+                importance + ImportanceSeekBarPreference.IMPORTANCE_PROGRESS_OFFSET);
+        mImportance.setCallback(new ImportanceSeekBarPreference.Callback() {
+            @Override
+            public void onImportanceChanged(int progress) {
+                mBackend.setImportance(mTopicRow.pkg, mTopicRow.uid, mTopicRow.topic,
+                        progress - ImportanceSeekBarPreference.IMPORTANCE_PROGRESS_OFFSET);
+            }
+        });
         mPriority.setChecked(mTopicRow.priority);
         mSensitive.setChecked(mTopicRow.sensitive);
 
@@ -167,6 +184,7 @@
         setVisible(mPriority, mIsSystemPackage || !banned);
         setVisible(mSensitive, mIsSystemPackage || !banned && lockscreenSecure
                 && lockscreenNotificationsEnabled && allowPrivate);
+        setVisible(mImportance, !banned);
     }
 
     private void setVisible(Preference p, boolean visible) {
diff --git a/src/com/android/settings/users/UserDetailsSettings.java b/src/com/android/settings/users/UserDetailsSettings.java
index 0dc87aa..9a81d16 100644
--- a/src/com/android/settings/users/UserDetailsSettings.java
+++ b/src/com/android/settings/users/UserDetailsSettings.java
@@ -145,14 +145,15 @@
             List<UserInfo> users = mUserManager.getUsers(true);
             for (UserInfo user: users) {
                 if (user.isGuest()) {
+                    UserHandle userHandle = UserHandle.of(user.id);
                     for (String key : mDefaultGuestRestrictions.keySet()) {
                         mUserManager.setUserRestriction(
-                                key, mDefaultGuestRestrictions.getBoolean(key));
+                                key, mDefaultGuestRestrictions.getBoolean(key), userHandle);
                     }
                 }
             }
         } else {
-            UserHandle userHandle = new UserHandle(mUserInfo.id);
+            UserHandle userHandle = UserHandle.of(mUserInfo.id);
             mUserManager.setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, !enabled,
                     userHandle);
             mUserManager.setUserRestriction(UserManager.DISALLOW_SMS, !enabled, userHandle);
diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java
index aaab0c5..8dfb024 100644
--- a/src/com/android/settings/wifi/AdvancedWifiSettings.java
+++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java
@@ -18,68 +18,25 @@
 
 import android.app.Dialog;
 import android.app.DialogFragment;
-import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
-import android.net.NetworkScoreManager;
-import android.net.NetworkScorerAppManager;
-import android.net.NetworkScorerAppManager.NetworkScorerAppData;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.WifiManager;
 import android.net.wifi.WpsInfo;
 import android.os.Bundle;
-import android.os.UserManager;
-import android.provider.Settings;
-import android.provider.Settings.Global;
 import android.security.Credentials;
-import android.support.v14.preference.SwitchPreference;
-import android.support.v7.preference.ListPreference;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.Preference.OnPreferenceClickListener;
-import android.text.TextUtils;
-import android.util.Log;
-import android.widget.Toast;
-
 import com.android.internal.logging.MetricsLogger;
-import com.android.settings.AppListSwitchPreference;
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
 
-import java.util.Collection;
-
-public class AdvancedWifiSettings extends SettingsPreferenceFragment
-        implements Preference.OnPreferenceChangeListener {
-
+public class AdvancedWifiSettings extends SettingsPreferenceFragment {
     private static final String TAG = "AdvancedWifiSettings";
-    private static final String KEY_MAC_ADDRESS = "mac_address";
-    private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address";
-    private static final String KEY_FREQUENCY_BAND = "frequency_band";
-    private static final String KEY_NOTIFY_OPEN_NETWORKS = "notify_open_networks";
-    private static final String KEY_SLEEP_POLICY = "sleep_policy";
+
     private static final String KEY_INSTALL_CREDENTIALS = "install_credentials";
-    private static final String KEY_WIFI_ASSISTANT = "wifi_assistant";
     private static final String KEY_WIFI_DIRECT = "wifi_direct";
     private static final String KEY_WPS_PUSH = "wps_push_button";
     private static final String KEY_WPS_PIN = "wps_pin_entry";
 
-    private WifiManager mWifiManager;
-    private NetworkScoreManager mNetworkScoreManager;
-    private AppListSwitchPreference mWifiAssistantPreference;
-
-    private IntentFilter mFilter;
-    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            String action = intent.getAction();
-            if (action.equals(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION) ||
-                action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
-                refreshWifiInfo();
-            }
-        }
-    };
-
     @Override
     protected int getMetricsCategory() {
         return MetricsLogger.WIFI_ADVANCED;
@@ -92,37 +49,13 @@
     }
 
     @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
-        mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
-        mFilter = new IntentFilter();
-        mFilter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
-        mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
-        mNetworkScoreManager =
-                (NetworkScoreManager) getSystemService(Context.NETWORK_SCORE_SERVICE);
-    }
-
-    @Override
     public void onResume() {
         super.onResume();
         initPreferences();
-        getActivity().registerReceiver(mReceiver, mFilter);
-        refreshWifiInfo();
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        getActivity().unregisterReceiver(mReceiver);
     }
 
     private void initPreferences() {
-        SwitchPreference notifyOpenNetworks =
-            (SwitchPreference) findPreference(KEY_NOTIFY_OPEN_NETWORKS);
-        notifyOpenNetworks.setChecked(Settings.Global.getInt(getContentResolver(),
-                Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1);
-        notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled());
-
+        final Context context = getActivity();
         Intent intent = new Intent(Credentials.INSTALL_AS_USER_ACTION);
         intent.setClassName("com.android.certinstaller",
                 "com.android.certinstaller.CertInstallerMain");
@@ -130,16 +63,6 @@
         Preference pref = findPreference(KEY_INSTALL_CREDENTIALS);
         pref.setIntent(intent);
 
-        final Context context = getActivity();
-        mWifiAssistantPreference = (AppListSwitchPreference) findPreference(KEY_WIFI_ASSISTANT);
-        Collection<NetworkScorerAppData> scorers =
-                NetworkScorerAppManager.getAllValidScorers(context);
-        if (UserManager.get(context).isAdminUser() && !scorers.isEmpty()) {
-            mWifiAssistantPreference.setOnPreferenceChangeListener(this);
-            initWifiAssistantPreference(scorers);
-        } else if (mWifiAssistantPreference != null) {
-            getPreferenceScreen().removePreference(mWifiAssistantPreference);
-        }
 
         Intent wifiDirectIntent = new Intent(context,
                 com.android.settings.Settings.WifiP2pSettingsActivity.class);
@@ -165,165 +88,6 @@
                     return true;
                 }
         });
-
-        ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
-
-        if (mWifiManager.isDualBandSupported()) {
-            frequencyPref.setOnPreferenceChangeListener(this);
-            int value = mWifiManager.getFrequencyBand();
-            if (value != -1) {
-                frequencyPref.setValue(String.valueOf(value));
-                updateFrequencyBandSummary(frequencyPref, value);
-            } else {
-                Log.e(TAG, "Failed to fetch frequency band");
-            }
-        } else {
-            if (frequencyPref != null) {
-                // null if it has already been removed before resume
-                getPreferenceScreen().removePreference(frequencyPref);
-            }
-        }
-
-        ListPreference sleepPolicyPref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
-        if (sleepPolicyPref != null) {
-            if (Utils.isWifiOnly(context)) {
-                sleepPolicyPref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
-            }
-            sleepPolicyPref.setOnPreferenceChangeListener(this);
-            int value = Settings.Global.getInt(getContentResolver(),
-                    Settings.Global.WIFI_SLEEP_POLICY,
-                    Settings.Global.WIFI_SLEEP_POLICY_NEVER);
-            String stringValue = String.valueOf(value);
-            sleepPolicyPref.setValue(stringValue);
-            updateSleepPolicySummary(sleepPolicyPref, stringValue);
-        }
-    }
-
-    private void initWifiAssistantPreference(Collection<NetworkScorerAppData> scorers) {
-        int count = scorers.size();
-        String[] packageNames = new String[count];
-        int i = 0;
-        for (NetworkScorerAppData scorer : scorers) {
-            packageNames[i] = scorer.mPackageName;
-            i++;
-        }
-        mWifiAssistantPreference.setPackageNames(packageNames,
-                mNetworkScoreManager.getActiveScorerPackage());
-    }
-
-    private void updateSleepPolicySummary(Preference sleepPolicyPref, String value) {
-        if (value != null) {
-            String[] values = getResources().getStringArray(R.array.wifi_sleep_policy_values);
-            final int summaryArrayResId = Utils.isWifiOnly(getActivity()) ?
-                    R.array.wifi_sleep_policy_entries_wifi_only : R.array.wifi_sleep_policy_entries;
-            String[] summaries = getResources().getStringArray(summaryArrayResId);
-            for (int i = 0; i < values.length; i++) {
-                if (value.equals(values[i])) {
-                    if (i < summaries.length) {
-                        sleepPolicyPref.setSummary(summaries[i]);
-                        return;
-                    }
-                }
-            }
-        }
-
-        sleepPolicyPref.setSummary("");
-        Log.e(TAG, "Invalid sleep policy value: " + value);
-    }
-
-    private void updateFrequencyBandSummary(Preference frequencyBandPref, int index) {
-        String[] summaries = getResources().getStringArray(R.array.wifi_frequency_band_entries);
-        frequencyBandPref.setSummary(summaries[index]);
-    }
-
-    @Override
-    public boolean onPreferenceTreeClick(Preference preference) {
-        String key = preference.getKey();
-
-        if (KEY_NOTIFY_OPEN_NETWORKS.equals(key)) {
-            Global.putInt(getContentResolver(),
-                    Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
-                    ((SwitchPreference) preference).isChecked() ? 1 : 0);
-        } else {
-            return super.onPreferenceTreeClick(preference);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean onPreferenceChange(Preference preference, Object newValue) {
-        final Context context = getActivity();
-        String key = preference.getKey();
-
-        if (KEY_FREQUENCY_BAND.equals(key)) {
-            try {
-                int value = Integer.parseInt((String) newValue);
-                mWifiManager.setFrequencyBand(value, true);
-                updateFrequencyBandSummary(preference, value);
-            } catch (NumberFormatException e) {
-                Toast.makeText(context, R.string.wifi_setting_frequency_band_error,
-                        Toast.LENGTH_SHORT).show();
-                return false;
-            }
-        } else if (KEY_WIFI_ASSISTANT.equals(key)) {
-            NetworkScorerAppData wifiAssistant =
-                    NetworkScorerAppManager.getScorer(context, (String) newValue);
-            if (wifiAssistant == null) {
-                mNetworkScoreManager.setActiveScorer(null);
-                return true;
-            }
-
-            Intent intent = new Intent();
-            if (wifiAssistant.mConfigurationActivityClassName != null) {
-                // App has a custom configuration activity; launch that.
-                // This custom activity will be responsible for launching the system
-                // dialog.
-                intent.setClassName(wifiAssistant.mPackageName,
-                        wifiAssistant.mConfigurationActivityClassName);
-            } else {
-                // Fall back on the system dialog.
-                intent.setAction(NetworkScoreManager.ACTION_CHANGE_ACTIVE);
-                intent.putExtra(NetworkScoreManager.EXTRA_PACKAGE_NAME,
-                        wifiAssistant.mPackageName);
-            }
-
-            startActivity(intent);
-            // Don't update the preference widget state until the child activity returns.
-            // It will be updated in onResume after the activity finishes.
-            return false;
-        }
-
-        if (KEY_SLEEP_POLICY.equals(key)) {
-            try {
-                String stringValue = (String) newValue;
-                Settings.Global.putInt(getContentResolver(), Settings.Global.WIFI_SLEEP_POLICY,
-                        Integer.parseInt(stringValue));
-                updateSleepPolicySummary(preference, stringValue);
-            } catch (NumberFormatException e) {
-                Toast.makeText(context, R.string.wifi_setting_sleep_policy_error,
-                        Toast.LENGTH_SHORT).show();
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    private void refreshWifiInfo() {
-        final Context context = getActivity();
-        WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
-
-        Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS);
-        String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
-        wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
-                : context.getString(R.string.status_unavailable));
-        wifiMacAddressPref.setSelectable(false);
-
-        Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);
-        String ipAddress = Utils.getWifiIpAddresses(context);
-        wifiIpAddressPref.setSummary(ipAddress == null ?
-                context.getString(R.string.status_unavailable) : ipAddress);
-        wifiIpAddressPref.setSelectable(false);
     }
 
     /* Wrapper class for the WPS dialog to properly handle life cycle events like rotation. */
diff --git a/src/com/android/settings/wifi/ConfigureWifiSettings.java b/src/com/android/settings/wifi/ConfigureWifiSettings.java
new file mode 100644
index 0000000..54ce036
--- /dev/null
+++ b/src/com/android/settings/wifi/ConfigureWifiSettings.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.settings.wifi;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.NetworkScoreManager;
+import android.net.NetworkScorerAppManager;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.os.UserManager;
+import android.provider.Settings;
+import android.support.v14.preference.SwitchPreference;
+import android.support.v7.preference.ListPreference;
+import android.support.v7.preference.Preference;
+import android.text.TextUtils;
+import android.util.Log;
+import android.widget.Toast;
+import com.android.settings.AppListSwitchPreference;
+import com.android.settings.InstrumentedFragment;
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
+
+import java.util.Collection;
+import java.util.List;
+
+public class ConfigureWifiSettings extends SettingsPreferenceFragment
+        implements Preference.OnPreferenceChangeListener {
+    private static final String TAG = "ConfigureWifiSettings";
+
+    private static final String KEY_MAC_ADDRESS = "mac_address";
+    private static final String KEY_SAVED_NETWORKS = "saved_networks";
+    private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address";
+    private static final String KEY_FREQUENCY_BAND = "frequency_band";
+    private static final String KEY_NOTIFY_OPEN_NETWORKS = "notify_open_networks";
+    private static final String KEY_SLEEP_POLICY = "sleep_policy";
+    private static final String KEY_WIFI_ASSISTANT = "wifi_assistant";
+
+    private WifiManager mWifiManager;
+    private NetworkScoreManager mNetworkScoreManager;
+    private AppListSwitchPreference mWifiAssistantPreference;
+
+    private IntentFilter mFilter;
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+        addPreferencesFromResource(R.xml.wifi_configure_settings);
+    }
+
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+        mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+        mFilter = new IntentFilter();
+        mFilter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
+        mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+        mNetworkScoreManager =
+                (NetworkScoreManager) getSystemService(Context.NETWORK_SCORE_SERVICE);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        initPreferences();
+        getActivity().registerReceiver(mReceiver, mFilter);
+        refreshWifiInfo();
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+        getActivity().unregisterReceiver(mReceiver);
+    }
+
+    private void initPreferences() {
+        List<WifiConfiguration> configs = mWifiManager.getConfiguredNetworks();
+        if (configs == null || configs.size() == 0) {
+            removePreference(KEY_SAVED_NETWORKS);
+        }
+
+        SwitchPreference notifyOpenNetworks =
+                (SwitchPreference) findPreference(KEY_NOTIFY_OPEN_NETWORKS);
+        notifyOpenNetworks.setChecked(Settings.Global.getInt(getContentResolver(),
+                Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1);
+        notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled());
+
+        final Context context = getActivity();
+        mWifiAssistantPreference = (AppListSwitchPreference) findPreference(KEY_WIFI_ASSISTANT);
+        Collection<NetworkScorerAppManager.NetworkScorerAppData> scorers =
+                NetworkScorerAppManager.getAllValidScorers(context);
+        if (UserManager.get(context).isAdminUser() && !scorers.isEmpty()) {
+            mWifiAssistantPreference.setOnPreferenceChangeListener(this);
+            initWifiAssistantPreference(scorers);
+        } else if (mWifiAssistantPreference != null) {
+            getPreferenceScreen().removePreference(mWifiAssistantPreference);
+        }
+
+        ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
+
+        if (mWifiManager.isDualBandSupported()) {
+            frequencyPref.setOnPreferenceChangeListener(this);
+            int value = mWifiManager.getFrequencyBand();
+            if (value != -1) {
+                frequencyPref.setValue(String.valueOf(value));
+                updateFrequencyBandSummary(frequencyPref, value);
+            } else {
+                Log.e(TAG, "Failed to fetch frequency band");
+            }
+        } else {
+            if (frequencyPref != null) {
+                // null if it has already been removed before resume
+                getPreferenceScreen().removePreference(frequencyPref);
+            }
+        }
+
+        ListPreference sleepPolicyPref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
+        if (sleepPolicyPref != null) {
+            if (Utils.isWifiOnly(context)) {
+                sleepPolicyPref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
+            }
+            sleepPolicyPref.setOnPreferenceChangeListener(this);
+            int value = Settings.Global.getInt(getContentResolver(),
+                    Settings.Global.WIFI_SLEEP_POLICY,
+                    Settings.Global.WIFI_SLEEP_POLICY_NEVER);
+            String stringValue = String.valueOf(value);
+            sleepPolicyPref.setValue(stringValue);
+            updateSleepPolicySummary(sleepPolicyPref, stringValue);
+        }
+    }
+
+    private void updateSleepPolicySummary(Preference sleepPolicyPref, String value) {
+        if (value != null) {
+            String[] values = getResources().getStringArray(R.array.wifi_sleep_policy_values);
+            final int summaryArrayResId = Utils.isWifiOnly(getActivity()) ?
+                    R.array.wifi_sleep_policy_entries_wifi_only : R.array.wifi_sleep_policy_entries;
+            String[] summaries = getResources().getStringArray(summaryArrayResId);
+            for (int i = 0; i < values.length; i++) {
+                if (value.equals(values[i])) {
+                    if (i < summaries.length) {
+                        sleepPolicyPref.setSummary(summaries[i]);
+                        return;
+                    }
+                }
+            }
+        }
+
+        sleepPolicyPref.setSummary("");
+        Log.e(TAG, "Invalid sleep policy value: " + value);
+    }
+
+    @Override
+    public boolean onPreferenceTreeClick(Preference preference) {
+        String key = preference.getKey();
+
+        if (KEY_NOTIFY_OPEN_NETWORKS.equals(key)) {
+            Settings.Global.putInt(getContentResolver(),
+                    Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+                    ((SwitchPreference) preference).isChecked() ? 1 : 0);
+        } else {
+            return super.onPreferenceTreeClick(preference);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean onPreferenceChange(Preference preference, Object newValue) {
+        final Context context = getActivity();
+        String key = preference.getKey();
+
+        if (KEY_FREQUENCY_BAND.equals(key)) {
+            try {
+                int value = Integer.parseInt((String) newValue);
+                mWifiManager.setFrequencyBand(value, true);
+                updateFrequencyBandSummary(preference, value);
+            } catch (NumberFormatException e) {
+                Toast.makeText(context, R.string.wifi_setting_frequency_band_error,
+                        Toast.LENGTH_SHORT).show();
+                return false;
+            }
+        } else if (KEY_WIFI_ASSISTANT.equals(key)) {
+            NetworkScorerAppManager.NetworkScorerAppData wifiAssistant =
+                    NetworkScorerAppManager.getScorer(context, (String) newValue);
+            if (wifiAssistant == null) {
+                mNetworkScoreManager.setActiveScorer(null);
+                return true;
+            }
+
+            Intent intent = new Intent();
+            if (wifiAssistant.mConfigurationActivityClassName != null) {
+                // App has a custom configuration activity; launch that.
+                // This custom activity will be responsible for launching the system
+                // dialog.
+                intent.setClassName(wifiAssistant.mPackageName,
+                        wifiAssistant.mConfigurationActivityClassName);
+            } else {
+                // Fall back on the system dialog.
+                intent.setAction(NetworkScoreManager.ACTION_CHANGE_ACTIVE);
+                intent.putExtra(NetworkScoreManager.EXTRA_PACKAGE_NAME,
+                        wifiAssistant.mPackageName);
+            }
+
+            startActivity(intent);
+            // Don't update the preference widget state until the child activity returns.
+            // It will be updated in onResume after the activity finishes.
+            return false;
+        }
+
+        if (KEY_SLEEP_POLICY.equals(key)) {
+            try {
+                String stringValue = (String) newValue;
+                Settings.Global.putInt(getContentResolver(), Settings.Global.WIFI_SLEEP_POLICY,
+                        Integer.parseInt(stringValue));
+                updateSleepPolicySummary(preference, stringValue);
+            } catch (NumberFormatException e) {
+                Toast.makeText(context, R.string.wifi_setting_sleep_policy_error,
+                        Toast.LENGTH_SHORT).show();
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private void refreshWifiInfo() {
+        final Context context = getActivity();
+        WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
+
+        Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS);
+        String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
+        wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
+                : context.getString(R.string.status_unavailable));
+        wifiMacAddressPref.setSelectable(false);
+
+        Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);
+        String ipAddress = Utils.getWifiIpAddresses(context);
+        wifiIpAddressPref.setSummary(ipAddress == null ?
+                context.getString(R.string.status_unavailable) : ipAddress);
+        wifiIpAddressPref.setSelectable(false);
+    }
+
+    private void updateFrequencyBandSummary(Preference frequencyBandPref, int index) {
+        String[] summaries = getResources().getStringArray(R.array.wifi_frequency_band_entries);
+        frequencyBandPref.setSummary(summaries[index]);
+    }
+
+    private void initWifiAssistantPreference(
+            Collection<NetworkScorerAppManager.NetworkScorerAppData> scorers) {
+        int count = scorers.size();
+        String[] packageNames = new String[count];
+        int i = 0;
+        for (NetworkScorerAppManager.NetworkScorerAppData scorer : scorers) {
+            packageNames[i] = scorer.mPackageName;
+            i++;
+        }
+        mWifiAssistantPreference.setPackageNames(packageNames,
+                mNetworkScoreManager.getActiveScorerPackage());
+    }
+
+    @Override
+    protected int getMetricsCategory() {
+        return InstrumentedFragment.CONFIGURE_WIFI;
+    }
+
+    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String action = intent.getAction();
+            if (action.equals(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION) ||
+                action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
+                refreshWifiInfo();
+            }
+        }
+    };
+}
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 74d3e51..87f72f5 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -32,7 +32,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.Resources;
-import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.net.NetworkInfo.State;
@@ -47,9 +47,11 @@
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceViewHolder;
 import android.text.Spannable;
 import android.text.style.TextAppearanceSpan;
 import android.util.Log;
+import android.util.TypedValue;
 import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.Gravity;
@@ -99,14 +101,13 @@
 
     /* package */ static final int MENU_ID_WPS_PBC = Menu.FIRST;
     private static final int MENU_ID_WPS_PIN = Menu.FIRST + 1;
-    private static final int MENU_ID_SAVED_NETWORK = Menu.FIRST + 2;
-    /* package */ static final int MENU_ID_ADD_NETWORK = Menu.FIRST + 3;
     private static final int MENU_ID_ADVANCED = Menu.FIRST + 4;
     private static final int MENU_ID_SCAN = Menu.FIRST + 5;
     private static final int MENU_ID_CONNECT = Menu.FIRST + 6;
     private static final int MENU_ID_FORGET = Menu.FIRST + 7;
     private static final int MENU_ID_MODIFY = Menu.FIRST + 8;
     private static final int MENU_ID_WRITE_NFC = Menu.FIRST + 9;
+    private static final int MENU_ID_CONFIGURE = Menu.FIRST + 10;
 
     public static final int WIFI_DIALOG_ID = 1;
     /* package */ static final int WPS_PBC_DIALOG_ID = 2;
@@ -118,8 +119,6 @@
     private static final String SAVE_DIALOG_ACCESS_POINT_STATE = "wifi_ap_state";
     private static final String SAVED_WIFI_NFC_DIALOG_STATE = "wifi_nfc_dlg_state";
 
-    private static boolean savedNetworksExist;
-
     protected WifiManager mWifiManager;
     private WifiManager.ActionListener mConnectListener;
     private WifiManager.ActionListener mSaveListener;
@@ -157,6 +156,7 @@
     private HandlerThread mBgThread;
 
     private UserBadgeCache mUserBadgeCache;
+    private Preference mAddPreference;
 
     /* End of "used in Wifi Setup context" */
 
@@ -177,6 +177,14 @@
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         addPreferencesFromResource(R.xml.wifi_settings);
+        mAddPreference = new Preference(getContext());
+        Drawable ic_add = getContext().getDrawable(R.drawable.ic_menu_add).mutate();
+        TypedValue tv = new TypedValue();
+        getContext().getTheme().resolveAttribute(android.R.attr.colorAccent, tv, true);
+        ic_add.setTint(getContext().getColor(tv.resourceId));
+        mAddPreference.setIcon(ic_add);
+        mAddPreference.setTitle(R.string.wifi_add_network);
+
         mUserBadgeCache = new UserBadgeCache(getPackageManager());
 
         mBgThread = new HandlerThread(TAG, Process.THREAD_PRIORITY_BACKGROUND);
@@ -343,24 +351,14 @@
      */
     void addOptionsMenuItems(Menu menu) {
         final boolean wifiIsEnabled = mWifiTracker.isWifiEnabled();
-        TypedArray ta = getActivity().getTheme().obtainStyledAttributes(
-                new int[] {R.attr.ic_menu_add, R.attr.ic_wps});
-        menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
-                .setIcon(ta.getDrawable(0))
-                .setEnabled(wifiIsEnabled)
-                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-        if (savedNetworksExist) {
-            menu.add(Menu.NONE, MENU_ID_SAVED_NETWORK, 0, R.string.wifi_saved_access_points_label)
-                    .setIcon(ta.getDrawable(0))
-                    .setEnabled(wifiIsEnabled)
-                    .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-        }
         menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.menu_stats_refresh)
                .setEnabled(wifiIsEnabled)
                .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
         menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
                 .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-        ta.recycle();
+        menu.add(Menu.NONE, MENU_ID_CONFIGURE, 0, R.string.wifi_menu_configure)
+                .setIcon(R.drawable.ic_settings_24dp)
+                .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
     }
 
     @Override
@@ -419,22 +417,6 @@
                 MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_FORCE_SCAN);
                 mWifiTracker.forceScan();
                 return true;
-            case MENU_ID_ADD_NETWORK:
-                if (mWifiTracker.isWifiEnabled()) {
-                    onAddNetworkPressed();
-                }
-                return true;
-            case MENU_ID_SAVED_NETWORK:
-                if (getActivity() instanceof SettingsActivity) {
-                    ((SettingsActivity) getActivity()).startPreferencePanel(
-                            SavedAccessPointsWifiSettings.class.getCanonicalName(), null,
-                            R.string.wifi_saved_access_points_titlebar, null, this, 0);
-                } else {
-                    startFragment(this, SavedAccessPointsWifiSettings.class.getCanonicalName(),
-                            R.string.wifi_saved_access_points_titlebar,
-                            -1 /* Do not request a result */, null);
-                }
-                return true;
             case MENU_ID_ADVANCED:
                 if (getActivity() instanceof SettingsActivity) {
                     ((SettingsActivity) getActivity()).startPreferencePanel(
@@ -446,6 +428,18 @@
                             null);
                 }
                 return true;
+            case MENU_ID_CONFIGURE:
+                if (getActivity() instanceof SettingsActivity) {
+                    ((SettingsActivity) getActivity()).startPreferencePanel(
+                            ConfigureWifiSettings.class.getCanonicalName(), null,
+                            R.string.wifi_configure_titlebar, null, this, 0);
+                } else {
+                    startFragment(this, ConfigureWifiSettings.class.getCanonicalName(),
+                            R.string.wifi_configure_titlebar, -1 /* Do not request a results */,
+                            null);
+                }
+                return true;
+
         }
         return super.onOptionsItemSelected(item);
     }
@@ -530,16 +524,14 @@
             if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE &&
                     !mSelectedAccessPoint.isSaved() && !mSelectedAccessPoint.isActive()) {
                 mSelectedAccessPoint.generateOpenNetworkConfig();
-                if (!savedNetworksExist) {
-                    savedNetworksExist = true;
-                    getActivity().invalidateOptionsMenu();
-                }
                 connect(mSelectedAccessPoint.getConfig());
-            } else if (mSelectedAccessPoint.isSaved()){
+            } else if (mSelectedAccessPoint.isSaved()) {
                 showDialog(mSelectedAccessPoint, WifiConfigUiBase.MODE_VIEW);
             } else {
                 showDialog(mSelectedAccessPoint, WifiConfigUiBase.MODE_CONNECT);
             }
+        } else if (preference == mAddPreference) {
+            onAddNetworkPressed();
         } else {
             return super.onPreferenceTreeClick(preference);
         }
@@ -678,8 +670,23 @@
                 }
                 if (!hasAvailableAccessPoints) {
                     setProgressBarVisible(true);
-                    addMessagePreference(R.string.wifi_empty_list_wifi_on);
+                    Preference pref = new Preference(getContext()) {
+                        @Override
+                        public void onBindViewHolder(PreferenceViewHolder holder) {
+                            super.onBindViewHolder(holder);
+                            // Show a line on each side of add network.
+                            holder.setDividerAllowedBelow(true);
+                        }
+                    };
+                    pref.setSelectable(false);
+                    pref.setSummary(R.string.wifi_empty_list_wifi_on);
+                    pref.setOrder(0);
+                    getPreferenceScreen().addPreference(pref);
+                    mAddPreference.setOrder(1);
+                    getPreferenceScreen().addPreference(mAddPreference);
                 } else {
+                    mAddPreference.setOrder(index++);
+                    getPreferenceScreen().addPreference(mAddPreference);
                     setProgressBarVisible(false);
                 }
                 break;
@@ -699,11 +706,6 @@
                 setProgressBarVisible(false);
                 break;
         }
-        // Update "Saved Networks" menu option.
-        if (savedNetworksExist != mWifiTracker.doSavedNetworksExist()) {
-            savedNetworksExist = !savedNetworksExist;
-            getActivity().invalidateOptionsMenu();
-        }
     }
 
     protected TextView initEmptyView() {
@@ -768,11 +770,6 @@
 
     @Override
     public void onWifiStateChanged(int state) {
-        Activity activity = getActivity();
-        if (activity != null) {
-            activity.invalidateOptionsMenu();
-        }
-
         switch (state) {
             case WifiManager.WIFI_STATE_ENABLING:
                 addMessagePreference(R.string.wifi_starting);
diff --git a/src/com/android/settings/wifi/WifiStatusTest.java b/src/com/android/settings/wifi/WifiStatusTest.java
index 38b3a15..4577496 100644
--- a/src/com/android/settings/wifi/WifiStatusTest.java
+++ b/src/com/android/settings/wifi/WifiStatusTest.java
@@ -148,8 +148,7 @@
         mScanList = (TextView) findViewById(R.id.scan_list);
 
 
-        mPingIpAddr = (TextView) findViewById(R.id.pingIpAddr);
-        mPingHostname = (TextView) findViewById(R.id.pingHostname);
+        mPingHostname = (TextView) findViewById(R.id.pingHostnameV4);
         mHttpClientTest = (TextView) findViewById(R.id.httpClientTest);
 
         pingTestButton = (Button) findViewById(R.id.ping_test);
@@ -317,19 +316,10 @@
 
         final Runnable updatePingResults = new Runnable() {
             public void run() {
-                mPingIpAddr.setText(mPingIpAddrResult);
                 mPingHostname.setText(mPingHostnameResult);
                 mHttpClientTest.setText(mHttpClientTestResult);
             }
         };
-        Thread ipAddrThread = new Thread() {
-            @Override
-            public void run() {
-                pingIpAddr();
-                handler.post(updatePingResults);
-            }
-        };
-        ipAddrThread.start();
 
         Thread hostnameThread = new Thread() {
             @Override
@@ -350,28 +340,6 @@
         httpClientThread.start();
     }
 
-    /**
-     * The ping functions have been borrowed from Radio diagnostic app to
-     * enable quick access on the wifi status screen
-     */
-    private final void pingIpAddr() {
-        try {
-            // TODO: Hardcoded for now, make it UI configurable
-            String ipAddress = "74.125.47.104";
-            Process p = Runtime.getRuntime().exec("ping -c 1 -w 100 " + ipAddress);
-            int status = p.waitFor();
-            if (status == 0) {
-                mPingIpAddrResult = "Pass";
-            } else {
-                mPingIpAddrResult = "Fail: IP addr not reachable";
-            }
-        } catch (IOException e) {
-            mPingIpAddrResult = "Fail: IOException";
-        } catch (InterruptedException e) {
-            mPingIpAddrResult = "Fail: InterruptedException";
-        }
-    }
-
     private final void pingHostname() {
         try {
             // TODO: Hardcoded for now, make it UI configurable
diff --git a/src/com/android/settings/wifi/p2p/WifiP2pPeer.java b/src/com/android/settings/wifi/p2p/WifiP2pPeer.java
index d4b50e6..a318e6f 100644
--- a/src/com/android/settings/wifi/p2p/WifiP2pPeer.java
+++ b/src/com/android/settings/wifi/p2p/WifiP2pPeer.java
@@ -23,7 +23,6 @@
 import android.support.v7.preference.PreferenceViewHolder;
 import android.text.TextUtils;
 import android.widget.ImageView;
-
 import com.android.settings.R;
 
 public class WifiP2pPeer extends Preference {
@@ -41,15 +40,18 @@
         device = dev;
         setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
         mRssi = 60; //TODO: fix
-    }
-
-    @Override
-    public void onBindViewHolder(PreferenceViewHolder view) {
         if (TextUtils.isEmpty(device.deviceName)) {
             setTitle(device.deviceAddress);
         } else {
             setTitle(device.deviceName);
         }
+        String[] statusArray = context.getResources().getStringArray(R.array.wifi_p2p_status);
+        setSummary(statusArray[device.status]);
+    }
+
+    @Override
+    public void onBindViewHolder(PreferenceViewHolder view) {
+        super.onBindViewHolder(view);
         mSignal = (ImageView) view.findViewById(R.id.signal);
         if (mRssi == Integer.MAX_VALUE) {
             mSignal.setImageDrawable(null);
@@ -57,8 +59,7 @@
             mSignal.setImageResource(R.drawable.wifi_signal_dark);
             mSignal.setImageState(STATE_SECURED,  true);
         }
-        refresh();
-        super.onBindViewHolder(view);
+        mSignal.setImageLevel(getLevel());
     }
 
     @Override
@@ -87,14 +88,4 @@
         }
         return WifiManager.calculateSignalLevel(mRssi, SIGNAL_LEVELS);
     }
-
-    private void refresh() {
-        if (mSignal == null) {
-            return;
-        }
-        Context context = getContext();
-        mSignal.setImageLevel(getLevel());
-        String[] statusArray = context.getResources().getStringArray(R.array.wifi_p2p_status);
-        setSummary(statusArray[device.status]);
-    }
 }