Merge "Make RTT while roaming configurable" am: 5ed251d5f2
Original change: https://android-review.googlesource.com/c/platform/packages/services/Telephony/+/1558634
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I0d02971dcf9a02b8da8b076dfdd28bfe2e6f0182
diff --git a/src/com/android/phone/settings/AccessibilitySettingsFragment.java b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
index 37212cf..ad3f133 100644
--- a/src/com/android/phone/settings/AccessibilitySettingsFragment.java
+++ b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
@@ -122,8 +122,12 @@
(TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
boolean isRoaming = tm.isNetworkRoaming(
SubscriptionManager.getDefaultVoiceSubscriptionId());
+ boolean alwaysAllowWhileRoaming = isCarrierAllowRttWhenRoaming(
+ SubscriptionManager.getDefaultVoiceSubscriptionId());
- boolean shouldDisableBecauseRoamingOffWfc = isRoaming && !isOnWfc();
+ boolean shouldDisableBecauseRoamingOffWfc =
+ (isRoaming && !isOnWfc()) && !alwaysAllowWhileRoaming;
+
if (shouldDisableBecauseRoamingOffWfc) {
mButtonRtt.setSummary(TextUtils.concat(getText(R.string.rtt_mode_summary), "\n",
getText(R.string.no_rtt_when_roaming)));
@@ -277,4 +281,13 @@
return configManager.getConfig().getBoolean(
CarrierConfigManager.KEY_TTY_SUPPORTED_BOOL);
}
+
+ /**
+ * Determines from carrier config whether to always allow RTT while roaming.
+ */
+ private boolean isCarrierAllowRttWhenRoaming(int subId) {
+ PersistableBundle b =
+ PhoneGlobals.getInstance().getCarrierConfigForSubId(subId);
+ return b.getBoolean(CarrierConfigManager.KEY_RTT_SUPPORTED_WHILE_ROAMING_BOOL);
+ }
}
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index 016da87..9d4edfd 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -743,6 +743,15 @@
}
/**
+ * Determines from carrier config whether to always allow RTT while roaming.
+ */
+ private boolean isCarrierAllowRttWhenRoaming() {
+ PersistableBundle b =
+ PhoneGlobals.getInstance().getCarrierConfigForSubId(mPhone.getSubId());
+ return b.getBoolean(CarrierConfigManager.KEY_RTT_SUPPORTED_WHILE_ROAMING_BOOL);
+ }
+
+ /**
* Where a device supports instant lettering and call subjects, retrieves the necessary
* PhoneAccount extras for those features.
*
@@ -894,11 +903,15 @@
boolean isRoaming = mTelephonyManager.isNetworkRoaming(mPhone.getSubId());
boolean isOnWfc = mPhone.getImsRegistrationTech()
== ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN;
+ boolean alwaysAllowWhileRoaming = isCarrierAllowRttWhenRoaming();
- boolean shouldDisableBecauseRoamingOffWfc = isRoaming && !isOnWfc;
+ boolean shouldDisableBecauseRoamingOffWfc =
+ (isRoaming && !isOnWfc) && !alwaysAllowWhileRoaming;
+
Log.i(this, "isRttCurrentlySupported -- regular acct,"
+ " hasVoiceAvailability: " + hasVoiceAvailability + "\n"
+ " isRttSupported: " + isRttSupported + "\n"
+ + " alwaysAllowWhileRoaming: " + alwaysAllowWhileRoaming + "\n"
+ " isRoaming: " + isRoaming + "\n"
+ " isOnWfc: " + isOnWfc + "\n");