diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b40cfb2..4388f0b 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -523,35 +523,6 @@
                 android:resource="@id/language_settings" />
         </activity-alias>
 
-        <activity android:name="Settings$SoundSettingsActivity"
-                android:label="@string/sound_settings"
-                android:taskAffinity=""
-                android:excludeFromRecents="true">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="com.android.settings.SOUND_SETTINGS" />
-                <action android:name="android.settings.SOUND_SETTINGS" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.VOICE_LAUNCH" />
-                <category android:name="com.android.settings.SHORTCUT" />
-            </intent-filter>
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.SoundSettings" />
-            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/sound_settings" />
-        </activity>
-
-        <!-- Keep compatibility with old shortcuts. -->
-        <activity-alias android:name="SoundSettings"
-                android:label="@string/sound_settings"
-                android:exported="true"
-                android:targetActivity="Settings$SoundSettingsActivity">
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.SoundSettings" />
-            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
-                android:resource="@id/sound_settings" />
-        </activity-alias>
-
         <activity android:name="Settings$ZenModeSettingsActivity"
                 android:label="@string/zen_mode_settings_title"
                 android:exported="true"
@@ -1712,6 +1683,37 @@
                 android:resource="@id/notification_settings" />
         </activity>
 
+        <!-- Keep compatibility with old shortcuts. -->
+        <activity-alias android:name="Settings$SoundSettingsActivity"
+                android:label="@string/notification_settings"
+                android:taskAffinity=""
+                android:excludeFromRecents="true"
+                android:targetActivity="Settings$NotificationSettingsActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <action android:name="com.android.settings.SOUND_SETTINGS" />
+                <action android:name="android.settings.SOUND_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.VOICE_LAUNCH" />
+                <category android:name="com.android.settings.SHORTCUT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.notification.NotificationSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/notification_settings" />
+        </activity-alias>
+
+        <!-- Keep compatibility with old shortcuts. -->
+        <activity-alias android:name="SoundSettings"
+                android:label="@string/notification_settings"
+                android:exported="true"
+                android:targetActivity="Settings$NotificationSettingsActivity">
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                android:value="com.android.settings.notification.NotificationSettings" />
+            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+                android:resource="@id/notification_settings" />
+        </activity-alias>
+
         <activity android:name="Settings$NotificationDisplaySettingsActivity"
                 android:label="@string/notification_display_settings"
                 android:exported="true"
@@ -1728,18 +1730,18 @@
                 android:resource="@id/notification_settings" />
         </activity>
 
-        <activity android:name="Settings$TouchSoundSettingsActivity"
-                android:label="@string/touch_sound_settings"
+        <activity android:name="Settings$OtherSoundSettingsActivity"
+                android:label="@string/other_sound_settings"
                 android:exported="true"
                 android:taskAffinity=""
                 android:excludeFromRecents="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.settings.ACTION_TOUCH_SOUND_SETTINGS" />
+                <action android:name="android.settings.ACTION_OTHER_SOUND_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.notification.TouchSoundSettings" />
+                android:value="com.android.settings.notification.OtherSoundSettings" />
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                 android:resource="@id/notification_settings" />
         </activity>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 8b8777c..a632f54 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -473,20 +473,6 @@
         <item>Proxy Auto-Config</item>
     </string-array>
 
-    <!-- Sound settings for emergency tone. -->
-    <string-array name="emergency_tone_entries">
-        <item>Off</item>
-        <item>Alert</item>
-        <item>Vibrate</item>
-    </string-array>
-
-    <!-- Do not translate. -->
-    <string-array name="emergency_tone_values">
-        <item>0</item>
-        <item>1</item>
-        <item>2</item>
-    </string-array>
-
     <!-- Locales in this list are displayed with the corresponding
          name from special_locale_names instead of using the name
          from Locale.getDisplayName(). -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 94c3fe9..d02bcf1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5140,21 +5140,42 @@
     <!-- Sounds & notifications > Showing notifications: Title for the option managing notifications per application. [CHAR LIMIT=30] -->
     <string name="app_notifications_title">App notifications</string>
 
-    <!-- Sounds & notifications: Title for the touch sounds option and associated settings page. [CHAR LIMIT=30] -->
-    <string name="touch_sound_settings">Touch sounds</string>
+    <!-- Sounds & notifications: Title for the other sounds option and associated settings page. [CHAR LIMIT=30] -->
+    <string name="other_sound_settings">Other sounds</string>
 
-    <!-- Sounds & notifications > Touch sounds: Title for the option enabling touch sounds for dial pad tones. [CHAR LIMIT=30] -->
+    <!-- Sounds & notifications > Other sounds: Title for the option enabling touch sounds for dial pad tones. [CHAR LIMIT=30] -->
     <string name="dial_pad_tones_title">Dial pad tones</string>
 
-    <!-- Sounds & notifications > Touch sounds: Title for the option enabling touch sounds for screen locking and unlocking. [CHAR LIMIT=30] -->
-    <string name="screen_locking_sounds_title">Screen locking &amp; unlocking</string>
+    <!-- Sounds & notifications > Other sounds: Title for the option enabling touch sounds for screen locking sounds. [CHAR LIMIT=30] -->
+    <string name="screen_locking_sounds_title">Screen locking sounds</string>
 
-    <!-- Sounds & notifications > Touch sounds: Title for the option enabling other touch sounds. [CHAR LIMIT=30] -->
-    <string name="other_touch_sounds_title">Other touch sounds</string>
+    <!-- Sounds & notifications > Other sounds: Title for the option enabling docking sounds. [CHAR LIMIT=30] -->
+    <string name="docking_sounds_title">Docking sounds</string>
 
-    <!-- Sounds & notifications > Touch sounds: Title for the option enabling haptic feedback on touch. [CHAR LIMIT=30] -->
+    <!-- Sounds & notifications > Other sounds: Title for the option enabling touch sounds. [CHAR LIMIT=30] -->
+    <string name="touch_sounds_title">Touch sounds</string>
+
+    <!-- Sounds & notifications > Other sounds: Title for the option enabling haptic feedback on touch. [CHAR LIMIT=30] -->
     <string name="vibrate_on_touch_title">Vibrate on touch</string>
 
+    <!-- Sounds & notifications > Other sounds: Title for the option enabling dock audio media. [CHAR LIMIT=30] -->
+    <string name="dock_audio_media_title">Dock speaker plays</string>
+
+    <!-- Sounds & notifications > Other sounds: Value for the dock audio media with value 0: disabled. [CHAR LIMIT=30] -->
+    <string name="dock_audio_media_disabled">All audio</string>
+
+    <!-- Sounds & notifications > Other sounds: Value for the dock audio media with value 1: enabled. [CHAR LIMIT=30] -->
+    <string name="dock_audio_media_enabled">Media audio only</string>
+
+    <!-- Sounds & notifications > Other sounds: Value for the emergency tone option with value 0: silent. [CHAR LIMIT=30] -->
+    <string name="emergency_tone_silent">Silent</string>
+
+    <!-- Sounds & notifications > Other sounds: Value for the emergency tone option with value 1: alert. [CHAR LIMIT=30] -->
+    <string name="emergency_tone_alert">Alert</string>
+
+    <!-- Sounds & notifications > Other sounds: Value for the emergency tone option with value 2: vibrate. [CHAR LIMIT=30] -->
+    <string name="emergency_tone_vibrate">Vibrate</string>
+
     <!-- Sounds & notifications: Title for managing notification listeners option. [CHAR LIMIT=30] -->
     <string name="manage_notification_access_title">Notification access</string>
 
diff --git a/res/xml/dashboard_categories.xml b/res/xml/dashboard_categories.xml
index 4180f14..44ec960 100644
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -76,14 +76,6 @@
                 android:icon="@drawable/ic_settings_home"
                 />
 
-        <!-- Sound -->
-        <dashboard-tile
-                android:id="@+id/sound_settings"
-                android:title="@string/sound_settings"
-                android:fragment="com.android.settings.SoundSettings"
-                android:icon="@drawable/ic_settings_sound"
-                />
-
         <!-- Display -->
         <dashboard-tile
                 android:id="@+id/display_settings"
diff --git a/res/xml/notification_settings.xml b/res/xml/notification_settings.xml
index 865138f..176c822 100644
--- a/res/xml/notification_settings.xml
+++ b/res/xml/notification_settings.xml
@@ -88,10 +88,10 @@
 
     <!-- Touch sounds -->
     <Preference
-            android:key="touch_sounds"
-            android:title="@string/touch_sound_settings"
+            android:key="other_sounds"
+            android:title="@string/other_sound_settings"
             android:persistent="false"
-            android:fragment="com.android.settings.notification.TouchSoundSettings" />
+            android:fragment="com.android.settings.notification.OtherSoundSettings" />
 
     <!-- Notification access -->
     <Preference
diff --git a/res/xml/touch_sound_settings.xml b/res/xml/other_sound_settings.xml
similarity index 64%
rename from res/xml/touch_sound_settings.xml
rename to res/xml/other_sound_settings.xml
index d10ef0d..08679db 100644
--- a/res/xml/touch_sound_settings.xml
+++ b/res/xml/other_sound_settings.xml
@@ -15,8 +15,8 @@
 -->
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-        android:title="@string/touch_sound_settings"
-        android:key="touch_sound_settings"
+        android:title="@string/other_sound_settings"
+        android:key="other_sound_settings"
         xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
 
     <!-- Dial pad tones -->
@@ -27,7 +27,7 @@
             android:switchTextOn=""
             android:persistent="false" />
 
-    <!-- Screen locking / unlocking -->
+    <!-- Screen locking sounds -->
     <SwitchPreference
             android:key="screen_locking_sounds"
             android:title="@string/screen_locking_sounds_title"
@@ -35,10 +35,18 @@
             android:switchTextOn=""
             android:persistent="false" />
 
-    <!-- Other touch sounds -->
+    <!-- Docking sounds -->
     <SwitchPreference
-            android:key="other_touch_sounds"
-            android:title="@string/other_touch_sounds_title"
+            android:key="docking_sounds"
+            android:title="@string/docking_sounds_title"
+            android:switchTextOff=""
+            android:switchTextOn=""
+            android:persistent="false" />
+
+    <!-- Touch sounds -->
+    <SwitchPreference
+            android:key="touch_sounds"
+            android:title="@string/touch_sounds_title"
             android:switchTextOff=""
             android:switchTextOn=""
             android:persistent="false" />
@@ -51,4 +59,16 @@
             android:switchTextOn=""
             android:persistent="false" />
 
+    <!-- Dock speaker plays -->
+    <com.android.settings.notification.DropDownPreference
+            android:key="dock_audio_media"
+            android:title="@string/dock_audio_media_title"
+            android:persistent="false" />
+
+    <!-- Emergency tone -->
+    <com.android.settings.notification.DropDownPreference
+            android:key="emergency_tone"
+            android:title="@string/emergency_tone_title"
+            android:persistent="false" />
+
 </PreferenceScreen>
diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml
deleted file mode 100644
index 26e2e20..0000000
--- a/res/xml/sound_settings.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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/sound_settings"
-        android:key="sound_settings"
-        xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
-
-    <com.android.settings.RingerVolumePreference
-            android:key="ring_volume"
-            android:title="@string/all_volume_title"
-            android:dialogTitle="@string/all_volume_title"
-            android:persistent="false"
-            android:streamType="ring" />
-
-    <Preference
-            android:key="musicfx"
-            android:title="@string/musicfx_title">
-        <intent android:targetPackage="com.android.musicfx"
-                android:targetClass="com.android.musicfx.ControlPanelPicker" />
-    </Preference>
-
-    <PreferenceCategory
-            android:key="category_calls_and_notification"
-            android:title="@string/sound_category_call_ringtone_vibrate_title"/>
-
-    <!-- Do not nest these, or removals in code will break -->
-    <com.android.settings.DefaultRingtonePreference
-            android:key="ringtone"
-            android:title="@string/ringtone_title"
-            android:dialogTitle="@string/ringtone_title"
-            android:persistent="false"
-            android:ringtoneType="ringtone" />
-
-    <CheckBoxPreference
-         android:key="vibrate_when_ringing"
-         android:title="@string/vibrate_when_ringing_title"
-         android:persistent="false" />
-
-    <PreferenceCategory
-            android:title="@string/sound_category_system_title"/>
-
-    <!-- Do not nest these, or removals in code will break -->
-
-    <com.android.settings.DefaultRingtonePreference
-            android:key="notification_sound"
-            android:title="@string/notification_sound_title"
-            android:dialogTitle="@string/notification_sound_dialog_title"
-            android:persistent="false"
-            android:ringtoneType="notification" />
-
-    <CheckBoxPreference
-            android:key="dtmf_tone"
-            android:title="@string/dtmf_tone_enable_title"
-            android:defaultValue="true" />
-
-    <CheckBoxPreference
-            android:key="sound_effects"
-            android:title="@string/sound_effects_enable_title"
-            android:defaultValue="true" />
-
-    <CheckBoxPreference
-            android:key="lock_sounds"
-            android:title="@string/lock_sounds_enable_title"
-            android:defaultValue="true" />
-
-    <CheckBoxPreference
-            android:key="haptic_feedback"
-            android:title="@string/haptic_feedback_enable_title"
-            android:defaultValue="true" />
-
-    <ListPreference
-            android:key="emergency_tone"
-            android:title="@string/emergency_tone_title"
-            android:entries="@array/emergency_tone_entries"
-            android:entryValues="@array/emergency_tone_values" />
-
-    <!-- Dock -->
-    <PreferenceCategory
-        android:key="dock_category"
-        android:title="@string/dock_settings"/>
-
-    <!-- Do not nest these, or removals in code will break -->
-    <PreferenceScreen
-        android:key="dock_audio"
-        android:title="@string/dock_audio_settings_title">
-        <CheckBoxPreference
-            android:title="@string/bluetooth_dock_settings_a2dp"
-            android:key="dock_audio_media_enabled"
-            android:enabled="true"
-            />
-    </PreferenceScreen>
-
-    <CheckBoxPreference
-        android:key="dock_sounds"
-        android:title="@string/dock_sounds_enable_title"
-        android:defaultValue="false" />
-
-</PreferenceScreen>
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 94d8a36..fe7a217 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -99,7 +99,7 @@
     private static final String KEEP_SCREEN_ON = "keep_screen_on";
     private static final String BT_HCI_SNOOP_LOG = "bt_hci_snoop_log";
     private static final String SELECT_RUNTIME_KEY = "select_runtime";
-    private static final String SELECT_RUNTIME_PROPERTY = "persist.sys.dalvik.vm.lib.1";
+    private static final String SELECT_RUNTIME_PROPERTY = "persist.sys.dalvik.vm.lib.2";
     private static final String ALLOW_MOCK_LOCATION = "allow_mock_location";
     private static final String HDCP_CHECKING_KEY = "hdcp_checking";
     private static final String HDCP_CHECKING_PROPERTY = "persist.sys.hdcp_checking";
@@ -168,6 +168,7 @@
     private WifiManager mWifiManager;
 
     private SwitchBar mSwitchBar;
+    private Switch mEnabledSwitch;
     private boolean mLastEnabledState;
     private boolean mHaveDebugSettings;
     private boolean mDontPokeProperties;
@@ -388,8 +389,9 @@
         final SettingsActivity activity = (SettingsActivity) getActivity();
 
         mSwitchBar = activity.getSwitchBar();
+        mEnabledSwitch = mSwitchBar.getSwitch();
         if (mUnavailable) {
-            mSwitchBar.setSwitchEnabled(false);
+            mEnabledSwitch.setEnabled(false);
             return;
         }
     }
@@ -442,7 +444,7 @@
         final ContentResolver cr = getActivity().getContentResolver();
         mLastEnabledState = Settings.Global.getInt(cr,
                 Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
-        mSwitchBar.setSwitchChecked(mLastEnabledState);
+        mEnabledSwitch.setChecked(mLastEnabledState);
         setPrefsEnabledState(mLastEnabledState);
 
         if (mHaveDebugSettings && !mLastEnabledState) {
@@ -453,7 +455,7 @@
             Settings.Global.putInt(getActivity().getContentResolver(),
                     Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
             mLastEnabledState = true;
-            mSwitchBar.setSwitchChecked(mLastEnabledState);
+            mEnabledSwitch.setChecked(mLastEnabledState);
             setPrefsEnabledState(mLastEnabledState);
         }
 
@@ -1223,6 +1225,9 @@
 
     @Override
     public void onSwitchChanged(Switch switchView, boolean isChecked) {
+        if (switchView != mEnabledSwitch) {
+            return;
+        }
         if (isChecked != mLastEnabledState) {
             if (isChecked) {
                 mDialogClicked = false;
@@ -1477,7 +1482,7 @@
                 setPrefsEnabledState(mLastEnabledState);
             } else {
                 // Reset the toggle
-                mSwitchBar.setSwitchChecked(false);
+                mEnabledSwitch.setChecked(false);
             }
         }
     }
@@ -1491,7 +1496,7 @@
             mAdbDialog = null;
         } else if (dialog == mEnableDialog) {
             if (!mDialogClicked) {
-                mSwitchBar.setSwitchChecked(false);
+                mEnabledSwitch.setChecked(false);
             }
             mEnableDialog = null;
         }
diff --git a/src/com/android/settings/DreamSettings.java b/src/com/android/settings/DreamSettings.java
index d97e616..1175639 100644
--- a/src/com/android/settings/DreamSettings.java
+++ b/src/com/android/settings/DreamSettings.java
@@ -61,6 +61,7 @@
     private DreamBackend mBackend;
     private DreamInfoAdapter mAdapter;
     private SwitchBar mSwitchBar;
+    private Switch mSwitch;
     private MenuItem[] mMenuItemsWhenEnabled;
     private boolean mRefreshing;
 
@@ -123,6 +124,7 @@
 
         final SettingsActivity sa = (SettingsActivity) getActivity();
         mSwitchBar = sa.getSwitchBar();
+        mSwitch = mSwitchBar.getSwitch();
     }
 
     @Override
@@ -261,8 +263,8 @@
         logd("refreshFromBackend()");
         mRefreshing = true;
         boolean dreamsEnabled = mBackend.isEnabled();
-        if (mSwitchBar.isSwitchChecked() != dreamsEnabled)
-            mSwitchBar.setSwitchChecked(dreamsEnabled);
+        if (mSwitch.isChecked() != dreamsEnabled)
+            mSwitch.setChecked(dreamsEnabled);
 
         mAdapter.clear();
         if (dreamsEnabled) {
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 38176eb..22ae719 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -40,7 +40,6 @@
     public static class SpellCheckersSettingsActivity extends SettingsActivity { /* empty */ }
     public static class LocalePickerActivity extends SettingsActivity { /* empty */ }
     public static class UserDictionarySettingsActivity extends SettingsActivity { /* empty */ }
-    public static class SoundSettingsActivity extends SettingsActivity { /* empty */ }
     public static class DisplaySettingsActivity extends SettingsActivity { /* empty */ }
     public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ }
     public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
@@ -90,7 +89,7 @@
     public static class NotificationSettingsActivity extends SettingsActivity { /* empty */ }
     public static class NotificationDisplaySettingsActivity extends SettingsActivity { /* empty */ }
     public static class AppNotificationSettingsActivity extends SettingsActivity { /* empty */ }
-    public static class TouchSoundSettingsActivity extends SettingsActivity { /* empty */ }
+    public static class OtherSoundSettingsActivity extends SettingsActivity { /* empty */ }
 
     public static class TopLevelSettings extends SettingsActivity { /* empty */ }
 }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index a4aa60f..18bab2c 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -200,7 +200,7 @@
             R.id.data_usage_settings,
             R.id.wireless_settings,
             R.id.device_section,
-            R.id.sound_settings,
+            R.id.notification_settings,
             R.id.display_settings,
             R.id.storage_settings,
             R.id.application_settings,
@@ -236,7 +236,6 @@
             SpellCheckersSettings.class.getName(),
             UserDictionaryList.class.getName(),
             UserDictionarySettings.class.getName(),
-            SoundSettings.class.getName(),
             DisplaySettings.class.getName(),
             DeviceInfoSettings.class.getName(),
             ManageApplications.class.getName(),
diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java
deleted file mode 100644
index eadd482..0000000
--- a/src/com/android/settings/SoundSettings.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.settings.bluetooth.DockEventReceiver;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.bluetooth.BluetoothDevice;
-import android.content.BroadcastReceiver;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.database.Cursor;
-import android.database.sqlite.SQLiteException;
-import android.media.AudioManager;
-import android.media.RingtoneManager;
-import android.media.audiofx.AudioEffect;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.os.Vibrator;
-import android.preference.CheckBoxPreference;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.PreferenceGroup;
-import android.preference.PreferenceScreen;
-import android.provider.MediaStore;
-import android.provider.Settings;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settings.search.Indexable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class SoundSettings extends SettingsPreferenceFragment implements
-        Preference.OnPreferenceChangeListener, Indexable {
-    private static final String TAG = "SoundSettings";
-
-    private static final int DIALOG_NOT_DOCKED = 1;
-
-    /** If there is no setting in the provider, use this. */
-    private static final int FALLBACK_EMERGENCY_TONE_VALUE = 0;
-
-    private static final String KEY_VIBRATE = "vibrate_when_ringing";
-    private static final String KEY_RING_VOLUME = "ring_volume";
-    private static final String KEY_MUSICFX = "musicfx";
-    private static final String KEY_DTMF_TONE = "dtmf_tone";
-    private static final String KEY_SOUND_EFFECTS = "sound_effects";
-    private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback";
-    private static final String KEY_EMERGENCY_TONE = "emergency_tone";
-    private static final String KEY_SOUND_SETTINGS = "sound_settings";
-    private static final String KEY_LOCK_SOUNDS = "lock_sounds";
-    private static final String KEY_RINGTONE = "ringtone";
-    private static final String KEY_NOTIFICATION_SOUND = "notification_sound";
-    private static final String KEY_CATEGORY_CALLS = "category_calls_and_notification";
-    private static final String KEY_DOCK_CATEGORY = "dock_category";
-    private static final String KEY_DOCK_AUDIO_SETTINGS = "dock_audio";
-    private static final String KEY_DOCK_SOUNDS = "dock_sounds";
-    private static final String KEY_DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
-
-    private static final String[] NEED_VOICE_CAPABILITY = {
-            KEY_RINGTONE, KEY_DTMF_TONE, KEY_CATEGORY_CALLS,
-            KEY_EMERGENCY_TONE, KEY_VIBRATE
-    };
-
-    private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1;
-    private static final int MSG_UPDATE_NOTIFICATION_SUMMARY = 2;
-
-    private CheckBoxPreference mVibrateWhenRinging;
-    private CheckBoxPreference mDtmfTone;
-    private CheckBoxPreference mSoundEffects;
-    private CheckBoxPreference mHapticFeedback;
-    private Preference mMusicFx;
-    private CheckBoxPreference mLockSounds;
-    private Preference mRingtonePreference;
-    private Preference mNotificationPreference;
-
-    private Runnable mRingtoneLookupRunnable;
-
-    private AudioManager mAudioManager;
-
-    private Preference mDockAudioSettings;
-    private CheckBoxPreference mDockSounds;
-    private Intent mDockIntent;
-    private CheckBoxPreference mDockAudioMediaEnabled;
-
-    private Handler mHandler = new Handler() {
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-            case MSG_UPDATE_RINGTONE_SUMMARY:
-                mRingtonePreference.setSummary((CharSequence) msg.obj);
-                break;
-            case MSG_UPDATE_NOTIFICATION_SUMMARY:
-                mNotificationPreference.setSummary((CharSequence) msg.obj);
-                break;
-            }
-        }
-    };
-
-    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (intent.getAction().equals(Intent.ACTION_DOCK_EVENT)) {
-                handleDockChange(intent);
-            }
-        }
-    };
-
-    private PreferenceGroup mSoundSettings;
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        ContentResolver resolver = getContentResolver();
-        int activePhoneType = TelephonyManager.getDefault().getCurrentPhoneType();
-
-        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
-
-        addPreferencesFromResource(R.xml.sound_settings);
-
-        if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType) {
-            // device is not CDMA, do not display CDMA emergency_tone
-            Preference pref = findPreference(KEY_EMERGENCY_TONE);
-            if (pref != null) {
-                getPreferenceScreen().removePreference(pref);
-            }
-        }
-
-        if (!getResources().getBoolean(R.bool.has_silent_mode)) {
-            findPreference(KEY_RING_VOLUME).setDependency(null);
-        }
-
-        if (getResources().getBoolean(com.android.internal.R.bool.config_useFixedVolume)) {
-            // device with fixed volume policy, do not display volumes submenu
-            Preference pref = findPreference(KEY_RING_VOLUME);
-            if (pref != null) {
-                getPreferenceScreen().removePreference(pref);
-            }
-        }
-
-        mVibrateWhenRinging = (CheckBoxPreference) findPreference(KEY_VIBRATE);
-        mVibrateWhenRinging.setPersistent(false);
-        mVibrateWhenRinging.setChecked(Settings.System.getInt(resolver,
-                Settings.System.VIBRATE_WHEN_RINGING, 0) != 0);
-
-        mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE);
-        mDtmfTone.setPersistent(false);
-        mDtmfTone.setChecked(Settings.System.getInt(resolver,
-                Settings.System.DTMF_TONE_WHEN_DIALING, 1) != 0);
-        mSoundEffects = (CheckBoxPreference) findPreference(KEY_SOUND_EFFECTS);
-        mSoundEffects.setPersistent(false);
-        mSoundEffects.setChecked(Settings.System.getInt(resolver,
-                Settings.System.SOUND_EFFECTS_ENABLED, 1) != 0);
-        mHapticFeedback = (CheckBoxPreference) findPreference(KEY_HAPTIC_FEEDBACK);
-        mHapticFeedback.setPersistent(false);
-        mHapticFeedback.setChecked(Settings.System.getInt(resolver,
-                Settings.System.HAPTIC_FEEDBACK_ENABLED, 1) != 0);
-        mLockSounds = (CheckBoxPreference) findPreference(KEY_LOCK_SOUNDS);
-        mLockSounds.setPersistent(false);
-        mLockSounds.setChecked(Settings.System.getInt(resolver,
-                Settings.System.LOCKSCREEN_SOUNDS_ENABLED, 1) != 0);
-
-        mRingtonePreference = findPreference(KEY_RINGTONE);
-        mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND);
-
-        Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
-        if (vibrator == null || !vibrator.hasVibrator()) {
-            removePreference(KEY_VIBRATE);
-            removePreference(KEY_HAPTIC_FEEDBACK);
-        }
-
-        if (TelephonyManager.PHONE_TYPE_CDMA == activePhoneType) {
-            ListPreference emergencyTonePreference =
-                (ListPreference) findPreference(KEY_EMERGENCY_TONE);
-            emergencyTonePreference.setValue(String.valueOf(Settings.Global.getInt(
-                resolver, Settings.Global.EMERGENCY_TONE, FALLBACK_EMERGENCY_TONE_VALUE)));
-            emergencyTonePreference.setOnPreferenceChangeListener(this);
-        }
-
-        mSoundSettings = (PreferenceGroup) findPreference(KEY_SOUND_SETTINGS);
-
-        mMusicFx = mSoundSettings.findPreference(KEY_MUSICFX);
-        Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
-        PackageManager p = getPackageManager();
-        List<ResolveInfo> ris = p.queryIntentActivities(i, PackageManager.GET_DISABLED_COMPONENTS);
-        if (ris.size() <= 2) {
-            // no need to show the item if there is no choice for the user to make
-            // note: the built in musicfx panel has two activities (one being a
-            // compatibility shim that launches either the other activity, or a
-            // third party one), hence the check for <=2. If the implementation
-            // of the compatbility layer changes, this check may need to be updated.
-            mSoundSettings.removePreference(mMusicFx);
-        }
-
-        if (!Utils.isVoiceCapable(getActivity())) {
-            for (String prefKey : NEED_VOICE_CAPABILITY) {
-                Preference pref = findPreference(prefKey);
-                if (pref != null) {
-                    getPreferenceScreen().removePreference(pref);
-                }
-            }
-        }
-
-        mRingtoneLookupRunnable = new Runnable() {
-            public void run() {
-                if (mRingtonePreference != null) {
-                    updateRingtoneName(RingtoneManager.TYPE_RINGTONE, mRingtonePreference,
-                            MSG_UPDATE_RINGTONE_SUMMARY);
-                }
-                if (mNotificationPreference != null) {
-                    updateRingtoneName(RingtoneManager.TYPE_NOTIFICATION, mNotificationPreference,
-                            MSG_UPDATE_NOTIFICATION_SUMMARY);
-                }
-            }
-        };
-
-        initDockSettings();
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-
-        lookupRingtoneNames();
-
-        IntentFilter filter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
-        getActivity().registerReceiver(mReceiver, filter);
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-
-        getActivity().unregisterReceiver(mReceiver);
-    }
-
-    private void updateRingtoneName(int type, Preference preference, int msg) {
-        if (preference == null) return;
-        final CharSequence summary = updateRingtoneName(getActivity(), type);
-        if (summary == null) return;
-        mHandler.sendMessage(mHandler.obtainMessage(msg, summary));
-    }
-
-    public static CharSequence updateRingtoneName(Context context, int type) {
-        if (context == null) return null;
-        Uri ringtoneUri = RingtoneManager.getActualDefaultRingtoneUri(context, type);
-        CharSequence summary = context.getString(com.android.internal.R.string.ringtone_unknown);
-        // Is it a silent ringtone?
-        if (ringtoneUri == null) {
-            summary = context.getString(com.android.internal.R.string.ringtone_silent);
-        } else {
-            // Fetch the ringtone title from the media provider
-            try {
-                Cursor cursor = context.getContentResolver().query(ringtoneUri,
-                        new String[] { MediaStore.Audio.Media.TITLE }, null, null, null);
-                if (cursor != null) {
-                    if (cursor.moveToFirst()) {
-                        summary = cursor.getString(0);
-                    }
-                    cursor.close();
-                }
-            } catch (SQLiteException sqle) {
-                // Unknown title for the ringtone
-            }
-        }
-        return summary;
-    }
-
-    private void lookupRingtoneNames() {
-        new Thread(mRingtoneLookupRunnable).start();
-    }
-
-    @Override
-    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
-        if (preference == mVibrateWhenRinging) {
-            Settings.System.putInt(getContentResolver(), Settings.System.VIBRATE_WHEN_RINGING,
-                    mVibrateWhenRinging.isChecked() ? 1 : 0);
-        } else if (preference == mDtmfTone) {
-            Settings.System.putInt(getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING,
-                    mDtmfTone.isChecked() ? 1 : 0);
-
-        } else if (preference == mSoundEffects) {
-            if (mSoundEffects.isChecked()) {
-                mAudioManager.loadSoundEffects();
-            } else {
-                mAudioManager.unloadSoundEffects();
-            }
-            Settings.System.putInt(getContentResolver(), Settings.System.SOUND_EFFECTS_ENABLED,
-                    mSoundEffects.isChecked() ? 1 : 0);
-
-        } else if (preference == mHapticFeedback) {
-            Settings.System.putInt(getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED,
-                    mHapticFeedback.isChecked() ? 1 : 0);
-
-        } else if (preference == mLockSounds) {
-            Settings.System.putInt(getContentResolver(), Settings.System.LOCKSCREEN_SOUNDS_ENABLED,
-                    mLockSounds.isChecked() ? 1 : 0);
-
-        } else if (preference == mMusicFx) {
-            // let the framework fire off the intent
-            return false;
-        } else if (preference == mDockAudioSettings) {
-            int dockState = mDockIntent != null
-                    ? mDockIntent.getIntExtra(Intent.EXTRA_DOCK_STATE, 0)
-                    : Intent.EXTRA_DOCK_STATE_UNDOCKED;
-
-            if (dockState == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
-                showDialog(DIALOG_NOT_DOCKED);
-            } else {
-                boolean isBluetooth = mDockIntent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE) != null;
-
-                if (isBluetooth) {
-                    Intent i = new Intent(mDockIntent);
-                    i.setAction(DockEventReceiver.ACTION_DOCK_SHOW_UI);
-                    i.setClass(getActivity(), DockEventReceiver.class);
-                    getActivity().sendBroadcast(i);
-                } else {
-                    PreferenceScreen ps = (PreferenceScreen)mDockAudioSettings;
-                    Bundle extras = ps.getExtras();
-                    extras.putBoolean("checked",
-                            Settings.Global.getInt(getContentResolver(),
-                                    Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, 0) == 1);
-                    super.onPreferenceTreeClick(ps, ps);
-                }
-            }
-        } else if (preference == mDockSounds) {
-            Settings.Global.putInt(getContentResolver(), Settings.Global.DOCK_SOUNDS_ENABLED,
-                    mDockSounds.isChecked() ? 1 : 0);
-        } else if (preference == mDockAudioMediaEnabled) {
-            Settings.Global.putInt(getContentResolver(), Settings.Global.DOCK_AUDIO_MEDIA_ENABLED,
-                    mDockAudioMediaEnabled.isChecked() ? 1 : 0);
-        }
-        return true;
-    }
-
-    public boolean onPreferenceChange(Preference preference, Object objValue) {
-        final String key = preference.getKey();
-        if (KEY_EMERGENCY_TONE.equals(key)) {
-            try {
-                int value = Integer.parseInt((String) objValue);
-                Settings.Global.putInt(getContentResolver(),
-                        Settings.Global.EMERGENCY_TONE, value);
-            } catch (NumberFormatException e) {
-                Log.e(TAG, "could not persist emergency tone setting", e);
-            }
-        }
-
-        return true;
-    }
-
-    @Override
-    protected int getHelpResource() {
-        return R.string.help_url_sound;
-    }
-
-    private boolean needsDockSettings() {
-        return getResources().getBoolean(R.bool.has_dock_settings);
-    }
-
-    private void initDockSettings() {
-        ContentResolver resolver = getContentResolver();
-
-        if (needsDockSettings()) {
-            mDockSounds = (CheckBoxPreference) findPreference(KEY_DOCK_SOUNDS);
-            mDockSounds.setPersistent(false);
-            mDockSounds.setChecked(Settings.Global.getInt(resolver,
-                    Settings.Global.DOCK_SOUNDS_ENABLED, 0) != 0);
-            mDockAudioSettings = findPreference(KEY_DOCK_AUDIO_SETTINGS);
-            mDockAudioSettings.setEnabled(false);
-        } else {
-            getPreferenceScreen().removePreference(findPreference(KEY_DOCK_CATEGORY));
-            getPreferenceScreen().removePreference(findPreference(KEY_DOCK_AUDIO_SETTINGS));
-            getPreferenceScreen().removePreference(findPreference(KEY_DOCK_SOUNDS));
-            Settings.Global.putInt(resolver, Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, 1);
-        }
-    }
-
-    private void handleDockChange(Intent intent) {
-        if (mDockAudioSettings != null) {
-            int dockState = intent.getIntExtra(Intent.EXTRA_DOCK_STATE, 0);
-
-            boolean isBluetooth =
-                    intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE) != null;
-
-            mDockIntent = intent;
-
-            if (dockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
-                // remove undocked dialog if currently showing.
-                try {
-                    removeDialog(DIALOG_NOT_DOCKED);
-                } catch (IllegalArgumentException iae) {
-                    // Maybe it was already dismissed
-                }
-
-                if (isBluetooth) {
-                    mDockAudioSettings.setEnabled(true);
-                } else {
-                    if (dockState == Intent.EXTRA_DOCK_STATE_LE_DESK) {
-                        ContentResolver resolver = getContentResolver();
-                        mDockAudioSettings.setEnabled(true);
-                        if (Settings.Global.getInt(resolver,
-                                Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, -1) == -1) {
-                            Settings.Global.putInt(resolver,
-                                    Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, 0);
-                        }
-                        mDockAudioMediaEnabled =
-                                (CheckBoxPreference) findPreference(KEY_DOCK_AUDIO_MEDIA_ENABLED);
-                        mDockAudioMediaEnabled.setPersistent(false);
-                        mDockAudioMediaEnabled.setChecked(
-                                Settings.Global.getInt(resolver,
-                                        Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, 0) != 0);
-                    } else {
-                        mDockAudioSettings.setEnabled(false);
-                    }
-                }
-            } else {
-                mDockAudioSettings.setEnabled(false);
-            }
-        }
-    }
-
-    @Override
-    public Dialog onCreateDialog(int id) {
-        if (id == DIALOG_NOT_DOCKED) {
-            return createUndockedMessage();
-        }
-        return null;
-    }
-
-    private Dialog createUndockedMessage() {
-        final AlertDialog.Builder ab = new AlertDialog.Builder(getActivity());
-        ab.setTitle(R.string.dock_not_found_title);
-        ab.setMessage(R.string.dock_not_found_text);
-        ab.setPositiveButton(android.R.string.ok, null);
-        return ab.create();
-    }
-
-    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
-        new BaseSearchIndexProvider() {
-            @Override
-            public List<String> getNonIndexableKeys(Context context) {
-                final List<String> keys = new ArrayList<String>();
-
-                int activePhoneType = TelephonyManager.getDefault().getCurrentPhoneType();
-
-                if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType) {
-                    // device is not CDMA, do not display CDMA emergency_tone
-                    keys.add(KEY_EMERGENCY_TONE);
-                }
-
-                return keys;
-            }
-        };
-
-}
-
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index 937f3b7..5dcf121 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -70,6 +70,7 @@
     private SubtitleView mPreviewText;
     private View mPreviewWindow;
     private SwitchBar mSwitchBar;
