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

Commit 42de290f authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Pass in multiple device/carrier configurations into ImsResolver

1) Support passing multiple configurations into ImsResolver for
device/carrier configurations.
2) Support multiple cases for failure in ImsServiceController
(null binding or error binding cases).
3) Moving ImsResolver to PhoneGlobals requires that the handling
of resizing of slots due to a device configuration change be
handled differently. Added new logic to resize num slots and
bind/unbind when necessary.

Bug: 111305845
Test: atest CtsTelephonyTestCases; atest FrameworksTelephonyTests
Change-Id: I96bf2d6183d86b4b969e9070776d498b1a625740
parent 557583fe
Loading
Loading
Loading
Loading
+1 −29
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager;
import com.android.internal.telephony.dataconnection.TelephonyNetworkFactory;
import com.android.internal.telephony.euicc.EuiccCardController;
import com.android.internal.telephony.euicc.EuiccController;
import com.android.internal.telephony.ims.ImsResolver;
import com.android.internal.telephony.imsphone.ImsPhone;
import com.android.internal.telephony.imsphone.ImsPhoneFactory;
import com.android.internal.telephony.metrics.TelephonyMetrics;
@@ -93,7 +92,6 @@ public class PhoneFactory {
    static private PhoneConfigurationManager sPhoneConfigurationManager;
    static private PhoneSwitcher sPhoneSwitcher;
    static private TelephonyNetworkFactory[] sTelephonyNetworkFactories;
    static private ImsResolver sImsResolver;
    static private NotificationChannelController sNotificationChannelController;
    static private CellularNetworkValidator sCellularNetworkValidator;

@@ -217,17 +215,9 @@ public class PhoneFactory {
                // Only bring up IMS if the device supports having an IMS stack.
                if (context.getPackageManager().hasSystemFeature(
                        PackageManager.FEATURE_TELEPHONY_IMS)) {
                    // Get the package name of the default IMS implementation.
                    String defaultImsPackage = sContext.getResources().getString(
                            com.android.internal.R.string.config_ims_package);
                    // Start ImsResolver and bind to ImsServices.
                    Rlog.i(LOG_TAG, "ImsResolver: defaultImsPackage: " + defaultImsPackage);
                    sImsResolver = new ImsResolver(sContext, defaultImsPackage, numPhones);
                    sImsResolver.initialize();
                    // Start monitoring after defaults have been made.
                    // Default phone must be ready before ImsPhone is created because ImsService
                    // might need it when it is being opened. This should initialize multiple
                    // ImsPhones for ImsResolver implementations of ImsService.
                    // might need it when it is being opened.
                    for (int i = 0; i < numPhones; i++) {
                        sPhones[i].createImsPhone();
                    }
@@ -358,14 +348,6 @@ public class PhoneFactory {
        return sSubInfoRecordUpdater;
    }

    /**
     * @return The ImsResolver instance or null if IMS is not supported
     * (FEATURE_TELEPHONY_IMS is not defined).
     */
    public static @Nullable ImsResolver getImsResolver() {
        return sImsResolver;
    }

    /**
     * Get the network factory associated with a given phone ID.
     * @param phoneId the phone id
@@ -565,16 +547,6 @@ public class PhoneFactory {
            pw.println("++++++++++++++++++++++++++++++++");
        }

        pw.println("ImsResolver:");
        pw.increaseIndent();
        try {
            if (sImsResolver != null) sImsResolver.dump(fd, pw, args);
        } catch (Exception e) {
            e.printStackTrace();
        }
        pw.decreaseIndent();
        pw.println("++++++++++++++++++++++++++++++++");

        pw.println("UiccController:");
        pw.increaseIndent();
        try {
+238 −111

File changed.

Preview size limit exceeded, changes collapsed.

+16 −0
Original line number Diff line number Diff line
@@ -83,6 +83,21 @@ public class ImsServiceFeatureQueryManager {
            Log.w(LOG_TAG, "onServiceDisconnected for component: " + name);
        }

        @Override
        public void onBindingDied(ComponentName name) {
            Log.w(LOG_TAG, "onBindingDied: " + name);
            cleanup();
            // retry again!
            mListener.onError(name);
        }

        @Override
        public void onNullBinding(ComponentName name) {
            Log.w(LOG_TAG, "onNullBinding: " + name);
            cleanup();
            mListener.onPermanentError(name);
        }

        private void queryImsFeatures(IImsServiceController controller) {
            ImsFeatureConfiguration config;
            try {
@@ -90,6 +105,7 @@ public class ImsServiceFeatureQueryManager {
            } catch (Exception e) {
                Log.w(LOG_TAG, "queryImsFeatures - error: " + e);
                cleanup();
                // Retry again!
                mListener.onError(mName);
                return;
            }
+701 −67

File changed.

Preview size limit exceeded, changes collapsed.