diff options
author | Brandon Maxwell <maxwelb@google.com> | 2016-09-26 15:09:51 -0700 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2016-09-26 15:09:51 -0700 |
commit | 151b3ae6ada8c2f49ea191a0dfaee5b990afd890 (patch) | |
tree | 577eac7b439dbf4c310626a20c2e759e7b0639b0 /src/com/android | |
parent | 5b66abc878ef718e8c7ed42ac8385bcf15bd4504 (diff) |
Fixing display option for KO, JA, ZH
Names in Korean, Japanese, and Chinese are sorted and displayed by
family name. Because of this, we shouldn't show the "Display Options"
setting if the device is set for these locales. Other logic in the code
will ignore the user set preferences anyway.
Bug:30782253
Change-Id: I15ff7328609aea937940fc60c43e6f0c8dfdb5d2
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) { |