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

Commit 09b1bf2e authored by Dheeraj Shetty's avatar Dheeraj Shetty
Browse files

Update IMS carrier configs

Update IMS service with the IMS component configs
of CarrierConfigManager when the carrier config is loaded.

Bug: 125484786
Test: Manual

Change-Id: I63c027cd44e0d4ef58d58048b7673ecdd37f8e8b
Merged-In: I63c027cd44e0d4ef58d58048b7673ecdd37f8e8b
parent 99d68bc4
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1421,6 +1421,12 @@ public class ImsManager {

        if (!mConfigUpdated || force) {
            try {
                PersistableBundle imsCarrierConfigs =
                        mConfigManager.getConfigByComponentForSubId(
                                CarrierConfigManager.Ims.KEY_PREFIX, getSubId());

                updateImsCarrierConfigs(imsCarrierConfigs);

                // Note: currently the order of updates is set to produce different order of
                // changeEnabledCapabilities() function calls from setAdvanced4GMode(). This is done
                // to differentiate this code path from vendor code perspective.
@@ -2794,4 +2800,20 @@ public class ImsManager {
        return SubscriptionManager.isValidSubscriptionId(subId) &&
                subId != SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
    }

    private void updateImsCarrierConfigs(PersistableBundle configs) throws ImsException {
        checkAndThrowExceptionIfServiceUnavailable();

        IImsConfig config = mMmTelFeatureConnection.getConfigInterface();
        if (config == null) {
            throw new ImsException("getConfigInterface()",
                    ImsReasonInfo.CODE_LOCAL_SERVICE_UNAVAILABLE);
        }
        try {
            config.updateImsCarrierConfigs(configs);
        } catch (RemoteException e) {
            throw new ImsException("updateImsCarrierConfigs()", e,
                    ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
        }
    }
}