Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e4cdeff authored by John Spurlock's avatar John Spurlock
Browse files

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
parent 9e8bd809
Loading
Loading
Loading
Loading
+35 −33
Original line number Diff line number Diff line
@@ -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>
+0 −14
Original line number Diff line number Diff line
@@ -471,20 +471,6 @@
        <item>Manual</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(). -->
+29 −8
Original line number Diff line number Diff line
@@ -5134,21 +5134,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>

+0 −8
Original line number Diff line number Diff line
@@ -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"
+3 −3
Original line number Diff line number Diff line
@@ -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
Loading