Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7df46bc1 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Enable RTT in the IMS stack when there's no SIM am: 01a5ac22 am: bf0406df...

Enable RTT in the IMS stack when there's no SIM am: 01a5ac22 am: bf0406df am: e1eed7ce am: 297a4ded

Change-Id: If3927473c6518d12290112ecb96516f135e6bb59
parents 8e705b50 297a4ded
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -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();