diff options
author | Brandon Maxwell <maxwelb@google.com> | 2016-09-27 02:29:41 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-09-27 02:29:41 +0000 |
commit | 8c4386ccd34c6f73174b1405ee8ca175740c9e4b (patch) | |
tree | d5d60a14c70ca1fdcacf37d175668c5f8d81f9a3 /src/com/android | |
parent | 4ecd8a2949594cbc36140c95479c66471c3575df (diff) | |
parent | aef5e7f1d290a5fff19a85bda1ee077d122428b5 (diff) |
Fixing display option for KO, JA, ZH am: 151b3ae6ad am: 11bdbcaeb4
am: aef5e7f1d2
Change-Id: Id2d331432d296cc79f4ea3e5e2861c9712c75ec4
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/dialer/settings/DialerSettingsActivity.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java index fbdb4f9f5..dc1e21457 100644 --- a/src/com/android/dialer/settings/DialerSettingsActivity.java +++ b/src/com/android/dialer/settings/DialerSettingsActivity.java @@ -61,10 +61,12 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity { @Override public void onBuildHeaders(List<Header> target) { - Header displayOptionsHeader = new Header(); - displayOptionsHeader.titleRes = R.string.display_options_title; - displayOptionsHeader.fragment = DisplayOptionsSettingsFragment.class.getName(); - target.add(displayOptionsHeader); + if (showDisplayOptions()) { + Header displayOptionsHeader = new Header(); + displayOptionsHeader.titleRes = R.string.display_options_title; + displayOptionsHeader.fragment = DisplayOptionsSettingsFragment.class.getName(); + target.add(displayOptionsHeader); + } Header soundSettingsHeader = new Header(); soundSettingsHeader.titleRes = R.string.sounds_and_vibration_title; @@ -127,6 +129,18 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity { } } + /** + * Returns {@code true} or {@code false} based on whether the display options setting should be + * shown. For languages such as Chinese, Japanese, or Korean, display options aren't useful + * since contacts are sorted and displayed family name first by default. + * + * @return {@code true} if the display options should be shown, {@code false} otherwise. + */ + private boolean showDisplayOptions() { + return getResources().getBoolean(R.bool.config_display_order_user_changeable) + && getResources().getBoolean(R.bool.config_sort_order_user_changeable); + } + @Override public void onHeaderClick(Header header, int position) { if (header.id == R.id.settings_header_sounds_and_vibration) { |