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

Commit d32eea77 authored by Pavel Zhamaitsiak's avatar Pavel Zhamaitsiak Committed by Android (Google) Code Review
Browse files

Merge "Fix race in dafault phone creation" into mnc-dr-dev

parents 37cacdfe 80bd0262
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -157,11 +157,9 @@ public class PhoneFactory {
                    if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
                        phone = new GSMPhone(context,
                                sCommandsInterfaces[i], sPhoneNotifier, i);
                        phone.startMonitoringImsService();
                    } else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
                        phone = new CDMALTEPhone(context,
                                sCommandsInterfaces[i], sPhoneNotifier, i);
                        phone.startMonitoringImsService();
                    }
                    Rlog.i(LOG_TAG, "Creating Phone with type = " + phoneType + " sub = " + i);

@@ -195,6 +193,13 @@ public class PhoneFactory {
                sSubInfoRecordUpdater = new SubscriptionInfoUpdater(context,
                        sProxyPhones, sCommandsInterfaces);
                SubscriptionController.getInstance().updatePhonesAvailability(sProxyPhones);

                // 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.
                for (int i = 0; i < numPhones; i++) {
                    sProxyPhones[i].startMonitoringImsService();
                }
            }
        }
    }
+5 −1
Original line number Diff line number Diff line
@@ -1504,7 +1504,11 @@ public class PhoneProxy extends Handler implements Phone {
    public ImsPhone relinquishOwnershipOfImsPhone() { return null; }

    @Override
    public void startMonitoringImsService() {}
    public void startMonitoringImsService() {
        if (mActivePhone != null) {
            mActivePhone.startMonitoringImsService();
        }
    }

    @Override
    public void acquireOwnershipOfImsPhone(ImsPhone imsPhone) { }