Merge "Respect carrier setting indicating TTY is or isn't available." am: 0e4093e1f1 am: b573d5b4b3
am: 1805c4d0d5
Change-Id: Icd4774484d63e8b30a374ee8080babb3a2504477
diff --git a/src/com/android/phone/settings/AccessibilitySettingsFragment.java b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
index 5c614d9..d540fba 100644
--- a/src/com/android/phone/settings/AccessibilitySettingsFragment.java
+++ b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
@@ -93,7 +93,7 @@
mButtonHac = (SwitchPreference) findPreference(BUTTON_HAC_KEY);
mButtonRtt = (SwitchPreference) findPreference(BUTTON_RTT_KEY);
- if (PhoneGlobals.getInstance().phoneMgr.isTtyModeSupported()) {
+ if (PhoneGlobals.getInstance().phoneMgr.isTtyModeSupported() && isTtySupportedByCarrier()) {
mButtonTty.init();
} else {
getPreferenceScreen().removePreference(mButtonTty);
@@ -191,4 +191,15 @@
}
return false;
}
+
+ /**
+ * Determines if the device supports TTY per carrier config.
+ * @return {@code true} if the carrier supports TTY, {@code false} otherwise.
+ */
+ private boolean isTtySupportedByCarrier() {
+ CarrierConfigManager configManager =
+ (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
+ return configManager.getConfig().getBoolean(
+ CarrierConfigManager.KEY_TTY_SUPPORTED_BOOL);
+ }
}