Change to use the expand button in support lib.

- functionality for hiding portions of the preferences in the preference
screen is added to the support lib. So, changing the settings
implementation to use the feature from the support lib instead.
- remove ProgressiveDisclosureMixin and the related code

Fixes: 63985174
Test: make RunSettingsRoboTests
Change-Id: Ib1d39b2db93d78a56c7adf90abcae5226f9564c2
diff --git a/res/layout/expand_preference.xml b/res/layout/expand_preference.xml
deleted file mode 100644
index 729dfd9..0000000
--- a/res/layout/expand_preference.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 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.
-  -->
-
-<!-- Based off frameworks/base/core/res/res/layout/preference_material.xml -->
-<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:background="?android:attr/selectableItemBackground"
-    android:clipToPadding="false">
-
-    <LinearLayout
-        android:id="@+id/icon_frame"
-        style="@style/preference_icon_frame"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:gravity="start|center_vertical"
-        android:orientation="horizontal"
-        android:paddingEnd="12dp"
-        android:paddingTop="4dp"
-        android:paddingBottom="4dp">
-        <com.android.internal.widget.PreferenceImageView
-            android:id="@android:id/icon"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:maxWidth="48dp"
-            android:maxHeight="48dp"/>
-    </LinearLayout>
-
-    <RelativeLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:paddingTop="16dp"
-        android:paddingBottom="16dp">
-
-        <TextView
-            android:id="@android:id/title"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceListItem"
-            android:ellipsize="marquee"/>
-
-        <TextView
-            android:id="@android:id/summary"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@android:id/title"
-            android:layout_alignStart="@android:id/title"
-            android:textAppearance="?android:attr/textAppearanceListItemSecondary"
-            android:textColor="?android:attr/textColorSecondary"
-            android:ellipsize="marquee"
-            android:maxLines="1"/>
-
-    </RelativeLayout>
-
-</LinearLayout>
diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml
index 2930c83..f598547 100644
--- a/res/xml/app_and_notification.xml
+++ b/res/xml/app_and_notification.xml
@@ -19,7 +19,8 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
     android:key="apps_and_notification_screen"
-    android:title="@string/app_and_notification_dashboard_title">
+    android:title="@string/app_and_notification_dashboard_title"
+    settings:initialExpandedChildrenCount="4">
 
     <PreferenceCategory
         android:key="recent_apps_category"
diff --git a/res/xml/app_and_notification_new_advance_button.xml b/res/xml/app_and_notification_new_advance_button.xml
deleted file mode 100644
index c7b91e8..0000000
--- a/res/xml/app_and_notification_new_advance_button.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 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"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-    android:title="@string/app_and_notification_dashboard_title"
-    android:key="apps_and_notification_screen"
-    settings:initialExpandedChildrenCount="4">
-
-    <PreferenceCategory
-        android:key="recent_apps_category"
-        android:title="@string/recent_app_category_title"
-        android:order="-200">
-        <!-- Placeholder for a list of recent apps -->
-
-        <!-- See all apps button -->
-        <Preference
-            android:title="@string/applications_settings"
-            android:key="all_app_info"
-            android:order="20">
-            <intent
-                android:action="android.intent.action.MAIN"
-                android:targetPackage="com.android.settings"
-                android:targetClass="com.android.settings.Settings$ManageApplicationsActivity">
-                <extra android:name="show_drawer_menu" android:value="true" />
-            </intent>
-        </Preference>
-    </PreferenceCategory>
-
-    <!-- Empty category to draw divider -->
-    <PreferenceCategory
-        android:key="all_app_info_divider"
-        android:order="-190"/>
-
-    <Preference
-        android:key="manage_perms"
-        android:title="@string/app_permissions"
-        android:order="-130"
-        settings:keywords="@string/keywords_app_permissions">
-        <intent android:action="android.intent.action.MANAGE_PERMISSIONS" />
-    </Preference>
-
-    <PreferenceCategory
-        android:key="dashboard_tile_placeholder"
-        android:order="10" />
-
-    <com.android.settingslib.RestrictedPreference
-        android:key="app_and_notif_cell_broadcast_settings"
-        android:title="@string/cell_broadcast_settings"
-        android:order="15"
-        settings:useAdminDisabledSummary="true">
-        <intent
-            android:action="android.intent.action.MAIN"
-            android:targetPackage="com.android.cellbroadcastreceiver"
-            android:targetClass="com.android.cellbroadcastreceiver.CellBroadcastSettings" />
-    </com.android.settingslib.RestrictedPreference>
-
-    <Preference
-        android:key="special_access"
-        android:title="@string/special_access"
-        android:order="20" >
-        <intent
-            android:action="android.intent.action.MAIN"
-            android:targetPackage="com.android.settings"
-            android:targetClass="com.android.settings.Settings$SpecialAccessSettingsActivity" />
-    </Preference>
-
-</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index aa03bc7e..3685671 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -19,7 +19,8 @@
     xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
     android:key="display_settings_screen"
     android:title="@string/display_settings"
