From d819b66e3c1cd3072d38329257b8f15ddbe4a7da Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 9 Mar 2015 18:46:08 -0700 Subject: 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 --- .../dialer/settings/DialerSettingsActivity.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/com/android/dialer/settings') 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 -- cgit v1.2.3