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

Commit 2c2b12d2 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7571196 from 4d6e1d1c to sc-v2-release

Change-Id: Ifdc9569b74299f3237ae47d1f513a5891fc78892
parents 5c75e87a 4d6e1d1c
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -341,17 +341,19 @@ public class MultiSimSettingController extends Handler {
    }

    /**
     * Upon initialization, update defaults and mobile data enabling.
     * Upon initialization or radio available, update defaults and mobile data enabling.
     * Should only be triggered once.
     */
    private void onAllSubscriptionsLoaded() {
        if (DBG) log("onAllSubscriptionsLoaded");
        if (DBG) log("onAllSubscriptionsLoaded: mSubInfoInitialized=" + mSubInfoInitialized);
        if (!mSubInfoInitialized) {
            mSubInfoInitialized = true;
            for (Phone phone : PhoneFactory.getPhones()) {
                phone.mCi.registerForRadioStateChanged(this, EVENT_RADIO_STATE_CHANGED, null);
            }
            reEvaluateAll();
        }
    }

    /**
     * Make sure default values are cleaned or updated.
@@ -445,11 +447,16 @@ public class MultiSimSettingController extends Handler {
    }

    /**
     * Wait for subInfo initialization (after boot up) and carrier config load for all active
     * subscriptions before re-evaluate multi SIM settings.
     * Wait for subInfo initialization (after boot up or radio unavailable) and carrier config load
     * for all active subscriptions before re-evaluate multi SIM settings.
     */
    private boolean isReadyToReevaluate() {
        return mSubInfoInitialized && isCarrierConfigLoadedForAllSub();
        boolean carrierConfigsLoaded = isCarrierConfigLoadedForAllSub();
        if (DBG) {
            log("isReadyToReevaluate: subInfoInitialized=" + mSubInfoInitialized
                    + ", carrierConfigsLoaded=" + carrierConfigsLoaded);
        }
        return mSubInfoInitialized && carrierConfigsLoaded;
    }

    private void reEvaluateAll() {
+1 −1
Original line number Diff line number Diff line
@@ -792,8 +792,8 @@ public class SubscriptionInfoUpdater extends Handler {
            if (DBG) logd("SubInfo Initialized");
            sIsSubInfoInitialized = true;
            mSubscriptionController.notifySubInfoReady();
            MultiSimSettingController.getInstance().notifyAllSubscriptionLoaded();
        }
        MultiSimSettingController.getInstance().notifyAllSubscriptionLoaded();
    }

    /**
+1 −3
Original line number Diff line number Diff line
@@ -430,9 +430,7 @@ public class ApnContext {

    public void releaseNetwork(NetworkRequest networkRequest, @ReleaseNetworkType int type) {
        synchronized (mRefCountLock) {
            if (mNetworkRequests.contains(networkRequest) == false) {
                logl("releaseNetwork can't find this request (" + networkRequest + ")");
            } else {
            if (mNetworkRequests.contains(networkRequest)) {
                mNetworkRequests.remove(networkRequest);
                if (mDataConnection != null) {
                    // New network request added. Should re-evaluate properties of
+1 −0
Original line number Diff line number Diff line
@@ -2316,6 +2316,7 @@ public class DcTracker extends Handler {
        // TODO: It'd be nice to only do this if the changed entrie(s)
        // match the current operator.
        if (DBG) log("onApnChanged: createAllApnList and cleanUpAllConnections");
        mDataThrottler.reset();
        setDefaultPreferredApnIfNeeded();
        createAllApnList();
        setDataProfilesAsNeeded();
+10 −8
Original line number Diff line number Diff line
@@ -338,8 +338,16 @@ public class TelephonyNetworkFactory extends NetworkFactory {
        logl("onReleaseNetworkFor " + networkRequest + " applied " + applied);

        if (applied) {
            int transport = getTransportTypeFromNetworkRequest(networkRequest);
            releaseNetworkInternal(networkRequest, DcTracker.RELEASE_TYPE_NORMAL, transport);
            // Most of the time, the network request only exists in one of the DcTracker, but in the
            // middle of handover, the network request temporarily exists in both DcTrackers. If
            // connectivity service releases the network request while handover is ongoing, we need
            // to remove network requests from both DcTrackers.
            // Note that this part will be refactored in T, where we won't even have DcTracker at
            // all.
            releaseNetworkInternal(networkRequest, DcTracker.RELEASE_TYPE_NORMAL,
                    AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
            releaseNetworkInternal(networkRequest, DcTracker.RELEASE_TYPE_NORMAL,
                    AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
        }
    }

@@ -442,12 +450,6 @@ public class TelephonyNetworkFactory extends NetworkFactory {
            if (mNetworkRequests.containsKey(networkRequest)) {
                // Update it with the target transport.
                mNetworkRequests.put(networkRequest, targetTransport);
            } else {
                log("Network request was released before handover is completed. Now"
                        + " we need to release this network request. "
                        + networkRequest);
                releaseNetworkInternal(networkRequest, DcTracker.RELEASE_TYPE_NORMAL,
                        targetTransport);
            }
        } else {
            // If handover fails and requires to fallback, the context of target transport needs to
Loading