summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Maxwell <maxwelb@google.com>2016-09-27 02:08:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-09-27 02:08:13 +0000
commitaef5e7f1d290a5fff19a85bda1ee077d122428b5 (patch)
tree7f067f8750f5379cfdc99ee2d9a0b6b607d04dfa
parentf6593a4e7bcf504c0543a4e3f04b81e531c5eadd (diff)
parent11bdbcaeb4127de9d9c0ca780acc1afb316a767d (diff)
Fixing display option for KO, JA, ZH am: 151b3ae6ad
am: 11bdbcaeb4 Change-Id: I283d7c1c371143bcf59b7746d01cfa95a83668c9
-rw-r--r--src/com/android/dialer/settings/DialerSettingsActivity.java22
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) {