diff options
author | Andrew Lee <anwlee@google.com> | 2015-03-09 18:46:08 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-03-11 10:29:28 -0700 |
commit | d819b66e3c1cd3072d38329257b8f15ddbe4a7da (patch) | |
tree | 99612d8d9b0a0ff6d653c6d354a7e119fb96f9b3 /src | |
parent | 735fe848092c7d510e1d042959bf5363ed1bc614 (diff) |
Hide accessibility settings if none.
If TTY mode is not supported and the device is not configured to
support hearing aid compatibility, do not show the accessibility
settings header.
Bug: 19372734
Change-Id: Id10c49cfa99cbe1f22bb69dcd5a1245e54e18ec4
Diffstat (limited to 'src')
-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 |