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

Commit 5dcee0c1 authored by Pavel Zhamaitsiak's avatar Pavel Zhamaitsiak Committed by Android Git Automerger
Browse files

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

* commit 'd32eea77':
  Fix race in dafault phone creation
parents 225fa87f d32eea77
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) { }