Settings: Remove sound settings.

- Move the remaining conditional preferences into
  the combined Sound & Notifications screen.
- Refactor the "Other sounds" sub-settings screen to
  provide a home for the new preferences.
- Migrate docking sounds, conditional on config.
- Migrate docking media, conditional on config.
- Migrate emergency tones, conditional on CDMA.
- Move all boilerplate preference <-> setting plumbing into
  a separate helper.
- Since some preferences in Other sounds are now conditional,
  create a special indexer for searching.
- Remove SoundSettings (and xml), create aliases in the manifest
  to avoid breaking shortcuts.

Bug:15279526
Change-Id: I5ae3ecda2f899b1948f7908bd217a799326c2c56
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>