diff options
author | Andrew Lee <anwlee@google.com> | 2015-03-17 23:02:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-17 23:02:40 +0000 |
commit | 32fe4e9b8fb27a294074bd1eb9f6632e2ad41122 (patch) | |
tree | 583463f3a36be2bb40448314f0ca034a15701b34 | |
parent | b33c21f85eff3572aab68d5fafe053990e29e700 (diff) | |
parent | d819b66e3c1cd3072d38329257b8f15ddbe4a7da (diff) |
Merge "Hide accessibility settings if none."
-rw-r--r-- | src/com/android/dialer/settings/DialerSettingsActivity.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java index ac74a102c..8653dc9a7 100644 --- a/src/com/android/dialer/settings/DialerSettingsActivity.java +++ b/src/com/android/dialer/settings/DialerSettingsActivity.java @@ -53,10 +53,11 @@ public class DialerSettingsActivity extends PreferenceActivity { quickResponseSettingsHeader.intent = quickResponseSettingsIntent; target.add(quickResponseSettingsHeader); + TelephonyManager telephonyManager = + (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); + // Only show call setting menus if the current user is the primary/owner user. if (isPrimaryUser()) { - TelephonyManager telephonyManager = - (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); // Show "Call Settings" if there is one SIM and "Phone Accounts" if there are more. if (telephonyManager.getPhoneCount() <= 1) { Header callSettingsHeader = new Header(); @@ -78,12 +79,15 @@ public class DialerSettingsActivity extends PreferenceActivity { } } - Header accessibilitySettingsHeader = new Header(); - Intent accessibilitySettingsIntent = - new Intent(TelecomManager.ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS); - accessibilitySettingsHeader.titleRes = R.string.accessibility_settings_title; - accessibilitySettingsHeader.intent = accessibilitySettingsIntent; - target.add(accessibilitySettingsHeader); + if (telephonyManager.isTtyModeSupported() + || telephonyManager.isHearingAidCompatibilitySupported()) { + Header accessibilitySettingsHeader = new Header(); + Intent accessibilitySettingsIntent = + new Intent(TelecomManager.ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS); + accessibilitySettingsHeader.titleRes = R.string.accessibility_settings_title; + accessibilitySettingsHeader.intent = accessibilitySettingsIntent; + target.add(accessibilitySettingsHeader); + } } @Override |