+    private ToggleSwitch mToggleSwitch;
 
     // Standard options.
     private LocalePreference mLocale;
@@ -131,7 +132,8 @@
 
         SettingsActivity activity = (SettingsActivity) getActivity();
         mSwitchBar = activity.getSwitchBar();
-        mSwitchBar.setSwitchChecked(enabled);
+        mToggleSwitch = mSwitchBar.getSwitch();
+        mToggleSwitch.setCheckedInternal(enabled);
 
         mPreviewWindow = view.findViewById(R.id.preview_window);
 
@@ -198,10 +200,10 @@
     }
 
     protected void onInstallSwitchBarToggleSwitch() {
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+        mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
             @Override
             public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
-                mSwitchBar.setSwitchChecked(checked);
+                toggleSwitch.setCheckedInternal(checked);
                 Settings.Secure.putInt(getActivity().getContentResolver(),
                         Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, checked ? 1 : 0);
                 getPreferenceScreen().setEnabled(checked);
@@ -220,7 +222,7 @@
 
     private void removeSwitchBarToggleSwitch() {
         mSwitchBar.hide();
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(null);
+        mToggleSwitch.setOnBeforeCheckedChangeListener(null);
     }
 
     private void initializeAllPreferences() {
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index d18c7f3..a446f49 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -58,7 +58,7 @@
                     String settingValue = Settings.Secure.getString(getContentResolver(),
                             Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
                     final boolean enabled = settingValue.contains(mComponentName.flattenToString());
-                    mSwitchBar.setSwitchChecked(enabled);
+                    mToggleSwitch.setCheckedInternal(enabled);
                 }
             };
 
@@ -265,13 +265,13 @@
         switch (which) {
             case DialogInterface.BUTTON_POSITIVE:
                 checked = (mShownDialogId == DIALOG_ID_ENABLE_WARNING);
-                mSwitchBar.setSwitchChecked(checked);
+                mToggleSwitch.setCheckedInternal(checked);
                 getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
                 onPreferenceToggled(mPreferenceKey, checked);
                 break;
             case DialogInterface.BUTTON_NEGATIVE:
                 checked = (mShownDialogId == DIALOG_ID_DISABLE_WARNING);
-                mSwitchBar.setSwitchChecked(checked);
+                mToggleSwitch.setCheckedInternal(checked);
                 getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
                 onPreferenceToggled(mPreferenceKey, checked);
                 break;
@@ -283,15 +283,15 @@
     @Override
     protected void onInstallSwitchBarToggleSwitch() {
         super.onInstallSwitchBarToggleSwitch();
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+        mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
                 @Override
             public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
                 if (checked) {
-                    mSwitchBar.setSwitchChecked(false);
+                    toggleSwitch.setCheckedInternal(false);
                     getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, false);
                     showDialog(DIALOG_ID_ENABLE_WARNING);
                 } else {
-                    mSwitchBar.setSwitchChecked(true);
+                    toggleSwitch.setCheckedInternal(true);
                     getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, true);
                     showDialog(DIALOG_ID_DISABLE_WARNING);
                 }
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index a39c5d8..b910f796a 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -80,7 +80,7 @@
     protected void onInstallSwitchBarToggleSwitch() {
         super.onInstallSwitchBarToggleSwitch();
 
-        mSwitchBar.setSwitchChecked(
+        mToggleSwitch.setCheckedInternal(
                 Settings.Secure.getInt(getContentResolver(), ENABLED, 0) == 1);
         mSwitchBar.addOnSwitchChangeListener(this);
     }
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index cc81289..331c0e3 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -40,6 +40,7 @@
         extends SettingsPreferenceFragment {
 
     protected SwitchBar mSwitchBar;
+    protected ToggleSwitch mToggleSwitch;
 
     protected String mPreferenceKey;
     protected Preference mSummaryPreference;
@@ -88,6 +89,7 @@
 
         SettingsActivity activity = (SettingsActivity) getActivity();
         mSwitchBar = activity.getSwitchBar();
+        mToggleSwitch = mSwitchBar.getSwitch();
 
         onProcessArguments(getArguments());
     }
@@ -130,7 +132,7 @@
     }
 
     private void removeActionBarToggleSwitch() {
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(null);
+        mToggleSwitch.setOnBeforeCheckedChangeListener(null);
         onRemoveSwitchBarToggleSwitch();
         mSwitchBar.hide();
     }
@@ -151,7 +153,7 @@
         // Enabled.
         if (arguments.containsKey(AccessibilitySettings.EXTRA_CHECKED)) {
             final boolean enabled = arguments.getBoolean(AccessibilitySettings.EXTRA_CHECKED);
-            mSwitchBar.setSwitchChecked(enabled);
+            mToggleSwitch.setCheckedInternal(enabled);
         }
 
         // Title.
diff --git a/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
index d815e50..782e7a5 100644
--- a/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
@@ -32,10 +32,10 @@
     @Override
     protected void onInstallSwitchBarToggleSwitch() {
         super.onInstallSwitchBarToggleSwitch();
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+        mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
                 @Override
             public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
-                    mSwitchBar.setSwitchChecked(checked);
+                toggleSwitch.setCheckedInternal(checked);
                 getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
                 onPreferenceToggled(mPreferenceKey, checked);
                 return false;
diff --git a/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
index 594ed22..b6d5569 100644
--- a/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
@@ -71,7 +71,7 @@
     protected void onInstallSwitchBarToggleSwitch() {
         super.onInstallSwitchBarToggleSwitch();
 
-        mSwitchBar.setSwitchChecked(
+        mToggleSwitch.setCheckedInternal(
                 Settings.Secure.getInt(getContentResolver(), ENABLED, 0) == 1);
         mSwitchBar.addOnSwitchChangeListener(this);
     }
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 7c01d0e..8202a2a 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -32,10 +32,10 @@
     @Override
     protected void onInstallSwitchBarToggleSwitch() {
         super.onInstallSwitchBarToggleSwitch();
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+        mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
                 @Override
             public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
-                mSwitchBar.setSwitchChecked(checked);
+                toggleSwitch.setCheckedInternal(checked);
                 getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
                 onPreferenceToggled(mPreferenceKey, checked);
                 return false;
diff --git a/src/com/android/settings/bluetooth/BluetoothEnabler.java b/src/com/android/settings/bluetooth/BluetoothEnabler.java
index 4626ed4..be03b63 100644
--- a/src/com/android/settings/bluetooth/BluetoothEnabler.java
+++ b/src/com/android/settings/bluetooth/BluetoothEnabler.java
@@ -40,6 +40,7 @@
  */
 public final class BluetoothEnabler implements SwitchBar.OnSwitchChangeListener {
     private Context mContext;
+    private Switch mSwitch;
     private SwitchBar mSwitchBar;
     private boolean mValidListener;
     private final LocalBluetoothAdapter mLocalAdapter;
@@ -74,13 +75,14 @@
     public BluetoothEnabler(Context context, SwitchBar switchBar) {
         mContext = context;
         mSwitchBar = switchBar;
+        mSwitch = switchBar.getSwitch();
         mValidListener = false;
 
         LocalBluetoothManager manager = LocalBluetoothManager.getInstance(context);
         if (manager == null) {
             // Bluetooth is not supported
             mLocalAdapter = null;
-            mSwitchBar.setSwitchEnabled(false);
+            mSwitch.setEnabled(false);
         } else {
             mLocalAdapter = manager.getBluetoothAdapter();
         }
@@ -89,7 +91,7 @@
 
     public void resume(Context context) {
         if (mLocalAdapter == null) {
-            mSwitchBar.setSwitchEnabled(false);
+            mSwitch.setEnabled(false);
             return;
         }
 
@@ -120,36 +122,36 @@
     void handleStateChanged(int state) {
         switch (state) {
             case BluetoothAdapter.STATE_TURNING_ON:
-                mSwitchBar.setSwitchEnabled(false);
+                mSwitch.setEnabled(false);
                 break;
             case BluetoothAdapter.STATE_ON:
                 setChecked(true);
-                mSwitchBar.setSwitchEnabled(true);
+                mSwitch.setEnabled(true);
                 updateSearchIndex(true);
                 break;
             case BluetoothAdapter.STATE_TURNING_OFF:
-                mSwitchBar.setSwitchEnabled(false);
+                mSwitch.setEnabled(false);
                 break;
             case BluetoothAdapter.STATE_OFF:
                 setChecked(false);
-                mSwitchBar.setSwitchEnabled(true);
+                mSwitch.setEnabled(true);
                 updateSearchIndex(false);
                 break;
             default:
                 setChecked(false);
-                mSwitchBar.setSwitchEnabled(true);
+                mSwitch.setEnabled(true);
                 updateSearchIndex(false);
         }
     }
 
     private void setChecked(boolean isChecked) {
-        if (isChecked != mSwitchBar.isSwitchChecked()) {
+        if (isChecked != mSwitch.isChecked()) {
             // set listener to null, so onCheckedChanged won't be called
             // if the checked status on Switch isn't changed by user click
             if (mValidListener) {
                 mSwitchBar.removeOnSwitchChangeListener(this);
             }
-            mSwitchBar.setSwitchChecked(isChecked);
+            mSwitch.setChecked(isChecked);
             if (mValidListener) {
                 mSwitchBar.addOnSwitchChangeListener(this);
             }
@@ -178,6 +180,6 @@
         if (mLocalAdapter != null) {
             mLocalAdapter.setBluetoothEnabled(isChecked);
         }
-        mSwitchBar.setSwitchEnabled(false);
+        mSwitch.setEnabled(false);
     }
 }
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
index 6eabf36..8794a8d 100644
--- a/src/com/android/settings/location/LocationSettings.java
+++ b/src/com/android/settings/location/LocationSettings.java
@@ -53,6 +53,7 @@
     private static final String KEY_LOCATION_SERVICES = "location_services";
 
     private SwitchBar mSwitchBar;
+    private Switch mSwitch;
     private boolean mValidListener;
     private Preference mLocationMode;
     private PreferenceCategory mCategoryRecentLocationRequests;
@@ -71,6 +72,7 @@
         final SettingsActivity activity = (SettingsActivity) getActivity();
 
         mSwitchBar = activity.getSwitchBar();
+        mSwitch = mSwitchBar.getSwitch();
     }
 
     @Override
@@ -219,16 +221,16 @@
         // corner cases, the location might still be enabled. In such case the master switch should
         // be disabled but checked.
         boolean enabled = (mode != android.provider.Settings.Secure.LOCATION_MODE_OFF);
-        mSwitchBar.setSwitchEnabled(!restricted);
+        mSwitch.setEnabled(!restricted);
         mLocationMode.setEnabled(enabled && !restricted);
         mCategoryRecentLocationRequests.setEnabled(enabled);
 
-        if (enabled != mSwitchBar.isSwitchChecked()) {
+        if (enabled != mSwitch.isChecked()) {
             // set listener to null so that that code below doesn't trigger onCheckedChanged()
             if (mValidListener) {
                 mSwitchBar.removeOnSwitchChangeListener(this);
             }
-            mSwitchBar.setSwitchChecked(enabled);
+            mSwitch.setChecked(enabled);
             if (mValidListener) {
                 mSwitchBar.addOnSwitchChangeListener(this);
             }
diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java
index b63a975..eb3ff9b 100644
--- a/src/com/android/settings/nfc/AndroidBeam.java
+++ b/src/com/android/settings/nfc/AndroidBeam.java
@@ -33,6 +33,7 @@
     private View mView;
     private NfcAdapter mNfcAdapter;
     private SwitchBar mSwitchBar;
+    private Switch mSwitch;
     private CharSequence mOldActivityTitle;
 
     @Override
@@ -62,7 +63,8 @@
         SettingsActivity activity = (SettingsActivity) getActivity();
 
         mSwitchBar = activity.getSwitchBar();
-        mSwitchBar.setSwitchChecked(mNfcAdapter.isNdefPushEnabled());
+        mSwitch = mSwitchBar.getSwitch();
+        mSwitch.setChecked(mNfcAdapter.isNdefPushEnabled());
     }
 
     @Override
@@ -92,15 +94,15 @@
     @Override
     public void onSwitchChanged(Switch switchView, boolean desiredState) {
         boolean success = false;
-        mSwitchBar.setSwitchEnabled(false);
+        mSwitch.setEnabled(false);
         if (desiredState) {
             success = mNfcAdapter.enableNdefPush();
         } else {
             success = mNfcAdapter.disableNdefPush();
         }
         if (success) {
-            mSwitchBar.setSwitchChecked(desiredState);
+            mSwitch.setChecked(desiredState);
         }
-        mSwitchBar.setSwitchEnabled(true);
+        mSwitch.setEnabled(true);
     }
 }
diff --git a/src/com/android/settings/notification/NotificationSettings.java b/src/com/android/settings/notification/NotificationSettings.java
index e32419d..8caa420 100644
--- a/src/com/android/settings/notification/NotificationSettings.java
+++ b/src/com/android/settings/notification/NotificationSettings.java
@@ -23,6 +23,8 @@
 import android.content.IntentFilter;
 import android.content.pm.PackageManager;
 import android.database.ContentObserver;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteException;
 import android.media.AudioManager;
 import android.media.RingtoneManager;
 import android.net.Uri;
@@ -36,16 +38,15 @@
 import android.preference.PreferenceScreen;
 import android.preference.SeekBarVolumizer;
 import android.preference.TwoStatePreference;
+import android.provider.MediaStore;
 import android.provider.SearchIndexableResource;
 import android.provider.Settings;
 
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.SoundSettings;
 import com.android.settings.Utils;
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
-import com.android.settings.search.Indexable.SearchIndexProvider;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -201,14 +202,14 @@
         @Override
         public void run() {
             if (mPhoneRingtonePreference != null) {
-                final CharSequence summary = SoundSettings.updateRingtoneName(
+                final CharSequence summary = updateRingtoneName(
                         mContext, RingtoneManager.TYPE_RINGTONE);
                 if (summary != null) {
                     mHandler.obtainMessage(H.UPDATE_PHONE_RINGTONE, summary).sendToTarget();
                 }
             }
             if (mNotificationRingtonePreference != null) {
-                final CharSequence summary = SoundSettings.updateRingtoneName(
+                final CharSequence summary = updateRingtoneName(
                         mContext, RingtoneManager.TYPE_NOTIFICATION);
                 if (summary != null) {
                     mHandler.obtainMessage(H.UPDATE_NOTIFICATION_RINGTONE, summary).sendToTarget();
@@ -217,6 +218,35 @@
         }
     };
 
+    private static CharSequence updateRingtoneName(Context context, int type) {
+        if (context == null) return null;
+        Uri ringtoneUri = RingtoneManager.getActualDefaultRingtoneUri(context, type);
+        CharSequence summary = context.getString(com.android.internal.R.string.ringtone_unknown);
+        // Is it a silent ringtone?
+        if (ringtoneUri == null) {
+            summary = context.getString(com.android.internal.R.string.ringtone_silent);
+        } else {
+            // Fetch the ringtone title from the media provider
+            Cursor cursor = null;
+            try {
+                cursor = context.getContentResolver().query(ringtoneUri,
+                        new String[] { MediaStore.Audio.Media.TITLE }, null, null, null);
+                if (cursor != null) {
+                    if (cursor.moveToFirst()) {
+                        summary = cursor.getString(0);
+                    }
+                }
+            } catch (SQLiteException sqle) {
+                // Unknown title for the ringtone
+            } finally {
+                if (cursor != null) {
+                    cursor.close();
+                }
+            }
+        }
+        return summary;
+    }
+
     // === Vibrate when ringing ===
 
     private void initVibrateWhenRinging(PreferenceScreen root) {
diff --git a/src/com/android/settings/notification/OtherSoundSettings.java b/src/com/android/settings/notification/OtherSoundSettings.java
new file mode 100644
index 0000000..de5c917
--- /dev/null
+++ b/src/com/android/settings/notification/OtherSoundSettings.java
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2014 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 static com.android.settings.notification.SettingPref.TYPE_GLOBAL;
+import static com.android.settings.notification.SettingPref.TYPE_SYSTEM;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.ContentObserver;
+import android.media.AudioManager;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Vibrator;
+import android.provider.SearchIndexableResource;
+import android.provider.Settings.Global;
+import android.provider.Settings.System;
+import android.telephony.TelephonyManager;
+
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class OtherSoundSettings extends SettingsPreferenceFragment implements Indexable {
+    private static final String TAG = "OtherSoundSettings";
+
+    private static final int DEFAULT_ON = 1;
+
+    private static final int EMERGENCY_TONE_SILENT = 0;
+    private static final int EMERGENCY_TONE_ALERT = 1;
+    private static final int EMERGENCY_TONE_VIBRATE = 2;
+    private static final int DEFAULT_EMERGENCY_TONE = EMERGENCY_TONE_SILENT;
+
+    private static final int DOCK_AUDIO_MEDIA_DISABLED = 0;
+    private static final int DOCK_AUDIO_MEDIA_ENABLED = 1;
+    private static final int DEFAULT_DOCK_AUDIO_MEDIA = DOCK_AUDIO_MEDIA_DISABLED;
+
+    private static final String KEY_DIAL_PAD_TONES = "dial_pad_tones";
+    private static final String KEY_SCREEN_LOCKING_SOUNDS = "screen_locking_sounds";
+    private static final String KEY_DOCKING_SOUNDS = "docking_sounds";
+    private static final String KEY_TOUCH_SOUNDS = "touch_sounds";
+    private static final String KEY_VIBRATE_ON_TOUCH = "vibrate_on_touch";
+    private static final String KEY_DOCK_AUDIO_MEDIA = "dock_audio_media";
+    private static final String KEY_EMERGENCY_TONE = "emergency_tone";
+
+    private static final SettingPref PREF_DIAL_PAD_TONES = new SettingPref(
+            TYPE_SYSTEM, KEY_DIAL_PAD_TONES, System.DTMF_TONE_WHEN_DIALING, DEFAULT_ON) {
+        @Override
+        public boolean isApplicable(Context context) {
+            return Utils.isVoiceCapable(context);
+        }
+    };
+
+    private static final SettingPref PREF_SCREEN_LOCKING_SOUNDS = new SettingPref(
+            TYPE_SYSTEM, KEY_SCREEN_LOCKING_SOUNDS, System.LOCKSCREEN_SOUNDS_ENABLED, DEFAULT_ON);
+
+    private static final SettingPref PREF_DOCKING_SOUNDS = new SettingPref(
+            TYPE_GLOBAL, KEY_DOCKING_SOUNDS, Global.DOCK_SOUNDS_ENABLED, DEFAULT_ON) {
+        @Override
+        public boolean isApplicable(Context context) {
+            return hasDockSettings(context);
+        }
+    };
+
+    private static final SettingPref PREF_TOUCH_SOUNDS = new SettingPref(
+            TYPE_SYSTEM, KEY_TOUCH_SOUNDS, System.SOUND_EFFECTS_ENABLED, DEFAULT_ON) {
+        @Override
+        protected boolean setSetting(Context context, int value) {
+            final AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+            if (value != 0) {
+                am.loadSoundEffects();
+            } else {
+                am.unloadSoundEffects();
+            }
+            return super.setSetting(context, value);
+        }
+    };
+
+    private static final SettingPref PREF_VIBRATE_ON_TOUCH = new SettingPref(
+            TYPE_SYSTEM, KEY_VIBRATE_ON_TOUCH, System.HAPTIC_FEEDBACK_ENABLED, DEFAULT_ON) {
+        @Override
+        public boolean isApplicable(Context context) {
+            return hasHaptic(context);
+        }
+    };
+
+    private static final SettingPref PREF_DOCK_AUDIO_MEDIA = new SettingPref(
+            TYPE_GLOBAL, KEY_DOCK_AUDIO_MEDIA, Global.DOCK_AUDIO_MEDIA_ENABLED,
+            DEFAULT_DOCK_AUDIO_MEDIA, DOCK_AUDIO_MEDIA_DISABLED, DOCK_AUDIO_MEDIA_ENABLED) {
+        @Override
+        public boolean isApplicable(Context context) {
+            return hasDockSettings(context);
+        }
+
+        @Override
+        protected int getResId(Context context, int value) {
+            if (value == DOCK_AUDIO_MEDIA_DISABLED) return R.string.dock_audio_media_disabled;
+            if (value == DOCK_AUDIO_MEDIA_ENABLED) return R.string.dock_audio_media_enabled;
+            throw new IllegalArgumentException();
+        }
+    };
+
+    private static final SettingPref PREF_EMERGENCY_TONE = new SettingPref(
+            TYPE_GLOBAL, KEY_EMERGENCY_TONE, Global.EMERGENCY_TONE, DEFAULT_EMERGENCY_TONE,
+            EMERGENCY_TONE_ALERT, EMERGENCY_TONE_VIBRATE, EMERGENCY_TONE_SILENT) {
+        @Override
+        public boolean isApplicable(Context context) {
+            final int activePhoneType = TelephonyManager.getDefault().getCurrentPhoneType();
+            return activePhoneType == TelephonyManager.PHONE_TYPE_CDMA;
+        }
+
+        @Override
+        protected int getResId(Context context, int value) {
+            if (value == EMERGENCY_TONE_SILENT) return R.string.emergency_tone_silent;
+            if (value == EMERGENCY_TONE_ALERT) return R.string.emergency_tone_alert;
+            if (value == EMERGENCY_TONE_VIBRATE) return R.string.emergency_tone_vibrate;
+            throw new IllegalArgumentException();
+        }
+    };
+
+    private static final SettingPref[] PREFS = {
+        PREF_DIAL_PAD_TONES,
+        PREF_SCREEN_LOCKING_SOUNDS,
+        PREF_DOCKING_SOUNDS,
+        PREF_TOUCH_SOUNDS,
+        PREF_VIBRATE_ON_TOUCH,
+        PREF_DOCK_AUDIO_MEDIA,
+        PREF_EMERGENCY_TONE,
+    };
+
+    private final SettingsObserver mSettingsObserver = new SettingsObserver();
+
+    private Context mContext;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        addPreferencesFromResource(R.xml.other_sound_settings);
+
+        mContext = getActivity();
+
+        for (SettingPref pref : PREFS) {
+            pref.init(this);
+        }
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        mSettingsObserver.register(true);
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+        mSettingsObserver.register(false);
+    }
+
+    private static boolean hasDockSettings(Context context) {
+        return context.getResources().getBoolean(R.bool.has_dock_settings);
+    }
+
+    private static boolean hasHaptic(Context context) {
+        final Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+        return vibrator != null && vibrator.hasVibrator();
+    }
+
+    // === Callbacks ===
+
+    private final class SettingsObserver extends ContentObserver {
+        public SettingsObserver() {
+            super(new Handler());
+        }
+
+        public void register(boolean register) {
+            final ContentResolver cr = getContentResolver();
+            if (register) {
+                for (SettingPref pref : PREFS) {
+                    cr.registerContentObserver(pref.getUri(), false, this);
+                }
+            } else {
+                cr.unregisterContentObserver(this);
+            }
+        }
+
+        @Override
+        public void onChange(boolean selfChange, Uri uri) {
+            super.onChange(selfChange, uri);
+            for (SettingPref pref : PREFS) {
+                if (pref.getUri().equals(uri)) {
+                    pref.update(mContext);
+                    return;
+                }
+            }
+        }
+    }
+
+    // === Indexing ===
+
+    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+
+        public List<SearchIndexableResource> getXmlResourcesToIndex(
+                Context context, boolean enabled) {
+            final SearchIndexableResource sir = new SearchIndexableResource(context);
+            sir.xmlResId = R.xml.other_sound_settings;
+            return Arrays.asList(sir);
+        }
+
+        public List<String> getNonIndexableKeys(Context context) {
+            final ArrayList<String> rt = new ArrayList<String>();
+            for (SettingPref pref : PREFS) {
+                if (!pref.isApplicable(context)) {
+                    rt.add(pref.getKey());
+                }
+            }
+            return rt;
+        }
+    };
+}
diff --git a/src/com/android/settings/notification/SettingPref.java b/src/com/android/settings/notification/SettingPref.java
new file mode 100644
index 0000000..1e50e2b
--- /dev/null
+++ b/src/com/android/settings/notification/SettingPref.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2014 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 android.content.ContentResolver;
+import android.content.Context;
+import android.net.Uri;
+import android.preference.Preference;
+import android.preference.TwoStatePreference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.provider.Settings.Global;
+import android.provider.Settings.System;
+
+import com.android.settings.SettingsPreferenceFragment;
+
+/** Helper to manage a two-state or dropdown preference bound to a global or system setting. */
+public class SettingPref {
+    public static final int TYPE_GLOBAL = 1;
+    public static final int TYPE_SYSTEM = 2;
+
+    private final int mType;
+    private final String mKey;
+    private final String mSetting;
+    private final int mDefault;
+    private final int[] mValues;
+    private final Uri mUri;
+
+    private TwoStatePreference mTwoState;
+    private DropDownPreference mDropDown;
+
+    public SettingPref(int type, String key, String setting, int def, int... values) {
+        mType = type;
+        mKey = key;
+        mSetting = setting;
+        mDefault = def;
+        mValues = values;
+        mUri = getUriFor(mType, mSetting);
+    }
+
+    public boolean isApplicable(Context context) {
+        return true;
+    }
+
+    protected int getResId(Context context, int value) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void init(SettingsPreferenceFragment settings) {
+        final Context context = settings.getActivity();
+        Preference p = settings.getPreferenceScreen().findPreference(mKey);
+        if (p != null && !isApplicable(context)) {
+            settings.getPreferenceScreen().removePreference(p);
+            p = null;
+        }
+        if (p instanceof TwoStatePreference) {
+            mTwoState = (TwoStatePreference) p;
+        } else if (p instanceof DropDownPreference) {
+            mDropDown = (DropDownPreference) p;
+            for (int value : mValues) {
+                mDropDown.addItem(getResId(context, value), value);
+            }
+        }
+        update(context);
+        if (mTwoState != null) {
+            p.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
+                @Override
+                public boolean onPreferenceChange(Preference preference, Object newValue) {
+                    setSetting(context, (Boolean) newValue ? 1 : 0);
+                    return true;
+                }
+            });
+        } else if (mDropDown != null) {
+            mDropDown.setCallback(new DropDownPreference.Callback() {
+                @Override
+                public boolean onItemSelected(int pos, Object value) {
+                    return setSetting(context, (Integer) value);
+                }
+            });
+        }
+    }
+
+    protected boolean setSetting(Context context, int value) {
+        return putInt(mType, context.getContentResolver(), mSetting, value);
+    }
+
+    public Uri getUri() {
+        return mUri;
+    }
+
+    public String getKey() {
+        return mKey;
+    }
+
+    public void update(Context context) {
+        final int val = getInt(mType, context.getContentResolver(), mSetting, mDefault);
+        if (mTwoState != null) {
+            mTwoState.setChecked(val != 0);
+        } else if (mDropDown != null) {
+            mDropDown.setSelectedValue(val);
+        }
+    }
+
+    private static Uri getUriFor(int type, String setting) {
+        switch(type) {
+            case TYPE_GLOBAL:
+                return Global.getUriFor(setting);
+            case TYPE_SYSTEM:
+                return System.getUriFor(setting);
+        }
+        throw new IllegalArgumentException();
+    }
+
+    private static boolean putInt(int type, ContentResolver cr, String setting, int value) {
+        switch(type) {
+            case TYPE_GLOBAL:
+                return Global.putInt(cr, setting, value);
+            case TYPE_SYSTEM:
+                return System.putInt(cr, setting, value);
+        }
+        throw new IllegalArgumentException();
+    }
+
+    private static int getInt(int type, ContentResolver cr, String setting, int def) {
+        switch(type) {
+            case TYPE_GLOBAL:
+                return Global.getInt(cr, setting, def);
+            case TYPE_SYSTEM:
+                return System.getInt(cr, setting, def);
+        }
+        throw new IllegalArgumentException();
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/notification/TouchSoundSettings.java b/src/com/android/settings/notification/TouchSoundSettings.java
deleted file mode 100644
index 2d7149e..0000000
--- a/src/com/android/settings/notification/TouchSoundSettings.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2014 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 android.content.ContentResolver;
-import android.content.Context;
-import android.database.ContentObserver;
-import android.media.AudioManager;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Vibrator;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.TwoStatePreference;
-import android.provider.Settings.System;
-
-import com.android.settings.R;
-import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
-
-public class TouchSoundSettings extends SettingsPreferenceFragment {
-    private static final String TAG = "TouchSoundSettings";
-
-    private static final String KEY_DIAL_PAD_TONES = "dial_pad_tones";
-    private static final String KEY_SCREEN_LOCKING_SOUNDS = "screen_locking_sounds";
-    private static final String KEY_OTHER_TOUCH_SOUNDS = "other_touch_sounds";
-    private static final String KEY_VIBRATE_ON_TOUCH = "vibrate_on_touch";
-
-    private final Handler mHandler = new Handler();
-    private final SettingsObserver mSettingsObserver = new SettingsObserver();
-
-    private AudioManager mAudioManager;
-    private SystemSettingPref mDialPadTones;
-    private SystemSettingPref mScreenLockingSounds;
-    private SystemSettingPref mOtherTouchSounds;
-    private SystemSettingPref mVibrateOnTouch;
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        addPreferencesFromResource(R.xml.touch_sound_settings);
-
-        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
-
-        final boolean hasVoice = Utils.isVoiceCapable(getActivity());
-        final Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
-        final boolean hasHaptic = vibrator != null && vibrator.hasVibrator();
-
-        mDialPadTones = new SystemSettingPref(hasVoice,
-                KEY_DIAL_PAD_TONES, System.DTMF_TONE_WHEN_DIALING);
-
-        mScreenLockingSounds = new SystemSettingPref(true,
-                KEY_SCREEN_LOCKING_SOUNDS, System.LOCKSCREEN_SOUNDS_ENABLED);
-
-        mOtherTouchSounds = new SystemSettingPref(true,
-                KEY_OTHER_TOUCH_SOUNDS,System.SOUND_EFFECTS_ENABLED) {
-            @Override
-            protected void setSetting(boolean value) {
-                if (value) {
-                    mAudioManager.loadSoundEffects();
-                } else {
-                    mAudioManager.unloadSoundEffects();
-                }
-                super.setSetting(value);
-            }
-        };
-
-        mVibrateOnTouch = new SystemSettingPref(hasHaptic,
-                KEY_VIBRATE_ON_TOUCH, System.HAPTIC_FEEDBACK_ENABLED);
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        mSettingsObserver.register(true);
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        mSettingsObserver.register(false);
-    }
-
-    // === Common system setting preference helper ===
-
-    private class SystemSettingPref {
-        private final String mSetting;
-        private final Uri mUri;
-
-        private TwoStatePreference mPref;
-
-        private SystemSettingPref(boolean applicable, String key, String setting) {
-            mSetting = setting;
-            mUri = System.getUriFor(mSetting);
-            if (!applicable) removePreference(key);
-            mPref = (TwoStatePreference) getPreferenceScreen().findPreference(key);
-            if (mPref == null) return;
-            update();
-            mPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    setSetting((Boolean)newValue);
-                    return true;
-                }
-            });
-        }
-
-        protected void setSetting(boolean value) {
-            System.putInt(getContentResolver(), mSetting, value ? 1 : 0);
-        }
-
-        private Uri getUri() {
-            return mUri;
-        }
-
-        private void update() {
-            if (mPref == null) return;
-            mPref.setChecked(System.getInt(getContentResolver(), mSetting, 1) != 0);
-        }
-    }
-
-    // === Callbacks ===
-
-    private final class SettingsObserver extends ContentObserver {
-        public SettingsObserver() {
-            super(mHandler);
-        }
-
-        public void register(boolean register) {
-            final ContentResolver cr = getContentResolver();
-            if (register) {
-                cr.registerContentObserver(mDialPadTones.getUri(), false, this);
-                cr.registerContentObserver(mScreenLockingSounds.getUri(), false, this);
-                cr.registerContentObserver(mOtherTouchSounds.getUri(), false, this);
-                cr.registerContentObserver(mVibrateOnTouch.getUri(), false, this);
-            } else {
-                cr.unregisterContentObserver(this);
-            }
-        }
-
-        @Override
-        public void onChange(boolean selfChange, Uri uri) {
-            super.onChange(selfChange, uri);
-            if (mDialPadTones.getUri().equals(uri)) {
-                mDialPadTones.update();
-            }
-            if (mScreenLockingSounds.getUri().equals(uri)) {
-                mScreenLockingSounds.update();
-            }
-            if (mOtherTouchSounds.getUri().equals(uri)) {
-                mOtherTouchSounds.update();
-            }
-            if (mVibrateOnTouch.getUri().equals(uri)) {
-                mVibrateOnTouch.update();
-            }
-        }
-    }
-}
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index 7b7c9ee..8a66d1b 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -104,6 +104,7 @@
     private final SettingsObserver mSettingsObserver = new SettingsObserver();
 
     private SwitchBar mSwitchBar;
+    private Switch mSwitch;
     private Context mContext;
     private PackageManager mPM;
     private ZenModeConfig mConfig;
@@ -155,6 +156,7 @@
         if (DEBUG) Log.d(TAG, "Loaded mConfig=" + mConfig);
 
         mSwitchBar = ((SettingsActivity) mContext).getSwitchBar();
+        mSwitch = mSwitchBar.getSwitch();
 
         final PreferenceCategory general = (PreferenceCategory) root.findPreference(KEY_GENERAL);
 
@@ -390,8 +392,8 @@
     private void updateZenMode() {
         final boolean zenMode = Global.getInt(getContentResolver(),
                 Global.ZEN_MODE, Global.ZEN_MODE_OFF) != Global.ZEN_MODE_OFF;
-        if (mSwitchBar.isSwitchChecked() != zenMode) {
-            mSwitchBar.setSwitchChecked(zenMode);
+        if (mSwitch.isChecked() != zenMode) {
+            mSwitch.setChecked(zenMode);
             mIgnoreNext = true;
         }
     }
diff --git a/src/com/android/settings/print/PrintServiceSettingsFragment.java b/src/com/android/settings/print/PrintServiceSettingsFragment.java
index c1ebcb9..f104a06 100644
--- a/src/com/android/settings/print/PrintServiceSettingsFragment.java
+++ b/src/com/android/settings/print/PrintServiceSettingsFragment.java
@@ -112,6 +112,7 @@
     };
 
     private SwitchBar mSwitchBar;
+    private ToggleSwitch mToggleSwitch;
 
     private String mPreferenceKey;
 
@@ -208,13 +209,13 @@
         switch (which) {
             case DialogInterface.BUTTON_POSITIVE:
                 checked = true;
-                mSwitchBar.setSwitchChecked(checked);
+                mToggleSwitch.setCheckedInternal(checked);
                 getArguments().putBoolean(PrintSettingsFragment.EXTRA_CHECKED, checked);
                 onPreferenceToggled(mPreferenceKey, checked);
                 break;
             case DialogInterface.BUTTON_NEGATIVE:
                 checked = false;
-                mSwitchBar.setSwitchChecked(checked);
+                mToggleSwitch.setCheckedInternal(checked);
                 getArguments().putBoolean(PrintSettingsFragment.EXTRA_CHECKED, checked);
                 onPreferenceToggled(mPreferenceKey, checked);
                 break;
@@ -227,7 +228,7 @@
         ListView listView = getListView();
         ViewGroup contentRoot = (ViewGroup) listView.getParent();
         View emptyView = listView.getEmptyView();
-        if (!mSwitchBar.isSwitchChecked()) {
+        if (!mToggleSwitch.isChecked()) {
             if (emptyView != null && emptyView.getId() != R.id.empty_print_state) {
                 contentRoot.removeView(emptyView);
                 emptyView = null;
@@ -276,10 +277,10 @@
         List<ComponentName> services = PrintSettingsUtils.readEnabledPrintServices(getActivity());
         mServiceEnabled = services.contains(mComponentName);
         if (mServiceEnabled) {
-            mSwitchBar.setSwitchChecked(true);
+            mToggleSwitch.setCheckedInternal(true);
             mPrintersAdapter.enable();
         } else {
-            mSwitchBar.setSwitchChecked(false);
+            mToggleSwitch.setCheckedInternal(false);
             mPrintersAdapter.disable();
         }
         getActivity().invalidateOptionsMenu();
@@ -292,12 +293,14 @@
         final SettingsActivity activity = (SettingsActivity) getActivity();
 
         mSwitchBar = activity.getSwitchBar();
-        mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new ToggleSwitch.OnBeforeCheckedChangeListener() {
+
+        mToggleSwitch = mSwitchBar.getSwitch();
+        mToggleSwitch.setOnBeforeCheckedChangeListener(new ToggleSwitch.OnBeforeCheckedChangeListener() {
             @Override
             public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
                 if (checked) {
                     if (!TextUtils.isEmpty(mEnableWarningMessage)) {
-                        mSwitchBar.setSwitchChecked(false);
+                        toggleSwitch.setCheckedInternal(false);
                         getArguments().putBoolean(PrintSettingsFragment.EXTRA_CHECKED, false);
                         showDialog(DIALOG_ID_ENABLE_WARNING);
                         return true;
@@ -328,7 +331,7 @@
 
         // Enabled.
         final boolean enabled = arguments.getBoolean(PrintSettingsFragment.EXTRA_CHECKED);
-        mSwitchBar.setSwitchChecked(enabled);
+        mToggleSwitch.setCheckedInternal(enabled);
 
         // Settings title and intent.
         String settingsTitle = arguments.getString(PrintSettingsFragment.EXTRA_SETTINGS_TITLE);
diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java
index adddb39..b1d21af 100644
--- a/src/com/android/settings/search/Index.java
+++ b/src/com/android/settings/search/Index.java
@@ -45,6 +45,7 @@
 
 import java.io.IOException;
 import java.lang.reflect.Field;
+import java.text.Normalizer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
@@ -54,6 +55,7 @@
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.regex.Pattern;
 
 import static android.provider.SearchIndexablesContract.COLUMN_INDEX_NON_INDEXABLE_KEYS_KEY_VALUE;
 import static android.provider.SearchIndexablesContract.COLUMN_INDEX_RAW_RANK;
@@ -150,8 +152,11 @@
 
     private static final List<String> EMPTY_LIST = Collections.<String>emptyList();
 
-
     private static Index sInstance;
+
+    private static final Pattern REMOVE_DIACRITICALS_PATTERN
+            = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
+
     private final AtomicBoolean mIsAvailable = new AtomicBoolean(false);
     private final UpdateData mDataToProcess = new UpdateData();
     private Context mContext;
@@ -914,31 +919,13 @@
             String intentAction, String intentTargetPackage, String intentTargetClass,
             boolean enabled, String key) {
 
-        String updatedTitle;
-        if (title != null) {
-            updatedTitle = title.replaceAll(NON_BREAKING_HYPHEN, HYPHEN);
-        }
-        else {
-            updatedTitle = EMPTY;
-        }
+        final String updatedTitle = normalizeHyphen(title);
+        final String updatedSummaryOn = normalizeHyphen(summaryOn);
+        final String updatedSummaryOff = normalizeHyphen(summaryOff);
 
-        String updatedSummaryOn;
-        if (summaryOn != null) {
-            updatedSummaryOn = summaryOn.replaceAll(NON_BREAKING_HYPHEN, HYPHEN);
-        } else {
-            updatedSummaryOn = EMPTY;
-        }
-
-        String updatedSummaryOff;
-        if (summaryOff != null) {
-            updatedSummaryOff = summaryOff.replaceAll(NON_BREAKING_HYPHEN, HYPHEN);
-        } else {
-            updatedSummaryOff = EMPTY;
-        }
-
-        String normalizedTitle = updatedTitle.replaceAll(HYPHEN, EMPTY);
-        String normalizedSummaryOn = updatedSummaryOn.replaceAll(HYPHEN, EMPTY);
-        String normalizedSummaryOff = updatedSummaryOff.replaceAll(HYPHEN, EMPTY);
+        final String normalizedTitle = normalizeString(updatedTitle);
+        final String normalizedSummaryOn = normalizeString(updatedSummaryOn);
+        final String normalizedSummaryOff = normalizeString(updatedSummaryOff);
 
         updateOneRow(database, locale,
                 updatedTitle, normalizedTitle, updatedSummaryOn, normalizedSummaryOn,
@@ -947,6 +934,17 @@
                 rank, keywords, intentAction, intentTargetPackage, intentTargetClass, enabled, key);
     }
 
+    private static String normalizeHyphen(String input) {
+        return (input != null) ? input.replaceAll(NON_BREAKING_HYPHEN, HYPHEN) : EMPTY;
+    }
+
+    private static String normalizeString(String input) {
+        final String nohyphen = (input != null) ? input.replaceAll(HYPHEN, EMPTY) : EMPTY;
+        final String normalized = Normalizer.normalize(nohyphen, Normalizer.Form.NFD);
+
+        return REMOVE_DIACRITICALS_PATTERN.matcher(normalized).replaceAll("").toLowerCase();
+    }
+
     private void updateOneRow(SQLiteDatabase database, String locale,
             String updatedTitle, String normalizedTitle,
             String updatedSummaryOn, String normalizedSummaryOn,
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index 7ba6371..2d6388f 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -28,7 +28,6 @@
 import com.android.settings.PrivacySettings;
 import com.android.settings.R;
 import com.android.settings.SecuritySettings;
-import com.android.settings.SoundSettings;
 import com.android.settings.WallpaperTypeSettings;
 import com.android.settings.WirelessSettings;
 import com.android.settings.accessibility.AccessibilitySettings;
@@ -39,7 +38,7 @@
 import com.android.settings.location.LocationSettings;
 import com.android.settings.notification.NotificationDisplaySettings;
 import com.android.settings.notification.NotificationSettings;
-import com.android.settings.notification.TouchSoundSettings;
+import com.android.settings.notification.OtherSoundSettings;
 import com.android.settings.notification.ZenModeSettings;
 import com.android.settings.print.PrintSettingsFragment;
 import com.android.settings.users.UserSettings;
@@ -58,7 +57,6 @@
     public static final int RANK_DATA_USAGE = 3;
     public static final int RANK_WIRELESS = 4;
     public static final int RANK_HOME = 5;
-    public static final int RANK_SOUND = 6;
     public static final int RANK_DISPLAY = 7;
     public static final int RANK_WALLPAPER = 7;
     public static final int RANK_NOTIFICATIONS = 8;
@@ -116,12 +114,6 @@
                         HomeSettings.class.getName(),
                         R.drawable.ic_settings_home));
 
-        sResMap.put(SoundSettings.class.getName(),
-                new SearchIndexableResource(RANK_SOUND,
-                        R.xml.sound_settings,
-                        SoundSettings.class.getName(),
-                        R.drawable.ic_settings_sound));
-
         sResMap.put(DisplaySettings.class.getName(),
                 new SearchIndexableResource(RANK_DISPLAY,
                         R.xml.display_settings,
@@ -146,10 +138,10 @@
                         NotificationDisplaySettings.class.getName(),
                         R.drawable.ic_settings_notifications));
 
-        sResMap.put(TouchSoundSettings.class.getName(),
+        sResMap.put(OtherSoundSettings.class.getName(),
                 new SearchIndexableResource(RANK_NOTIFICATIONS,
-                        R.xml.touch_sound_settings,
-                        TouchSoundSettings.class.getName(),
+                        NO_DATA_RES_ID,
+                        OtherSoundSettings.class.getName(),
                         R.drawable.ic_settings_notifications));
 
         sResMap.put(ZenModeSettings.class.getName(),
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index 1d4fe71..4a98661 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -28,6 +28,7 @@
 import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
 import android.content.Intent;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.preference.ListPreference;
 import android.preference.Preference;
@@ -164,6 +165,9 @@
 
         setTtsUtteranceProgressListener();
         initSettings();
+
+        // Prevent restarting the TTS connection on rotation
+        setRetainInstance(true);
     }
 
     @Override
diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java
index 1675f2a..40c8481 100644
--- a/src/com/android/settings/widget/SwitchBar.java
+++ b/src/com/android/settings/widget/SwitchBar.java
@@ -84,7 +84,10 @@
 
         // Default is hide
         setVisibility(View.GONE);
-        mSwitch.setVisibility(View.GONE);
+    }
+
+    public ToggleSwitch getSwitch() {
+        return mSwitch;
     }
 
     public void show() {
@@ -122,39 +125,4 @@
         }
         mSwitchChangeListeners.remove(listener);
     }
-
-    public void setSwitchOnBeforeCheckedChangeListener(
-            ToggleSwitch.OnBeforeCheckedChangeListener listener) {
-        mSwitch.setOnBeforeCheckedChangeListener(listener);
-    }
-
-    public void setSwitchChecked(boolean checked) {
-        setSwitchChecked(checked, false);
-    }
-
-    public void setSwitchChecked(boolean checked, boolean checkBefore) {
-        if (checkBefore) {
-            ToggleSwitch.OnBeforeCheckedChangeListener listener =
-                    mSwitch.getOnBeforeCheckedChangeListener();
-            if (listener != null && listener.onBeforeCheckedChanged(mSwitch, checked)) {
-                return;
-            }
-
-        }
-        mSwitch.setCheckedInternal(checked);
-        if (mSwitch.getVisibility() == View.GONE) {
-            mSwitch.setVisibility(View.VISIBLE);
-        }
-    }
-
-    public void setSwitchEnabled(boolean enabled) {
-        mSwitch.setEnabled(enabled);
-        if (mSwitch.getVisibility() == View.GONE) {
-            mSwitch.setVisibility(View.VISIBLE);
-        }
-    }
-
-    public boolean isSwitchChecked() {
-        return mSwitch.isChecked();
-    }
 }
diff --git a/src/com/android/settings/widget/ToggleSwitch.java b/src/com/android/settings/widget/ToggleSwitch.java
index ab0c37e..8232ff1 100644
--- a/src/com/android/settings/widget/ToggleSwitch.java
+++ b/src/com/android/settings/widget/ToggleSwitch.java
@@ -48,10 +48,6 @@
         mOnBeforeListener = listener;
     }
 
-    public OnBeforeCheckedChangeListener getOnBeforeCheckedChangeListener() {
-        return mOnBeforeListener;
-    }
-
     @Override
     public void setChecked(boolean checked) {
         if (mOnBeforeListener != null
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 1e86761..d190045 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -27,6 +27,8 @@
 import android.os.Handler;
 import android.os.Message;
 import android.provider.Settings;
+import android.view.View;
+import android.widget.CompoundButton;
 import android.widget.Switch;
 import android.widget.Toast;
 
@@ -39,6 +41,7 @@
 
 public class WifiEnabler implements SwitchBar.OnSwitchChangeListener  {
     private Context mContext;
+    private Switch mSwitch;
     private SwitchBar mSwitchBar;
     private AtomicBoolean mConnected = new AtomicBoolean(false);
 
@@ -85,6 +88,12 @@
     public WifiEnabler(Context context, SwitchBar switchBar) {
         mContext = context;
         mSwitchBar = switchBar;
+        mSwitch = switchBar.getSwitch();
+        // This is a trick: as the Wi-Fi initial state is asynchronously coming from the
+        // BroadcastReceiver we cannot have the Switch visible at first otherwise you will notice
+        // its state change later on. So start it as VIEW.GONE and make it View.VISIBLE later
+        // when its state is defined.
+        mSwitch.setVisibility(View.GONE);
 
         mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
         mIntentFilter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION);
@@ -110,26 +119,27 @@
     private void handleWifiStateChanged(int state) {
         switch (state) {
             case WifiManager.WIFI_STATE_ENABLING:
-                mSwitchBar.setSwitchEnabled(false);
+                mSwitch.setEnabled(false);
                 break;
             case WifiManager.WIFI_STATE_ENABLED:
                 setSwitchChecked(true);
-                mSwitchBar.setSwitchEnabled(true);
+                mSwitch.setEnabled(true);
                 updateSearchIndex(true);
                 break;
             case WifiManager.WIFI_STATE_DISABLING:
-                mSwitchBar.setSwitchEnabled(false);
+                mSwitch.setEnabled(false);
                 break;
             case WifiManager.WIFI_STATE_DISABLED:
                 setSwitchChecked(false);
-                mSwitchBar.setSwitchEnabled(true);
+                mSwitch.setEnabled(true);
                 updateSearchIndex(false);
                 break;
             default:
                 setSwitchChecked(false);
-                mSwitchBar.setSwitchEnabled(true);
+                mSwitch.setEnabled(true);
                 updateSearchIndex(false);
         }
+        mSwitch.setVisibility(View.VISIBLE);
     }
 
     private void updateSearchIndex(boolean isWiFiOn) {
@@ -142,9 +152,9 @@
     }
 
     private void setSwitchChecked(boolean checked) {
-        if (checked != mSwitchBar.isSwitchChecked()) {
+        if (checked != mSwitch.isChecked()) {
             mStateMachineEvent = true;
-            mSwitchBar.setSwitchChecked(checked);
+            mSwitch.setChecked(checked);
             mStateMachineEvent = false;
         }
     }
@@ -186,10 +196,10 @@
             mWifiManager.setWifiApEnabled(null, false);
         }
 
-        mSwitchBar.setSwitchEnabled(false);
+        mSwitch.setEnabled(false);
         if (!mWifiManager.setWifiEnabled(isChecked)) {
             // Error
-            mSwitchBar.setSwitchEnabled(true);
+            mSwitch.setEnabled(true);
             Toast.makeText(mContext, R.string.wifi_error, Toast.LENGTH_SHORT).show();
         }
     }
