Fix regression in removing settings that aren't relevant for a platform.
Bug: 2630695 The PreferenceCategories added into the hierarchy caused removePreference() to not work, since the preferences to be removed were not immediate children of the preference screen. Create empty PreferenceCategory elements and pull the preferences to the same depth as the categories. Change-Id: I34826ea4d84cda0ecab75c66a73febe3d51e7c68
This commit is contained in:
@@ -20,20 +20,17 @@
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sound_category_sound_title"
|
||||
>
|
||||
android:title="@string/sound_category_sound_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="silent"
|
||||
android:title="@string/silent_mode_title"
|
||||
android:summary="@string/silent_mode_summary"
|
||||
android:persistent="false"
|
||||
android:order="1"
|
||||
android:disableDependentsState="true" />
|
||||
|
||||
<ListPreference
|
||||
android:key="vibrate"
|
||||
android:order="6"
|
||||
android:title="@string/vibrate_title"
|
||||
android:summary="@string/vibrate_summary"
|
||||
android:entries="@array/vibrate_entries"
|
||||
@@ -46,14 +43,10 @@
|
||||
android:summary="@string/ring_volume_summary"
|
||||
android:dialogTitle="@string/all_volume_title"
|
||||
android:persistent="false"
|
||||
android:order="3"
|
||||
android:streamType="ring" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sound_category_calls_title"
|
||||
>
|
||||
android:title="@string/sound_category_calls_title"/>
|
||||
|
||||
<com.android.settings.DefaultRingtonePreference
|
||||
android:key="ringtone"
|
||||
@@ -61,14 +54,12 @@
|
||||
android:summary="@string/ringtone_summary"
|
||||
android:dialogTitle="@string/ringtone_title"
|
||||
android:persistent="false"
|
||||
android:order="5"
|
||||
android:ringtoneType="ringtone" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sound_category_notification_title"
|
||||
>
|
||||
android:title="@string/sound_category_notification_title"/>
|
||||
|
||||
<!-- Do not nest these, or removals in code will break -->
|
||||
|
||||
<com.android.settings.DefaultRingtonePreference
|
||||
android:key="notification_sound"
|
||||
@@ -76,28 +67,24 @@
|
||||
android:summary="@string/notification_sound_summary"
|
||||
android:dialogTitle="@string/notification_sound_dialog_title"
|
||||
android:persistent="false"
|
||||
android:order="7"
|
||||
android:ringtoneType="notification" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="notification_pulse"
|
||||
android:title="@string/notification_pulse_title"
|
||||
android:summary="@string/notification_pulse_summary"
|
||||
android:order="8"
|
||||
android:persistent="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sound_category_feedback_title"
|
||||
>
|
||||
android:title="@string/sound_category_feedback_title"/>
|
||||
|
||||
<!-- Do not nest these, or removals in code will break -->
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="dtmf_tone"
|
||||
android:title="@string/dtmf_tone_enable_title"
|
||||
android:summaryOn="@string/dtmf_tone_enable_summary_on"
|
||||
android:summaryOff="@string/dtmf_tone_enable_summary_off"
|
||||
android:order="9"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<CheckBoxPreference
|
||||
@@ -105,7 +92,6 @@
|
||||
android:title="@string/sound_effects_enable_title"
|
||||
android:summaryOn="@string/sound_effects_enable_summary_on"
|
||||
android:summaryOff="@string/sound_effects_enable_summary_off"
|
||||
android:order="10"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<CheckBoxPreference
|
||||
@@ -113,7 +99,6 @@
|
||||
android:title="@string/lock_sounds_enable_title"
|
||||
android:summaryOn="@string/lock_sounds_enable_summary_on"
|
||||
android:summaryOff="@string/lock_sounds_enable_summary_off"
|
||||
android:order="11"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<CheckBoxPreference
|
||||
@@ -121,7 +106,6 @@
|
||||
android:title="@string/haptic_feedback_enable_title"
|
||||
android:summaryOn="@string/haptic_feedback_enable_summary_on"
|
||||
android:summaryOff="@string/haptic_feedback_enable_summary_off"
|
||||
android:order="12"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<ListPreference
|
||||
@@ -131,6 +115,4 @@
|
||||
android:entries="@array/emergency_tone_entries"
|
||||
android:entryValues="@array/emergency_tone_values" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
Reference in New Issue
Block a user