-    settings:keywords="@string/keywords_display">
+    settings:keywords="@string/keywords_display"
+    settings:initialExpandedChildrenCount="4">
 
     <Preference
         android:key="brightness"
diff --git a/res/xml/display_settings_new_advance_button.xml b/res/xml/display_settings_new_advance_button.xml
deleted file mode 100644
index c7cf505..0000000
--- a/res/xml/display_settings_new_advance_button.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-    android:title="@string/display_settings"
-    settings:keywords="@string/keywords_display"
-    android:key="display_settings_screen"
-    settings:initialExpandedChildrenCount="4">
-
-    <Preference
-        android:key="brightness"
-        android:title="@string/brightness"
-        settings:keywords="@string/keywords_display_brightness_level">
-        <intent android:action="com.android.intent.action.SHOW_BRIGHTNESS_DIALOG" />
-    </Preference>
-
-    <com.android.settings.display.NightDisplayPreference
-        android:key="night_display"
-        android:title="@string/night_display_title"
-        android:fragment="com.android.settings.display.NightDisplaySettings"
-        android:widgetLayout="@null"
-        settings:widgetLayout="@null"
-        settings:keywords="@string/keywords_display_night_display" />
-
-    <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
-    <SwitchPreference
-        android:key="auto_brightness"
-        android:title="@string/auto_brightness_title"
-        settings:keywords="@string/keywords_display_auto_brightness"
-        android:summary="@string/auto_brightness_summary" />
-
-    <com.android.settingslib.RestrictedPreference
-        android:key="wallpaper"
-        android:title="@string/wallpaper_settings_title"
-        settings:keywords="@string/keywords_display_wallpaper"
-        settings:useAdminDisabledSummary="true">
-        <intent
-            android:targetPackage="@string/config_wallpaper_picker_package"
-            android:targetClass="@string/config_wallpaper_picker_class" />
-    </com.android.settingslib.RestrictedPreference>
-
-    <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
-    <com.android.settings.TimeoutListPreference
-        android:key="screen_timeout"
-        android:title="@string/screen_timeout"
-        android:summary="@string/summary_placeholder"
-        android:entries="@array/screen_timeout_entries"
-        android:entryValues="@array/screen_timeout_values" />
-
-    <SwitchPreference
-        android:key="auto_rotate"
-        android:title="@string/accelerometer_title" />
-
-    <SwitchPreference
-        android:key="color_mode"
-        android:title="@string/color_mode_title" />
-
-    <Preference
-        android:key="font_size"
-        android:title="@string/title_font_size"
-        android:fragment="com.android.settings.accessibility.ToggleFontSizePreferenceFragment"
-        settings:keywords="@string/keywords_display_font_size" />
-
-    <com.android.settings.display.ScreenZoomPreference
-        android:key="screen_zoom"
-        android:title="@string/screen_zoom_title"
-        settings:keywords="@string/screen_zoom_keywords" />
-
-    <Preference
-        android:key="screensaver"
-        android:title="@string/screensaver_settings_title"
-        android:fragment="com.android.settings.dream.DreamSettings" />
-
-    <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
-    <Preference
-        android:key="ambient_display"
-        android:title="@string/ambient_display_screen_title"
-        android:fragment="com.android.settings.display.AmbientDisplaySettings" />
-
-    <!-- Hide night mode for now
-    <ListPreference
-        android:key="night_mode"
-        android:title="@string/night_mode_title"
-        settings:keywords="@string/keywords_display_night_mode"
-        android:summary="@string/night_mode_summary"
-        android:entries="@array/night_mode_entries"
-        android:entryValues="@array/night_mode_values" /> -->
-
-    <SwitchPreference
-        android:key="camera_gesture"
-        android:title="@string/camera_gesture_title"
-        android:summary="@string/camera_gesture_desc" />
-
-    <SwitchPreference
-        android:key="lift_to_wake"
-        android:title="@string/lift_to_wake_title" />
-
-    <SwitchPreference
-        android:key="tap_to_wake"
-        android:title="@string/tap_to_wake"
-        android:summary="@string/tap_to_wake_summary" />
-
-    <ListPreference
-        android:key="theme"
-        android:title="@string/device_theme"
-        android:summary="@string/summary_placeholder" />
-
-    <Preference
-        android:key="vr_display_pref"
-        android:title="@string/display_vr_pref_title"
-        android:fragment="com.android.settings.display.VrDisplayPreferencePicker" />
-
-</PreferenceScreen>
diff --git a/res/xml/installed_app_details.xml b/res/xml/installed_app_details.xml
index 0836c19..42822c0 100644
--- a/res/xml/installed_app_details.xml
+++ b/res/xml/installed_app_details.xml
@@ -17,7 +17,9 @@
 
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:key="installed_app_detail_settings_screen"
+    app:initialExpandedChildrenCount="6">
 
     <com.android.settings.applications.LayoutPreference
         android:key="header_view"
