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

Commit 38742fa6 authored by Jonggeon Kim's avatar Jonggeon Kim Committed by Android (Google) Code Review
Browse files

Merge "ImsService Subscription Notifications"

parents 95a2912e dc5184fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ public class ImsSmsDispatcher extends SMSDispatcher {

        mImsManagerConnector = mConnectorFactory.create(mContext, mPhone.getPhoneId(), TAG,
                new FeatureConnector.Listener<ImsManager>() {
                    public void connectionReady(ImsManager manager) throws ImsException {
                    public void connectionReady(ImsManager manager, int subId) throws ImsException {
                        logd("ImsManager: connection ready.");
                        synchronized (mLock) {
                            mImsManager = manager;
+46 −18
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import android.util.ArrayMap;
import android.util.LocalLog;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseIntArray;

import com.android.ims.ImsFeatureBinderRepository;
import com.android.ims.ImsFeatureContainer;
@@ -284,10 +285,10 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                return;
            }

            Log.i(TAG, "Received Carrier Config Changed for SlotId: " + slotId
                    + ", sim state: " + slotSimState);
            Log.i(TAG, "Received Carrier Config Changed for SlotId: " + slotId + ", SubId: "
                    + subId + ", sim state: " + slotSimState);

            mHandler.obtainMessage(HANDLER_CONFIG_CHANGED, slotId).sendToTarget();
            mHandler.obtainMessage(HANDLER_CONFIG_CHANGED, slotId, subId).sendToTarget();
        }
    };

@@ -473,7 +474,8 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                break;
            }
            case HANDLER_CONFIG_CHANGED: {
                int slotId = (Integer) msg.obj;
                int slotId = msg.arg1;
                int subId = msg.arg2;
                // If the msim config has changed and there is a residual event for an invalid slot,
                // ignore.
                if (slotId >= mNumSlots) {
@@ -481,7 +483,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                    break;
                }
                mCarrierConfigReceived = true;
                carrierConfigChanged(slotId);
                carrierConfigChanged(slotId, subId);
                break;
            }
            case HANDLER_START_DYNAMIC_FEATURE_QUERY: {
@@ -566,6 +568,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
    // Active ImsServiceControllers, which are bound to ImsServices.
    private final Map<ComponentName, ImsServiceController> mActiveControllers = new HashMap<>();
    private ImsServiceFeatureQueryManager mFeatureQueryManager;
    private final SparseIntArray mSlotIdToSubIdMap;

    public ImsResolver(Context context, String defaultMmTelPackageName,
            String defaultRcsPackageName, int numSlots, ImsFeatureBinderRepository repo) {
@@ -584,6 +587,10 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                Context.CARRIER_CONFIG_SERVICE);
        mOverrideServices = new SparseArray<>(0 /*initial size*/);
        mBoundImsServicesByFeature = new SparseArray<>(mNumSlots);
        mSlotIdToSubIdMap = new SparseIntArray(mNumSlots);
        for (int i = 0; i < mNumSlots; i++) {
            mSlotIdToSubIdMap.put(i, SubscriptionManager.INVALID_SUBSCRIPTION_ID);
        }
    }

    @VisibleForTesting
@@ -676,7 +683,8 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
    private void bindCarrierServicesIfAvailable() {
        boolean hasConfigChanged = false;
        for (int slotId = 0; slotId < mNumSlots; slotId++) {
            Map<Integer, String> featureMap = getImsPackageOverrideConfig(slotId);
            int subId = mSubscriptionManagerProxy.getSubId(slotId);
            Map<Integer, String> featureMap = getImsPackageOverrideConfig(subId);
            for (int f = ImsFeature.FEATURE_EMERGENCY_MMTEL; f < ImsFeature.FEATURE_MAX; f++) {
                String newPackageName = featureMap.getOrDefault(f, "");
                if (!TextUtils.isEmpty(newPackageName)) {
@@ -684,6 +692,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                            + newPackageName + " on slot " + slotId);
                    // Carrier configs are already available, so mark received.
                    mCarrierConfigReceived = true;
                    setSubId(slotId, subId);
                    setCarrierConfiguredPackageName(newPackageName, slotId, f);
                    ImsServiceInfo info = getImsServiceInfoFromCache(newPackageName);
                    // We do not want to trigger feature configuration changes unless there is
@@ -709,7 +718,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        if (controllers != null) {
            for (int i = 0; i < controllers.size(); i++) {
                int key = controllers.keyAt(i);
                controllers.get(key).enableIms(slotId);
                controllers.get(key).enableIms(slotId, getSubId(slotId));
            }
        }
    }
@@ -723,7 +732,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        if (controllers != null) {
            for (int i = 0; i < controllers.size(); i++) {
                int key = controllers.keyAt(i);
                controllers.get(key).disableIms(slotId);
                controllers.get(key).disableIms(slotId, getSubId(slotId));
            }
        }
    }
@@ -1182,11 +1191,12 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        if (shouldFeaturesCauseBind(features)) {
            // Check to see if an active controller already exists
            ImsServiceController controller = getControllerByServiceInfo(mActiveControllers, info);
            SparseIntArray slotIdToSubIdMap = mSlotIdToSubIdMap.clone();
            if (controller != null) {
                Log.i(TAG, "ImsService connection exists for " + info.name + ", updating features "
                        + features);
                try {
                    controller.changeImsServiceFeatures(features);
                    controller.changeImsServiceFeatures(features, slotIdToSubIdMap);
                    // Features have been set, there was an error adding/removing. When the
                    // controller recovers, it will add/remove again.
                } catch (RemoteException e) {
@@ -1196,7 +1206,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                controller = info.controllerFactory.create(mContext, info.name, this, mRepo);
                Log.i(TAG, "Binding ImsService: " + controller.getComponentName()
                        + " with features: " + features);
                controller.bind(features);
                controller.bind(features, slotIdToSubIdMap);
                mEventLog.log("bindImsServiceWithFeatures - create new controller: "
                        + controller);
            }
@@ -1258,7 +1268,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
    /**
     * Implementation of
     * {@link ImsServiceController.ImsServiceControllerCallbacks#imsServiceFeatureCreated}, which
     * removes the ImsServiceController from the mBoundImsServicesByFeature structure.
     * adds the ImsServiceController from the mBoundImsServicesByFeature structure.
     */
    @Override
    public void imsServiceFeatureCreated(int slotId, int feature, ImsServiceController controller) {
@@ -1334,7 +1344,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        Log.i(TAG, "clearing carrier ImsService overrides");
        mEventLog.log("clearing carrier ImsService overrides");
        removeOverridePackageName(slotId);
        carrierConfigChanged(slotId);
        carrierConfigChanged(slotId, getSubId(slotId));
    }

    // Possibly rebind to another ImsService for testing carrier ImsServices.
@@ -1365,16 +1375,16 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
    }

    // Called from handler ONLY.
    private void carrierConfigChanged(int slotId) {
    private void carrierConfigChanged(int slotId, int subId) {
        setSubId(slotId, subId);
        updateBoundDeviceServices();

        if (slotId <= SubscriptionManager.INVALID_SIM_SLOT_INDEX) {
            // not specified, update carrier override cache and possibly rebind on all slots.
            for (int i = 0; i < mNumSlots; i++) {
                updateBoundServices(i, getImsPackageOverrideConfig(i));
                updateBoundServices(i, getImsPackageOverrideConfig(getSubId(i)));
            }
        }
        updateBoundServices(slotId, getImsPackageOverrideConfig(slotId));
        updateBoundServices(slotId, getImsPackageOverrideConfig(subId));
    }

    private void updateBoundDeviceServices() {
@@ -1440,8 +1450,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        }
    }

    private @NonNull Map<Integer, String> getImsPackageOverrideConfig(int slotId) {
        int subId = mSubscriptionManagerProxy.getSubId(slotId);
    private @NonNull Map<Integer, String> getImsPackageOverrideConfig(int subId) {
        PersistableBundle config = mCarrierConfigManager.getConfigForSubId(subId);
        if (config == null) return Collections.emptyMap();
        String packageNameMmTel = config.getString(
@@ -1530,6 +1539,8 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
                    int feature = overrideConfigs.keyAt(i);
                    setOverridePackageName("", oldSlot, feature);
                }
                //clear removed slot.
                removeSlotId(oldSlot);
            }
        }
        // Get the new config for each ImsService. For manifest queries, this will update the
@@ -1758,6 +1769,23 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal
        return infos;
    }

    private void setSubId(int slotId, int subId) {
        synchronized (mSlotIdToSubIdMap) {
            mSlotIdToSubIdMap.put(slotId, subId);
        }
    }

    private int getSubId(int slotId) {
        synchronized (mSlotIdToSubIdMap) {
            return mSlotIdToSubIdMap.get(slotId, SubscriptionManager.INVALID_SUBSCRIPTION_ID);
        }
    }
    private void removeSlotId(int slotId) {
        synchronized (mSlotIdToSubIdMap) {
            mSlotIdToSubIdMap.delete(slotId);
        }
    }

    // Dump is called on the main thread, since ImsResolver Handler is also handled on main thread,
    // we shouldn't need to worry about concurrent access of private params.
    public void dump(FileDescriptor fd, PrintWriter printWriter, String[] args) {
+103 −37
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.telephony.ims;

import static android.telephony.SubscriptionManager.PLACEHOLDER_SUBSCRIPTION_ID_BASE;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -30,6 +32,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.permission.LegacyPermissionManager;
import android.telephony.AnomalyReporter;
import android.telephony.SubscriptionManager;
import android.telephony.ims.ImsService;
import android.telephony.ims.aidl.IImsConfig;
import android.telephony.ims.aidl.IImsRegistration;
@@ -39,6 +42,7 @@ import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.stub.ImsFeatureConfiguration;
import android.util.LocalLog;
import android.util.Log;
import android.util.SparseIntArray;

import com.android.ims.ImsFeatureBinderRepository;
import com.android.ims.ImsFeatureContainer;
@@ -48,6 +52,7 @@ import com.android.internal.telephony.ExponentialBackoff;
import com.android.internal.telephony.util.TelephonyUtils;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -96,7 +101,7 @@ public class ImsServiceController {
                    for (ImsFeatureConfiguration.FeatureSlotPair i : mImsFeatures) {
                        long caps = modifyCapabiltiesForSlot(mImsFeatures, i.slotId,
                                mServiceCapabilities);
                        addImsServiceFeature(i, caps);
                        addImsServiceFeature(i, caps, mSlotIdToSubIdMap.get(i.slotId));
                    }
                } catch (RemoteException e) {
                    mIsBound = false;
@@ -235,6 +240,7 @@ public class ImsServiceController {
    private boolean mIsBinding = false;
    // Set of a pair of slotId->feature
    private Set<ImsFeatureConfiguration.FeatureSlotPair> mImsFeatures;
    private SparseIntArray mSlotIdToSubIdMap;
    private IImsServiceController mIImsServiceController;
    // The Capabilities bitmask of the connected ImsService (see ImsService#ImsServiceCapability).
    private long mServiceCapabilities;
@@ -295,7 +301,7 @@ public class ImsServiceController {
                if (mIsBound) {
                    return;
                }
                bind(mImsFeatures);
                bind(mImsFeatures, mSlotIdToSubIdMap);
            }
        }
    };
@@ -365,12 +371,14 @@ public class ImsServiceController {
     * @return {@link true} if the service is in the process of being bound, {@link false} if it
     * has failed.
     */
    public boolean bind(Set<ImsFeatureConfiguration.FeatureSlotPair> imsFeatureSet) {
    public boolean bind(Set<ImsFeatureConfiguration.FeatureSlotPair> imsFeatureSet,
            SparseIntArray  slotIdToSubIdMap) {
        synchronized (mLock) {
            if (!mIsBound && !mIsBinding) {
                mIsBinding = true;
                sanitizeFeatureConfig(imsFeatureSet);
                mImsFeatures = imsFeatureSet;
                mSlotIdToSubIdMap = slotIdToSubIdMap;
                grantPermissionsToService();
                Intent imsServiceIntent = new Intent(getServiceInterface()).setComponent(
                        mComponentName);
@@ -427,7 +435,7 @@ public class ImsServiceController {
        synchronized (mLock) {
            mBackoff.stop();
            // Clean up all features
            changeImsServiceFeatures(new HashSet<>());
            changeImsServiceFeatures(new HashSet<>(), mSlotIdToSubIdMap);
            mIsBound = false;
            mIsBinding = false;
            setServiceController(null);
@@ -440,15 +448,27 @@ public class ImsServiceController {
     * ImsFeature that is removed, {@link IImsServiceController#removeImsFeature} is called.
     */
    public void changeImsServiceFeatures(
            Set<ImsFeatureConfiguration.FeatureSlotPair> newImsFeatures)
            throws RemoteException {
            Set<ImsFeatureConfiguration.FeatureSlotPair> newImsFeatures,
                    SparseIntArray  slotIdToSubIdMap) throws RemoteException {
        sanitizeFeatureConfig(newImsFeatures);
        synchronized (mLock) {
            if (mImsFeatures.equals(newImsFeatures)) {
            HashSet<Integer> slotIDs =  new HashSet<>();
            slotIDs.addAll(newImsFeatures.stream().map(e -> e.slotId).collect(Collectors.toSet()));
            ArrayList<Integer> changedSubIds = new ArrayList<Integer>();
            for (Integer slotID : slotIDs) {
                if (mSlotIdToSubIdMap.get(slotID, PLACEHOLDER_SUBSCRIPTION_ID_BASE)
                        != slotIdToSubIdMap.get(slotID)) {
                    changedSubIds.add(slotIdToSubIdMap.get(slotID));
                    mLocalLog.log("changed sub IDs: " + changedSubIds);
                    Log.i(LOG_TAG, "changed sub IDs: " + changedSubIds);
                }
            }
            mSlotIdToSubIdMap = slotIdToSubIdMap;
            if (mImsFeatures.equals(newImsFeatures) && !isSubIdChanged(changedSubIds)) {
                return;
            }
            mLocalLog.log("Features changed (" + mImsFeatures + "->" + newImsFeatures + ")");
            Log.i(LOG_TAG, "Features changed (" + mImsFeatures + "->" + newImsFeatures + ") for "
            mLocalLog.log("Features (" + mImsFeatures + "->" + newImsFeatures + ")");
            Log.i(LOG_TAG, "Features (" + mImsFeatures + "->" + newImsFeatures + ") for "
                    + "ImsService: " + mComponentName);
            HashSet<ImsFeatureConfiguration.FeatureSlotPair> oldImsFeatures =
                    new HashSet<>(mImsFeatures);
@@ -462,20 +482,40 @@ public class ImsServiceController {
                for (ImsFeatureConfiguration.FeatureSlotPair i : newFeatures) {
                    long caps = modifyCapabiltiesForSlot(mImsFeatures, i.slotId,
                            mServiceCapabilities);
                    addImsServiceFeature(i, caps);
                    addImsServiceFeature(i, caps, mSlotIdToSubIdMap.get(i.slotId));
                }
                // remove old features
                HashSet<ImsFeatureConfiguration.FeatureSlotPair> oldFeatures =
                        new HashSet<>(oldImsFeatures);
                oldFeatures.removeAll(mImsFeatures);
                for (ImsFeatureConfiguration.FeatureSlotPair i : oldFeatures) {
                    removeImsServiceFeature(i);
                    removeImsServiceFeature(i, false);
                }
                // ensure the capabilities have been updated for unchanged features.
                HashSet<ImsFeatureConfiguration.FeatureSlotPair> unchangedFeatures =
                        new HashSet<>(mImsFeatures);
                unchangedFeatures.removeAll(oldFeatures);
                unchangedFeatures.removeAll(newFeatures);
                // ensure remove and add unchanged features that have a slot ID associated with
                // the new subscription ID.
                if (isSubIdChanged(changedSubIds)) {
                    for (Integer changedSubId : changedSubIds) {
                        int slotId = mSlotIdToSubIdMap.indexOfValue(changedSubId);
                        HashSet<ImsFeatureConfiguration.FeatureSlotPair>
                                removeAddFeatures = new HashSet<>();
                        removeAddFeatures.addAll(unchangedFeatures.stream()
                                .filter(e -> e.slotId == slotId).collect(Collectors.toSet()));
                        for (ImsFeatureConfiguration.FeatureSlotPair i : removeAddFeatures) {
                            removeImsServiceFeature(i, true);
                        }
                        for (ImsFeatureConfiguration.FeatureSlotPair i : removeAddFeatures) {
                            long caps = modifyCapabiltiesForSlot(mImsFeatures, i.slotId,
                                    mServiceCapabilities);
                            addImsServiceFeature(i, caps, changedSubId);
                        }
                        unchangedFeatures.removeAll(removeAddFeatures);
                    }
                }
                for (ImsFeatureConfiguration.FeatureSlotPair p : unchangedFeatures) {
                    long caps = modifyCapabiltiesForSlot(mImsFeatures, p.slotId,
                            mServiceCapabilities);
@@ -504,11 +544,15 @@ public class ImsServiceController {
        return mComponentName;
    }

    public void enableIms(int slotId) {
    /**
     * Notify ImsService to enable IMS for the framework. This will trigger IMS registration and
     * trigger ImsFeature status updates.
     */
    public void enableIms(int slotId, int subId) {
        try {
            synchronized (mLock) {
                if (isServiceControllerAvailable()) {
                    mIImsServiceController.enableIms(slotId);
                    mIImsServiceController.enableIms(slotId, subId);
                }
            }
        } catch (RemoteException e) {
@@ -516,11 +560,15 @@ public class ImsServiceController {
        }
    }

    public void disableIms(int slotId) {
    /**
     * Notify ImsService to disable IMS for the framework. This will trigger IMS de-registration and
     * trigger ImsFeature capability status to become false.
     */
    public void disableIms(int slotId, int subId) {
        try {
            synchronized (mLock) {
                if (isServiceControllerAvailable()) {
                    mIImsServiceController.disableIms(slotId);
                    mIImsServiceController.disableIms(slotId, subId);
                }
            }
        } catch (RemoteException e) {
@@ -531,19 +579,20 @@ public class ImsServiceController {
    /**
     * @return the IImsRegistration that corresponds to the slot id specified.
     */
    public IImsRegistration getRegistration(int slotId) throws RemoteException {
    public IImsRegistration getRegistration(int slotId, int subId) throws RemoteException {
        synchronized (mLock) {
            return isServiceControllerAvailable()
                    ? mIImsServiceController.getRegistration(slotId) : null;
                    ? mIImsServiceController.getRegistration(slotId, subId) : null;
        }
    }

    /**
     * @return the IImsConfig that corresponds to the slot id specified.
     */
    public IImsConfig getConfig(int slotId) throws RemoteException {
    public IImsConfig getConfig(int slotId, int subId) throws RemoteException {
        synchronized (mLock) {
            return isServiceControllerAvailable() ? mIImsServiceController.getConfig(slotId) : null;
            return isServiceControllerAvailable()
                    ? mIImsServiceController.getConfig(slotId, subId) : null;
        }
    }

@@ -686,15 +735,16 @@ public class ImsServiceController {

    // This method should only be called when synchronized on mLock
    private void addImsServiceFeature(ImsFeatureConfiguration.FeatureSlotPair featurePair,
            long capabilities)
            throws RemoteException {
            long capabilities, int subId) throws RemoteException {
        if (!isServiceControllerAvailable() || mCallbacks == null) {
            Log.w(LOG_TAG, "addImsServiceFeature called with null values.");
            return;
        }
        if (featurePair.featureType != ImsFeature.FEATURE_EMERGENCY_MMTEL) {
            IInterface f = createImsFeature(featurePair.slotId, featurePair.featureType);
            addImsFeatureBinder(featurePair.slotId, featurePair.featureType, f, capabilities);
            IInterface f = createImsFeature(
                    featurePair.slotId, subId, featurePair.featureType, capabilities);
            addImsFeatureBinder(featurePair.slotId, subId, featurePair.featureType,
                    f, capabilities);
            addImsFeatureStatusCallback(featurePair.slotId, featurePair.featureType);
        } else {
            // Don't update ImsService for emergency MMTEL feature.
@@ -705,7 +755,8 @@ public class ImsServiceController {
    }

    // This method should only be called when synchronized on mLock
    private void removeImsServiceFeature(ImsFeatureConfiguration.FeatureSlotPair featurePair) {
    private void removeImsServiceFeature(ImsFeatureConfiguration.FeatureSlotPair featurePair,
            boolean changeSubId) {
        if (!isServiceControllerAvailable() || mCallbacks == null) {
            Log.w(LOG_TAG, "removeImsServiceFeature called with null values.");
            return;
@@ -716,7 +767,7 @@ public class ImsServiceController {
            removeImsFeatureStatusCallback(featurePair.slotId, featurePair.featureType);
            removeImsFeatureBinder(featurePair.slotId, featurePair.featureType);
            try {
                removeImsFeature(featurePair.slotId, featurePair.featureType);
                removeImsFeature(featurePair.slotId, featurePair.featureType, changeSubId);
            } catch (RemoteException e) {
                // The connection to this ImsService doesn't exist. This may happen if the service
                // has died and we are removing features.
@@ -732,14 +783,23 @@ public class ImsServiceController {

    // This method should only be called when already synchronized on mLock.
    // overridden by compat layer to create features
    protected IInterface createImsFeature(int slotId, int featureType)
    protected IInterface createImsFeature(int slotId, int subId, int featureType, long capabilities)
            throws RemoteException {
        switch (featureType) {
            case ImsFeature.FEATURE_MMTEL: {
                return mIImsServiceController.createMmTelFeature(slotId);
                if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
                    boolean emergencyAvailable =
                            (capabilities & ImsService.CAPABILITY_EMERGENCY_OVER_MMTEL) > 0;
                    if (emergencyAvailable) {
                        return mIImsServiceController.createEmergencyOnlyMmTelFeature(slotId);
                    } else {
                        return null;
                    }
                }
                return mIImsServiceController.createMmTelFeature(slotId, subId);
            }
            case ImsFeature.FEATURE_RCS: {
                return mIImsServiceController.createRcsFeature(slotId);
                return mIImsServiceController.createRcsFeature(slotId, subId);
            }
            default:
                return null;
@@ -782,12 +842,13 @@ public class ImsServiceController {


    // overridden by compat layer to remove features
    protected void removeImsFeature(int slotId, int featureType)
    protected void removeImsFeature(int slotId, int featureType, boolean changeSubId)
            throws RemoteException {
        mIImsServiceController.removeImsFeature(slotId, featureType);
        mIImsServiceController.removeImsFeature(slotId, featureType, changeSubId);
    }

    private void addImsFeatureBinder(int slotId, int featureType, IInterface b, long capabilities)
    private void addImsFeatureBinder(int slotId, int subId, int featureType, IInterface b,
            long capabilities)
            throws RemoteException {
        if (b == null) {

@@ -797,18 +858,19 @@ public class ImsServiceController {
                    + ImsFeature.FEATURE_LOG_MAP.get(featureType));
            return;
        }
        ImsFeatureContainer fc = createFeatureContainer(slotId, b.asBinder(), capabilities);
        mRepo.addConnection(slotId, featureType, fc);
        ImsFeatureContainer fc = createFeatureContainer(slotId, subId, b.asBinder(), capabilities);
        mRepo.addConnection(slotId, subId, featureType, fc);
    }

    private void removeImsFeatureBinder(int slotId, int featureType) {
        mRepo.removeConnection(slotId, featureType);
    }

    private ImsFeatureContainer createFeatureContainer(int slotId, IBinder b, long capabilities)
    private ImsFeatureContainer createFeatureContainer(int slotId, int subId, IBinder b,
            long capabilities)
            throws RemoteException {
        IImsConfig config = getConfig(slotId);
        IImsRegistration reg = getRegistration(slotId);
        IImsConfig config = getConfig(slotId, subId);
        IImsRegistration reg = getRegistration(slotId, subId);
        // When either is null, this is an unexpected condition. Do not report the ImsService as
        // being available.
        if (config == null || reg == null) {
@@ -833,7 +895,7 @@ public class ImsServiceController {
        synchronized (mLock) {
            // Remove all features and clean up all associated Binders.
            for (ImsFeatureConfiguration.FeatureSlotPair i : mImsFeatures) {
                removeImsServiceFeature(i);
                removeImsServiceFeature(i, false);
            }
        }
    }
@@ -857,6 +919,10 @@ public class ImsServiceController {
        AnomalyReporter.reportAnomaly(mAnomalyUUID, message);
    }

    private boolean isSubIdChanged(ArrayList<Integer> changedSubIds) {
        return !changedSubIds.isEmpty();
    }

    @Override
    public String toString() {
        synchronized (mLock) {
+7 −7

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -1002,7 +1002,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

        mImsManagerConnector = mConnectorFactory.create(mPhone.getContext(), mPhone.getPhoneId(),
                LOG_TAG, new FeatureConnector.Listener<ImsManager>() {
                    public void connectionReady(ImsManager manager) throws ImsException {
                    public void connectionReady(ImsManager manager, int subId) throws ImsException {
                        mImsManager = manager;
                        startListeningForCalls();
                    }
Loading