RTT changes for ignoring user-set setting
Check the carrier config for the ignore user-set RTT mode flag. If it's
on, don't propogate the user-set RTT mode setting to the subscription
that it's on for, and always return from isRttEnabled as if the user-set
RTT mode setting were on.
Bug: 136035164
Test: manual
Change-Id: I8039ba8061b83e315af7fb7007253978f9544100
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 073606f..e1a9592 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -5320,14 +5320,19 @@
}
/**
- * Determines whether the user has turned on RTT. Only returns true if the device and carrier
- * both also support RTT.
+ * Determines whether the user has turned on RTT. If the carrier wants to ignore the user-set
+ * RTT setting, will return true if the device and carrier both support RTT.
+ * Otherwise. only returns true if the device and carrier both also support RTT.
*/
public boolean isRttEnabled(int subscriptionId) {
final long identity = Binder.clearCallingIdentity();
try {
- return isRttSupported(subscriptionId) && Settings.Secure.getInt(
+ boolean isRttSupported = isRttSupported(subscriptionId);
+ boolean isUserRttSettingOn = Settings.Secure.getInt(
mApp.getContentResolver(), Settings.Secure.RTT_CALLING_MODE, 0) != 0;
+ boolean shouldIgnoreUserRttSetting = mApp.getCarrierConfigForSubId(subscriptionId)
+ .getBoolean(CarrierConfigManager.KEY_IGNORE_RTT_MODE_SETTING_BOOL);
+ return isRttSupported && (isUserRttSettingOn || shouldIgnoreUserRttSetting);
} finally {
Binder.restoreCallingIdentity(identity);
}