diff --git a/res/xml/language_and_input.xml b/res/xml/language_and_input.xml
index d3c8dc5..24006c2 100644
--- a/res/xml/language_and_input.xml
+++ b/res/xml/language_and_input.xml
@@ -19,7 +19,8 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
     android:key="language_and_input_settings_screen"
-    android:title="@string/language_settings" >
+    android:title="@string/language_settings"
+    settings:initialExpandedChildrenCount="3" >
 
     <Preference
         android:key="phone_language"
diff --git a/res/xml/language_and_input_new_advance_button.xml b/res/xml/language_and_input_new_advance_button.xml
deleted file mode 100644
index 108f334..0000000
--- a/res/xml/language_and_input_new_advance_button.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 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"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-    android:title="@string/language_settings"
-    android:key="language_and_input_settings_screen"
-    settings:initialExpandedChildrenCount="3" >
-
-    <Preference
-        android:key="phone_language"
-        android:title="@string/phone_language"
-        android:icon="@drawable/ic_translate_24dp"
-        android:fragment="com.android.settings.localepicker.LocaleListEditor"/>
-
-    <PreferenceCategory
-        android:key="keyboards_category"
-        android:title="@string/keyboard_and_input_methods_category">
-        <Preference
-            android:key="virtual_keyboard_pref"
-            android:title="@string/virtual_keyboard_category"
-            android:fragment="com.android.settings.inputmethod.VirtualKeyboardFragment"/>
-        <Preference
-            android:key="physical_keyboard_pref"
-            android:title="@string/physical_keyboard_title"
-            android:summary="@string/summary_placeholder"
-            android:fragment="com.android.settings.inputmethod.PhysicalKeyboardFragment"/>
-    </PreferenceCategory>
-
-    <PreferenceCategory
-        android:key="input_assistance_category"
-        android:title="@string/input_assistance">
-        <!-- Spell checker preference title, summary and fragment will be set programmatically. -->
-        <!-- Note: Mark this as persistent="false" to remove unnecessarily saved shared preference.
-             See: InputMethodAndSubtypeUtil.removeUnnecessaryNonPersistentPreference. -->
-        <Preference
-            android:key="spellcheckers_settings"
-            android:title="@string/spellcheckers_settings_title"
-            android:persistent="false"
-            android:fragment="com.android.settings.inputmethod.SpellCheckersSettings"/>
-
-        <com.android.settings.widget.GearPreference
-            android:key="default_autofill"
-            android:title="@string/autofill_app"
-            android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
-            settings:keywords="@string/autofill_keywords" />
-
-        <!-- User dictionary preference title and fragment will be set programmatically. -->
-        <Preference
-            android:key="key_user_dictionary_settings"
-            android:title="@string/user_dict_settings_title"/>
-    </PreferenceCategory>
-
-    <PreferenceCategory
-        android:key="pointer_and_tts_category">
-
-        <com.android.settings.PointerSpeedPreference
-            android:key="pointer_speed"
-            android:title="@string/pointer_speed"
-            android:dialogTitle="@string/pointer_speed"/>
-
-        <Preference
-            android:key="tts_settings_summary"
-            android:title="@string/tts_settings_title"
-            android:fragment="com.android.settings.tts.TextToSpeechSettings"/>
-
-    </PreferenceCategory>
-
-    <PreferenceCategory
-        android:key="game_controller_settings_category"
-        android:title="@string/game_controller_settings_category">
-
-        <SwitchPreference
-            android:key="vibrate_input_devices"
-            android:title="@string/vibrate_input_devices"
-            android:summary="@string/vibrate_input_devices_summary" />
-
-    </PreferenceCategory>
-
-</PreferenceScreen>
diff --git a/res/xml/security_settings.xml b/res/xml/security_settings.xml
index 228b7f1..aa4ca9d 100644
--- a/res/xml/security_settings.xml
+++ b/res/xml/security_settings.xml
@@ -14,7 +14,11 @@
      limitations under the License.
 -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-        android:title="@string/security_settings_title">
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+    android:key="security_dashboard_page"
+    android:title="@string/security_settings_title"
+    settings:initialExpandedChildrenCount="9">
 
 </PreferenceScreen>
