aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2019-12-11 17:39:02 -0800
committerHall Liu <hallliu@google.com>2020-02-25 18:44:26 -0800
commit01a5ac22260f13d3c9ad6360a008192225ce4ace (patch)
tree5efa2ad0d8ef02a825caad93dc3b64faa750364b
parent8e705b502c8607dcd529ab68d0ab9e20038385fa (diff)
downloadims-01a5ac22260f13d3c9ad6360a008192225ce4ace.tar.gz
Enable RTT in the IMS stack when there's no SIM
When there's no SIM card, tell the IMS stack to enable RTT so that emergency calls can still use RTT. Bug: 122250491 Test: manual Change-Id: I7d3753e20646fd32bb06570f06475b497cd5ebe3
-rw-r--r--src/java/com/android/ims/ImsManager.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index 454429fe..8342c7ef 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -2048,8 +2048,14 @@ public class ImsManager implements IFeatureConnector {
}
public boolean updateRttConfigValue() {
+ // If there's no active sub anywhere on the device, enable RTT on the modem so that
+ // the device can make an emergency call.
+
+ boolean isActiveSubscriptionPresent = isActiveSubscriptionPresent();
boolean isCarrierSupported =
- getBooleanCarrierConfig(CarrierConfigManager.KEY_RTT_SUPPORTED_BOOL);
+ getBooleanCarrierConfig(CarrierConfigManager.KEY_RTT_SUPPORTED_BOOL)
+ || !isActiveSubscriptionPresent;
+
boolean isRttUiSettingEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.RTT_CALLING_MODE, 0) != 0;
boolean isRttAlwaysOnCarrierConfig = getBooleanCarrierConfig(
@@ -2057,7 +2063,8 @@ public class ImsManager implements IFeatureConnector {
boolean shouldImsRttBeOn = isRttUiSettingEnabled || isRttAlwaysOnCarrierConfig;
logi("update RTT: settings value: " + isRttUiSettingEnabled + " always-on carrierconfig: "
- + isRttAlwaysOnCarrierConfig);
+ + isRttAlwaysOnCarrierConfig
+ + "isActiveSubscriptionPresent: " + isActiveSubscriptionPresent);
if (isCarrierSupported) {
setRttConfig(shouldImsRttBeOn);
@@ -2723,6 +2730,12 @@ public class ImsManager implements IFeatureConnector {
subId != SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
}
+ private boolean isActiveSubscriptionPresent() {
+ SubscriptionManager sm = (SubscriptionManager) mContext.getSystemService(
+ Context.TELEPHONY_SUBSCRIPTION_SERVICE);
+ return sm.getActiveSubscriptionIdList().length > 0;
+ }
+
private void updateImsCarrierConfigs(PersistableBundle configs) throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();