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

Commit 4ae4f2e7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update ImsService config only when carrier config changes for valid...

Merge "Update ImsService config only when carrier config changes for valid subId" am: 26f80357 am: 3eebc817 am: 666051fa

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1532539

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaab384fc39c877d2b1574b232d82b0dbfeaf9ce4
parents 85ebd670 666051fa
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -2874,14 +2874,6 @@ public class GsmCdmaPhone extends Phone {
                                .config_switch_phone_on_voice_reg_state_change)) {
                    mCi.getVoiceRadioTechnology(obtainMessage(EVENT_REQUEST_VOICE_RADIO_TECH_DONE));
                }
                // Force update IMS service if it is available, if it isn't the config will be
                // updated when ImsPhoneCallTracker opens a connection.
                ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
                if (imsManager.isServiceAvailable()) {
                    imsManager.updateImsServiceConfig();
                } else {
                    logd("ImsManager is not available to update CarrierConfig.");
                }

                // Update broadcastEmergencyCallStateChanges
                CarrierConfigManager configMgr = (CarrierConfigManager)
+10 −5
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
                        SubscriptionManager.INVALID_SUBSCRIPTION_ID);
                if (subId == mPhone.getSubId()) {
                    cacheCarrierConfiguration(subId);
                    updateCarrierConfiguration(subId);
                    log("onReceive : Updating mAllowEmergencyVideoCalls = " +
                            mAllowEmergencyVideoCalls);
                }
@@ -903,7 +903,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        intentfilter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        intentfilter.addAction(TelecomManager.ACTION_DEFAULT_DIALER_CHANGED);
        mPhone.getContext().registerReceiver(mReceiver, intentfilter);
        cacheCarrierConfiguration(mPhone.getSubId());
        updateCarrierConfiguration(mPhone.getSubId());

        mPhone.getDefaultPhone().getDataEnabledSettings().registerForDataEnabledChanged(
                this, EVENT_DATA_ENABLED_CHANGED, null);
@@ -1368,11 +1368,13 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    }

    /**
     * Caches frequently used carrier configuration items locally.
     * Caches frequently used carrier configuration items locally and notifies ImsService of new
     * configuration if the subId is valid (there is an active sub ID loaded).
     *
     * @param subId The sub id.
     * @param subId The sub id to use to update configuration, may be invalid if a SIM has been
     *              removed.
     */
    private void cacheCarrierConfiguration(int subId) {
    private void updateCarrierConfiguration(int subId) {
        CarrierConfigManager carrierConfigManager = (CarrierConfigManager)
                mPhone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
        if (carrierConfigManager == null
@@ -1392,6 +1394,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        mCarrierConfigLoaded = true;

        updateCarrierConfigCache(carrierConfig);
        if (mImsManager != null) {
            mImsManager.updateImsServiceConfig();
        }
    }

    /**