diff --git a/res/xml/security_settings_advanced_button.xml b/res/xml/security_settings_advanced_button.xml
deleted file mode 100644
index 787b64e..0000000
--- a/res/xml/security_settings_advanced_button.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-    android:key="security_dashboard_page"
-    android:title="@string/security_settings_title"
-    settings:initialExpandedChildrenCount="9">
-
-</PreferenceScreen>
diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml
index 578edf6..db88a8f 100644
--- a/res/xml/sound_settings.xml
+++ b/res/xml/sound_settings.xml
@@ -19,59 +19,62 @@
     xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
     android:title="@string/sound_settings"
     android:key="sound_settings"
-    settings:keywords="@string/keywords_sounds">
+    settings:keywords="@string/keywords_sounds"
+    settings:initialExpandedChildrenCount="6">
 
-    <PreferenceCategory
-        android:key="sound_settings_primary_items_category"
-        android:order="-100">
-        <!-- Media volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="media_volume"
-                android:icon="@*android:drawable/ic_audio_media"
-                android:title="@string/media_volume_option_title" />
+    <!-- Media volume -->
+    <com.android.settings.notification.VolumeSeekBarPreference
+        android:key="media_volume"
+        android:icon="@*android:drawable/ic_audio_media"
+        android:title="@string/media_volume_option_title"
+        android:order="-106"/>
 
-        <!-- Alarm volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="alarm_volume"
-                android:icon="@*android:drawable/ic_audio_alarm"
-                android:title="@string/alarm_volume_option_title" />
+    <!-- Alarm volume -->
+    <com.android.settings.notification.VolumeSeekBarPreference
+        android:key="alarm_volume"
+        android:icon="@*android:drawable/ic_audio_alarm"
+        android:title="@string/alarm_volume_option_title"
+        android:order="-105"/>
 
-        <!-- Ring volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="ring_volume"
-                android:icon="@*android:drawable/ic_audio_ring_notif"
-                android:title="@string/ring_volume_option_title" />
+    <!-- Ring volume -->
+    <com.android.settings.notification.VolumeSeekBarPreference
+        android:key="ring_volume"
+        android:icon="@*android:drawable/ic_audio_ring_notif"
+        android:title="@string/ring_volume_option_title"
+        android:order="-104"/>
 
-        <!-- Notification volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="notification_volume"
-                android:icon="@*android:drawable/ic_audio_ring_notif"
-                android:title="@string/notification_volume_option_title" />
+    <!-- Notification volume -->
+    <com.android.settings.notification.VolumeSeekBarPreference
+        android:key="notification_volume"
+        android:icon="@*android:drawable/ic_audio_ring_notif"
+        android:title="@string/notification_volume_option_title"
+        android:order="-103"/>
 
-        <!-- Also vibrate for calls -->
-        <SwitchPreference
-                android:key="vibrate_when_ringing"
-                android:title="@string/vibrate_when_ringing_title" />
+    <!-- Also vibrate for calls -->
+    <SwitchPreference
+        android:key="vibrate_when_ringing"
+        android:title="@string/vibrate_when_ringing_title"
+        android:order="-102"/>
 
-        <!-- Interruptions -->
-        <com.android.settingslib.RestrictedPreference
-                android:key="zen_mode"
-                android:title="@string/zen_mode_settings_title"
-                settings:useAdminDisabledSummary="true"
-                settings:keywords="@string/keywords_sounds_and_notifications_interruptions"
-                android:fragment="com.android.settings.notification.ZenModeSettings"
-                settings:allowDividerAbove="true" />
+    <!-- Interruptions -->
+    <com.android.settingslib.RestrictedPreference
+        android:key="zen_mode"
+        android:title="@string/zen_mode_settings_title"
+        settings:useAdminDisabledSummary="true"
+        settings:keywords="@string/keywords_sounds_and_notifications_interruptions"
+        android:fragment="com.android.settings.notification.ZenModeSettings"
+        settings:allowDividerAbove="true"
+        android:order="-101"/>
 
