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

Commit 315ab940 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5657398 from 07d66def to qt-c2f2-release

Change-Id: I939b8f11f7864d9030f35305bd34342001918b19
parents 897360f5 07d66def
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -546,6 +546,7 @@ public class ServiceStateTracker extends Handler {
    private String mPrlVersion;
    private boolean mIsMinInfoReady = false;
    private boolean mIsEriTextLoaded = false;
    private String mEriText;
    @UnsupportedAppUsage
    private boolean mIsSubscriptionFromRuim = false;
    private CdmaSubscriptionSourceManager mCdmaSSM;
@@ -3260,9 +3261,17 @@ public class ServiceStateTracker extends Handler {
            setNotification(CS_REJECT_CAUSE_ENABLED);
        }

        if (hasChanged) {
        String eriText = mPhone.getCdmaEriText();
        boolean hasEriChanged = !TextUtils.equals(mEriText, eriText);
        mEriText = eriText;
        // Trigger updateSpnDisplay when
        // 1. Service state is changed.
        // 2. phone type is Cdma or CdmaLte and ERI text has changed.
        if (hasChanged || (!mPhone.isPhoneTypeGsm() && hasEriChanged)) {
            updateSpnDisplay();
        }

        if (hasChanged) {
            tm.setNetworkOperatorNameForPhone(mPhone.getPhoneId(), mSS.getOperatorAlpha());
            String operatorNumeric = mSS.getOperatorNumeric();

+9 −4
Original line number Diff line number Diff line
@@ -3779,11 +3779,16 @@ public class SubscriptionController extends ISub.Stub {
        final long token = Binder.clearCallingIdentity();

        try {
            int subId = PhoneSwitcher.getInstance().getActiveDataSubId();
            if (!SubscriptionManager.isUsableSubscriptionId(subId)) {
                subId = getDefaultDataSubId();
            PhoneSwitcher phoneSwitcher = PhoneSwitcher.getInstance();
            if (phoneSwitcher != null) {
                int activeDataSubId = phoneSwitcher.getActiveDataSubId();
                if (SubscriptionManager.isUsableSubscriptionId(activeDataSubId)) {
                    return activeDataSubId;
                }
            return subId;
            }
            // If phone switcher isn't ready, or active data sub id is not available, use default
            // sub id from settings.
            return getDefaultDataSubId();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
+10 −6
Original line number Diff line number Diff line
@@ -407,6 +407,9 @@ public class DataEnabledSettings {
    }

    public synchronized boolean isDataEnabled(int apnType) {
        if (isProvisioning()) {
            return isProvisioningDataEnabled();
        } else {
            boolean userDataEnabled = isUserDataEnabled();
            // Check if we should temporarily enable data in certain conditions.
            boolean isDataEnabledOverridden = mDataEnabledOverride
@@ -415,6 +418,7 @@ public class DataEnabledSettings {
            return (mInternalDataEnabled && mPolicyDataEnabled && mCarrierDataEnabled
                    && (userDataEnabled || isDataEnabledOverridden));
        }
    }

    private void log(String s) {
        Rlog.d(LOG_TAG, "[" + mPhone.getPhoneId() + "]" + s);
+29 −22
Original line number Diff line number Diff line
@@ -1320,7 +1320,7 @@ public class DcTracker extends Handler {
            reasons.add(DataDisallowedReasonType.IN_ECBM);
        }

        if (!attachedState && !mAutoAttachEnabled.get() && requestType != REQUEST_TYPE_HANDOVER) {
        if (!attachedState && !shouldAutoAttach() && requestType != REQUEST_TYPE_HANDOVER) {
            reasons.add(DataDisallowedReasonType.NOT_ATTACHED);
        }
        if (!recordsLoaded) {
@@ -1488,6 +1488,9 @@ public class DcTracker extends Handler {
                apnContext.setState(DctConstants.State.IDLE);
            }
            int radioTech = getDataRat();
            if (radioTech == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) {
                radioTech = getVoiceRat();
            }
            log("service state=" + mPhone.getServiceState());
            apnContext.setConcurrentVoiceAndDataAllowed(mPhone.getServiceStateTracker()
                    .isConcurrentVoiceAndDataAllowed());
@@ -1761,8 +1764,8 @@ public class DcTracker extends Handler {
        }

        for (ApnSetting dunSetting : dunCandidates) {
            if (!ServiceState.bitmaskHasTech(dunSetting.getNetworkTypeBitmask(),
                    ServiceState.rilRadioTechnologyToNetworkType(bearer))) {
            if (!ServiceState.networkBitmaskHasAccessNetworkType(dunSetting.getNetworkTypeBitmask(),
                    ServiceState.rilRadioTechnologyToAccessNetworkType(bearer))) {
                continue;
            }
            retDunSettings.add(dunSetting);
@@ -2204,10 +2207,6 @@ public class DcTracker extends Handler {
        }
    }

    public boolean getAutoAttachEnabled() {
        return mAutoAttachEnabled.get();
    }

    private void onRecordsLoadedOrSubIdChanged() {
        if (DBG) log("onRecordsLoadedOrSubIdChanged: createAllApnList");
        if (mTransportType == AccessNetworkConstants.TRANSPORT_TYPE_WWAN) {
@@ -3284,8 +3283,9 @@ public class DcTracker extends Handler {
                        + mPreferredApn.getOperatorNumeric() + ":" + mPreferredApn);
            }
            if (mPreferredApn.getOperatorNumeric().equals(operator)) {
                if (ServiceState.bitmaskHasTech(mPreferredApn.getNetworkTypeBitmask(),
                        ServiceState.rilRadioTechnologyToNetworkType(radioTech))) {
                if (ServiceState.networkBitmaskHasAccessNetworkType(
                        mPreferredApn.getNetworkTypeBitmask(),
                        ServiceState.rilRadioTechnologyToAccessNetworkType(radioTech))) {
                    apnList.add(mPreferredApn);
                    apnList = sortApnListByPreferred(apnList);
                    if (DBG) log("buildWaitingApns: X added preferred apnList=" + apnList);
@@ -3305,8 +3305,8 @@ public class DcTracker extends Handler {
        if (DBG) log("buildWaitingApns: mAllApnSettings=" + mAllApnSettings);
        for (ApnSetting apn : mAllApnSettings) {
            if (apn.canHandleType(requestedApnTypeBitmask)) {
                if (ServiceState.bitmaskHasTech(apn.getNetworkTypeBitmask(),
                        ServiceState.rilRadioTechnologyToNetworkType(radioTech))) {
                if (ServiceState.networkBitmaskHasAccessNetworkType(apn.getNetworkTypeBitmask(),
                        ServiceState.rilRadioTechnologyToAccessNetworkType(radioTech))) {
                    if (VDBG) log("buildWaitingApns: adding apn=" + apn);
                    apnList.add(apn);
                } else {
@@ -3875,7 +3875,7 @@ public class DcTracker extends Handler {
        log("update(): Active DDS, register for all events now!");
        onUpdateIcc();

        updateAutoAttachOnCreation();
        mAutoAttachEnabled.set(false);

        mPhone.updateCurrentCarrierInProvider();
    }
@@ -3886,20 +3886,17 @@ public class DcTracker extends Handler {
     * try setting up data call even if it's not attached for 2G or 3G networks. And doing so will
     * trigger PS attach if possible.
     */
    public void updateAutoAttachOnCreation() {
    @VisibleForTesting
    public boolean shouldAutoAttach() {
        if (mAutoAttachEnabled.get()) return true;

        PhoneSwitcher phoneSwitcher = PhoneSwitcher.getInstance();
        ServiceState serviceState = mPhone.getServiceState();
        if (PhoneSwitcher.getInstance() == null || serviceState == null) {
            mAutoAttachEnabled.set(false);
            return;
        }

        // If it's non DDS phone, and voice is registered on 2G or 3G network, we set
        // mAutoAttachEnabled to true.
        mAutoAttachEnabled.set(mPhone.getPhoneId() != phoneSwitcher.getPreferredDataPhoneId()
        return phoneSwitcher != null && serviceState != null
                && mPhone.getPhoneId() != phoneSwitcher.getPreferredDataPhoneId()
                && serviceState.getVoiceRegState() == ServiceState.STATE_IN_SERVICE
                && serviceState.getVoiceNetworkType() != NETWORK_TYPE_LTE
                && serviceState.getVoiceNetworkType() != NETWORK_TYPE_NR);
                && serviceState.getVoiceNetworkType() != NETWORK_TYPE_NR;
    }

    private void notifyAllDataDisconnected() {
@@ -4841,4 +4838,14 @@ public class DcTracker extends Handler {
        }
        return ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
    }

    private int getVoiceRat() {
        ServiceState ss = mPhone.getServiceState();
        NetworkRegistrationInfo nrs = ss.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_CS, mTransportType);
        if (nrs != null) {
            return ServiceState.networkTypeToRilRadioTechnology(nrs.getAccessNetworkTechnology());
        }
        return ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
    }
}
+0 −7
Original line number Diff line number Diff line
@@ -231,13 +231,6 @@ public class TelephonyNetworkFactory extends NetworkFactory {

    // apply or revoke requests if our active-ness changes
    private void onActivePhoneSwitch() {
        // For non DDS phone, mAutoAttachOnCreation should be true because it may be detached
        // automatically from network only because it's idle for too long. In this case, we should
        // try setting up data call even if it's not attached. And doing so will trigger PS attach
        // if possible.
        mPhone.getDcTracker(AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                .updateAutoAttachOnCreation();

        for (HashMap.Entry<NetworkRequest, Integer> entry : mNetworkRequests.entrySet()) {
            NetworkRequest networkRequest = entry.getKey();
            boolean applied = entry.getValue() != AccessNetworkConstants.TRANSPORT_TYPE_INVALID;
Loading