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

Commit 13b90bba authored by Sonalika Paul's avatar Sonalika Paul
Browse files

IMS: When RTT is always enabled, then set the RTT_CALLING_MODE

in DB based on default RTT_MODE value.

Set the RTT_CALLING_MODE in DB to the default value, when rtt
is always enabled and RTT_MODE is not set previously.

Bug: 130010750
Change-Id: I5e766c6b79aeb4beceafa8d1f615d5016b362920
parent e353042a
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2065,10 +2065,20 @@ public class ImsManager implements IFeatureConnector {
                getBooleanCarrierConfig(CarrierConfigManager.KEY_RTT_SUPPORTED_BOOL)
                || !isActiveSubscriptionPresent;

        boolean isRttUiSettingEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.RTT_CALLING_MODE, 0) != 0;
        int defaultRttMode =
                getIntCarrierConfig(CarrierConfigManager.KEY_DEFAULT_RTT_MODE_INT);
        int rttMode = Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.RTT_CALLING_MODE, defaultRttMode);
        logi("defaultRttMode = " + defaultRttMode + " rttMode = " + rttMode);
        boolean isRttAlwaysOnCarrierConfig = getBooleanCarrierConfig(
                CarrierConfigManager.KEY_IGNORE_RTT_MODE_SETTING_BOOL);
        if (isRttAlwaysOnCarrierConfig && rttMode == defaultRttMode) {
            Settings.Secure.putInt(mContext.getContentResolver(),
                    Settings.Secure.RTT_CALLING_MODE, defaultRttMode);
        }

        boolean isRttUiSettingEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.RTT_CALLING_MODE, 0) != 0;

        boolean shouldImsRttBeOn = isRttUiSettingEnabled || isRttAlwaysOnCarrierConfig;
        logi("update RTT: settings value: " + isRttUiSettingEnabled + " always-on carrierconfig: "