-        <!-- Phone ringtone -->
-        <com.android.settings.DefaultRingtonePreference
-            android:key="ringtone"
-            android:title="@string/ringtone_title"
-            android:dialogTitle="@string/ringtone_title"
-            android:summary="@string/summary_placeholder"
-            android:ringtoneType="ringtone"
-            settings:allowDividerAbove="true" />
-
-    </PreferenceCategory>
+    <!-- Phone ringtone -->
+    <com.android.settings.DefaultRingtonePreference
+        android:key="ringtone"
+        android:title="@string/ringtone_title"
+        android:dialogTitle="@string/ringtone_title"
+        android:summary="@string/summary_placeholder"
+        android:ringtoneType="ringtone"
+        settings:allowDividerAbove="true"
+        android:order="-100"/>
 
     <!-- Default notification ringtone -->
     <com.android.settings.DefaultRingtonePreference
diff --git a/res/xml/sound_settings_new_advance_button.xml b/res/xml/sound_settings_new_advance_button.xml
deleted file mode 100644
index a1e1a32..0000000
--- a/res/xml/sound_settings_new_advance_button.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 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"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-    android:title="@string/sound_settings"
-    android:key="sound_settings"
-    settings:keywords="@string/keywords_sounds"
-    settings:initialExpandedChildrenCount="6">
-
-    <PreferenceCategory
-        android:order="-100">
-        <!-- Media volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="media_volume"
-                android:icon="@*android:drawable/ic_audio_media"
-                android:title="@string/media_volume_option_title" />
-
-        <!-- Alarm volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="alarm_volume"
-                android:icon="@*android:drawable/ic_audio_alarm"
-                android:title="@string/alarm_volume_option_title" />
-
-        <!-- Ring volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="ring_volume"
-                android:icon="@*android:drawable/ic_audio_ring_notif"
-                android:title="@string/ring_volume_option_title" />
-
-        <!-- Notification volume -->
-        <com.android.settings.notification.VolumeSeekBarPreference
-                android:key="notification_volume"
-                android:icon="@*android:drawable/ic_audio_ring_notif"
-                android:title="@string/notification_volume_option_title" />
-
-        <!-- Also vibrate for calls -->
-        <SwitchPreference
-                android:key="vibrate_when_ringing"
-                android:title="@string/vibrate_when_ringing_title" />
-
-        <!-- Interruptions -->
-        <com.android.settingslib.RestrictedPreference
-                android:key="zen_mode"
-                android:title="@string/zen_mode_settings_title"
-                settings:useAdminDisabledSummary="true"
-                settings:keywords="@string/keywords_sounds_and_notifications_interruptions"
-                android:fragment="com.android.settings.notification.ZenModeSettings"
-                settings:allowDividerAbove="true" />
-
-        <!-- Phone ringtone -->
-        <com.android.settings.DefaultRingtonePreference
-            android:key="ringtone"
-            android:title="@string/ringtone_title"
-            android:dialogTitle="@string/ringtone_title"
-            android:summary="@string/summary_placeholder"
-            android:ringtoneType="ringtone"
-            settings:allowDividerAbove="true" />
-
-        <!-- Default notification ringtone -->
-        <com.android.settings.DefaultRingtonePreference
-            android:key="notification_ringtone"
-            android:title="@string/notification_ringtone_title"
-            android:dialogTitle="@string/notification_ringtone_title"
-            android:summary="@string/summary_placeholder"
-            android:ringtoneType="notification" />
-
-        <!-- Default alarm ringtone -->
-        <com.android.settings.DefaultRingtonePreference
-            android:key="alarm_ringtone"
-            android:title="@string/alarm_ringtone_title"
-            android:dialogTitle="@string/alarm_ringtone_title"
-            android:summary="@string/summary_placeholder"
-            android:persistent="false"
-            android:ringtoneType="alarm" />
-    </PreferenceCategory>
-
-    <!-- Other sounds -->
-    <PreferenceCategory
-          android:title="@string/other_sound_category_preference_title"
-          android:order="-50">
-
-        <!-- Dial pad tones -->
-        <SwitchPreference
-          android:key="dial_pad_tones"
-          android:title="@string/dial_pad_tones_title" />
-
-        <!-- Screen locking sounds -->
-        <SwitchPreference
-          android:key="screen_locking_sounds"
-          android:title="@string/screen_locking_sounds_title" />
-
-        <!-- Charging sounds -->
-        <SwitchPreference
-          android:key="charging_sounds"
-          android:title="@string/charging_sounds_title" />
-
-        <!-- Docking sounds -->
-        <SwitchPreference
-          android:key="docking_sounds"
-          android:title="@string/docking_sounds_title" />
-
-        <!-- Touch sounds -->
-        <SwitchPreference
-          android:key="touch_sounds"
-          android:title="@string/touch_sounds_title" />
-
-        <!-- Vibrate on touch -->
-        <SwitchPreference
-          android:key="vibrate_on_touch"
-          android:title="@string/vibrate_on_touch_title" />
-
-        <!-- Dock speaker plays -->
-        <DropDownPreference
-          android:key="dock_audio_media"
-          android:title="@string/dock_audio_media_title"
-          android:summary="%s" />
-
-        <!-- Boot sounds -->
-        <SwitchPreference
-          android:key="boot_sounds"
-          android:title="@string/boot_sounds_title" />
-
-        <!-- Emergency tone -->
-        <DropDownPreference
-          android:key="emergency_tone"
-          android:title="@string/emergency_tone_title"
-          android:summary="%s" />
-    </PreferenceCategory>
-
-    <com.android.settingslib.RestrictedPreference
-      android:key="cell_broadcast_settings"
-      android:title="@string/cell_broadcast_settings"
-      settings:useAdminDisabledSummary="true"
-      settings:allowDividerAbove="true"
-      android:order="-1">
-            <intent
-              android:action="android.intent.action.MAIN"
-              android:targetPackage="com.android.cellbroadcastreceiver"
-              android:targetClass="com.android.cellbroadcastreceiver.CellBroadcastSettings" />
-    </com.android.settingslib.RestrictedPreference>
-
-    <com.android.settings.widget.WorkOnlyCategory
-        android:key="sound_work_settings_section"
-        android:title="@string/sound_work_settings"
-        android:order="100">
-
-                <!-- Use the same sounds of the work profile -->
-                <SwitchPreference
-                    android:key="work_use_personal_sounds"
-                    android:title="@string/work_use_personal_sounds_title"
-                    android:summary="@string/work_use_personal_sounds_summary"
-                    android:disableDependentsState="true" />
-
-                <!-- Work phone ringtone -->
-                <com.android.settings.DefaultRingtonePreference
-                    android:key="work_ringtone"
-                    android:title="@string/work_ringtone_title"
-                    android:dialogTitle="@string/work_alarm_ringtone_title"
-                    android:ringtoneType="ringtone"
-                    android:dependency="work_use_personal_sounds" />
-
-                <!-- Default work notification ringtone -->
-                <com.android.settings.DefaultRingtonePreference
-                    android:key="work_notification_ringtone"
-                    android:title="@string/work_notification_ringtone_title"
-                    android:dialogTitle="@string/work_alarm_ringtone_title"
-                    android:ringtoneType="notification"
-                    android:dependency="work_use_personal_sounds" />
-
-                <!-- Default work alarm ringtone -->
-                <com.android.settings.DefaultRingtonePreference
-                    android:key="work_alarm_ringtone"
-                    android:title="@string/work_alarm_ringtone_title"
-                    android:dialogTitle="@string/work_alarm_ringtone_title"
-                    android:persistent="false"
-                    android:ringtoneType="alarm"
-                    android:dependency="work_use_personal_sounds" />
-
-    </com.android.settings.widget.WorkOnlyCategory>
-</PreferenceScreen>
diff --git a/res/xml/system_dashboard_fragment.xml b/res/xml/system_dashboard_fragment.xml
index b4ad3a3..8b9d0ca 100644
--- a/res/xml/system_dashboard_fragment.xml
+++ b/res/xml/system_dashboard_fragment.xml
@@ -16,8 +16,10 @@
 
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
     android:key="system_dashboard_screen"
-    android:title="@string/header_category_system">
+    android:title="@string/header_category_system"
+    settings:initialExpandedChildrenCount="4">
 
     <Preference
         android:key="gesture_settings"