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

Commit 293f5c74 authored by Abhishek Panjikar's avatar Abhishek Panjikar Committed by Benergy Meenan Ravuri
Browse files

IMS: De-registration happens when modem comes up from low power mode.

- When modem goes into low power mode and then comes up,ims
  deregistration takes place soon after registration.

- When modem comes up from low power mode, onDataEnabledChanged is called
  before the carrier config is actually loaded. Hence, while in the
  process  of updating ims service ims gets deregistered as carrier related
  information is loaded.

- Allowing to update ims service only after carrier config is properly
  loaded.Also, resetting the mCarrierConfigLoaded flag when config service
  is no longer available or we get an empty carrier config.

Test: Manual
Bug: 67033695
Change-Id: Idb1abc86bcf502d56428e4fb1e5696e73f2bc773
parent 415158fb
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.SubscriptionController;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.dataconnection.DataEnabledSettings;
import com.android.internal.telephony.gsm.SuppServiceNotification;
@@ -217,7 +218,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    log("onReceive : Updating mAllowEmergencyVideoCalls = " +
                            mAllowEmergencyVideoCalls);
                }
                mCarrierConfigLoaded  = true;
            } else if (TelecomManager.ACTION_CHANGE_DEFAULT_DIALER.equals(intent.getAction())) {
                mDefaultDialerUid.set(getPackageUid(context, intent.getStringExtra(
                        TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME)));
@@ -958,16 +958,21 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    private void cacheCarrierConfiguration(int subId) {
        CarrierConfigManager carrierConfigManager = (CarrierConfigManager)
                mPhone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
        if (carrierConfigManager == null) {
            loge("cacheCarrierConfiguration: No carrier config service found.");
        if (carrierConfigManager == null
                || !SubscriptionController.getInstance().isActiveSubId(subId)) {
            loge("cacheCarrierConfiguration: No carrier config service found" + " "
                    + "or not active subId = " + subId);
            mCarrierConfigLoaded = false;
            return;
        }

        PersistableBundle carrierConfig = carrierConfigManager.getConfigForSubId(subId);
        if (carrierConfig == null) {
            loge("cacheCarrierConfiguration: Empty carrier config.");
            mCarrierConfigLoaded = false;
            return;
        }
        mCarrierConfigLoaded = true;

        mAllowEmergencyVideoCalls =
                carrierConfig.getBoolean(CarrierConfigManager.KEY_ALLOW_EMERGENCY_VIDEO_CALLS_BOOL);
@@ -3409,7 +3414,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // We do not want to update the ImsConfig for REASON_REGISTERED, since it can happen before
        // the carrier config has loaded and will deregister IMS.
        if (!mShouldUpdateImsConfigOnDisconnect
                && reason != DataEnabledSettings.REASON_REGISTERED) {
                && reason != DataEnabledSettings.REASON_REGISTERED && mCarrierConfigLoaded) {
            // This will call into updateVideoCallFeatureValue and eventually all clients will be
            // asynchronously notified that the availability of VT over LTE has changed.
            ImsManager.updateImsServiceConfig(mPhone.getContext(), mPhone.getPhoneId(), true);