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

Commit 7b98713c authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5778854 from 300998c7 to qt-c2f2-release

Change-Id: I8431e7a7db48042459885e57dc0a4de0fcd3ad9a
parents 5724b73f 300998c7
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1297,16 +1297,6 @@ public class DataConnection extends StateMachine {
        return result;
    }

    /** @return {@code true} if validation is required, {@code false} otherwise. */
    public boolean isValidationRequired() {
        final NetworkCapabilities nc = getNetworkCapabilities();
        return nc != null
                && nc.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
                && nc.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)
                && nc.hasCapability(NetworkCapabilities.NET_CAPABILITY_TRUSTED)
                && nc.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN);
    }

    /**
     * @return {@code True} if 464xlat should be skipped.
     */
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ public class DcNetworkAgent extends NetworkAgent {
        DcTracker dct = mPhone.getDcTracker(mTransportType);
        if (dct != null) {
            Message msg = dct.obtainMessage(DctConstants.EVENT_NETWORK_STATUS_CHANGED,
                    status, mDataConnection.getCid(), redirectUrl);
                    status, 0, redirectUrl);
            msg.sendToTarget();
        }
    }
+3 −8
Original line number Diff line number Diff line
@@ -2930,11 +2930,10 @@ public class DcTracker extends Handler {
     *
     * @param status One of {@code NetworkAgent.VALID_NETWORK} or
     * {@code NetworkAgent.INVALID_NETWORK}.
     * @param cid context id {@code cid}
     * @param redirectUrl If the Internet probe was redirected, this
     * is the destination it was redirected to, otherwise {@code null}
     */
    private void onNetworkStatusChanged(int status, int cid, String redirectUrl) {
    private void onNetworkStatusChanged(int status, String redirectUrl) {
        if (!TextUtils.isEmpty(redirectUrl)) {
            Intent intent = new Intent(TelephonyIntents.ACTION_CARRIER_SIGNAL_REDIRECTED);
            intent.putExtra(TelephonyIntents.EXTRA_REDIRECTION_URL_KEY, redirectUrl);
@@ -2942,7 +2941,6 @@ public class DcTracker extends Handler {
            log("Notify carrier signal receivers with redirectUrl: " + redirectUrl);
        } else {
            final boolean isValid = status == NetworkAgent.VALID_NETWORK;
            final DataConnection dc = getDataConnectionByContextId(cid);
            if (!mDsRecoveryHandler.isRecoveryOnBadNetworkEnabled()) {
                if (DBG) log("Skip data stall recovery on network status change with in threshold");
                return;
@@ -2951,11 +2949,9 @@ public class DcTracker extends Handler {
                if (DBG) log("Skip data stall recovery on non WWAN");
                return;
            }
            if (dc != null && dc.isValidationRequired()) {
            mDsRecoveryHandler.processNetworkStatusChanged(isValid);
        }
    }
    }

    /**
     * Called when EVENT_DISCONNECT_DONE is received.
@@ -3602,9 +3598,8 @@ public class DcTracker extends Handler {

            case DctConstants.EVENT_NETWORK_STATUS_CHANGED:
                int status = msg.arg1;
                int cid = msg.arg2;
                String url = (String) msg.obj;
                onNetworkStatusChanged(status, cid, url);
                onNetworkStatusChanged(status, url);
                break;

            case DctConstants.EVENT_RADIO_AVAILABLE:
+48 −4
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.LocaleTracker;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.ServiceStateTracker;
import com.android.internal.telephony.SubscriptionController;
import com.android.internal.telephony.metrics.TelephonyMetrics;
@@ -80,6 +81,11 @@ public class EmergencyNumberTracker extends Handler {
    private final CommandsInterface mCi;
    private final Phone mPhone;
    private String mCountryIso;
    /**
     * Indicates if the country iso is set by another subscription.
     * @hide
     */
    public boolean mIsCountrySetByAnotherSub = false;
    private String[] mEmergencyNumberPrefix = new String[0];

    private static final String EMERGENCY_NUMBER_DB_ASSETS_FILE = "eccdata";
@@ -131,7 +137,9 @@ public class EmergencyNumberTracker extends Handler {
                    if (TextUtils.isEmpty(countryIso)) {
                        return;
                    }
                    updateEmergencyNumberDatabaseCountryChange(countryIso);

                    // Update country iso change for available Phones
                    updateEmergencyCountryIsoAllPhones(countryIso);
                }
                return;
            }
@@ -222,11 +230,40 @@ public class EmergencyNumberTracker extends Handler {
        // If country iso has been cached when listener is set, don't need to cache the initial
        // country iso and initial database.
        if (mCountryIso == null) {
            mCountryIso = getInitialCountryIso().toLowerCase();
            updateEmergencyCountryIso(getInitialCountryIso().toLowerCase());
            cacheEmergencyDatabaseByCountry(mCountryIso);
        }
    }

    /**
     * Update Emergency country iso for all the Phones
     */
    @VisibleForTesting
    public void updateEmergencyCountryIsoAllPhones(String countryIso) {
        // Notify country iso change for current Phone
        mIsCountrySetByAnotherSub = false;
        updateEmergencyNumberDatabaseCountryChange(countryIso);

        // Share and notify country iso change for other Phones if the country
        // iso in their emergency number tracker is not available or the country
        // iso there is set by another active subscription.
        for (Phone phone: PhoneFactory.getPhones()) {
            if (phone.getPhoneId() == mPhone.getPhoneId()) {
                continue;
            }
            EmergencyNumberTracker emergencyNumberTracker;
            if (phone != null && phone.getEmergencyNumberTracker() != null) {
                emergencyNumberTracker = phone.getEmergencyNumberTracker();
                if (TextUtils.isEmpty(emergencyNumberTracker.getEmergencyCountryIso())
                        || emergencyNumberTracker.mIsCountrySetByAnotherSub) {
                    emergencyNumberTracker.mIsCountrySetByAnotherSub = true;
                    emergencyNumberTracker.updateEmergencyNumberDatabaseCountryChange(
                            countryIso);
                }
            }
        }
    }

    private void onCarrierConfigChanged() {
        if (mPhone != null) {
            CarrierConfigManager configMgr = (CarrierConfigManager)
@@ -381,8 +418,7 @@ public class EmergencyNumberTracker extends Handler {
    private void updateEmergencyNumberListDatabaseAndNotify(String countryIso) {
        logd("updateEmergencyNumberListDatabaseAndNotify(): receiving countryIso: "
                + countryIso);

        mCountryIso = countryIso.toLowerCase();
        updateEmergencyCountryIso(countryIso.toLowerCase());
        cacheEmergencyDatabaseByCountry(countryIso);
        writeUpdatedEmergencyNumberListMetrics(mEmergencyNumberListFromDatabase);
        if (!DBG) {
@@ -560,6 +596,14 @@ public class EmergencyNumberTracker extends Handler {
        return EmergencyNumber.EMERGENCY_CALL_ROUTING_UNKNOWN;
    }

    public String getEmergencyCountryIso() {
        return mCountryIso;
    }

    private synchronized void updateEmergencyCountryIso(String countryIso) {
        mCountryIso = countryIso;
    }

    /**
     * Get Emergency number list based on EccList. This util is used for solving backward
     * compatibility if device does not support the 1.4 IRadioIndication HAL that reports
+11 −0
Original line number Diff line number Diff line
@@ -1948,6 +1948,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
     */
    @VisibleForTesting
    public void addReasonCodeRemapping(Integer fromCode, String message, Integer toCode) {
        if (message != null) {
            message = message.toLowerCase();
        }
        mImsReasonCodeMap.put(new Pair<>(fromCode, message), toCode);
    }

@@ -1966,6 +1969,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        String reason = reasonInfo.getExtraMessage();
        if (reason == null) {
            reason = "";
        } else {
            reason = reason.toLowerCase();
        }
        log("maybeRemapReasonCode : fromCode = " + reasonInfo.getCode() + " ; message = "
                + reason);
@@ -2038,6 +2043,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            case ImsReasonInfo.CODE_SIP_GLOBAL_ERROR:
                return DisconnectCause.SERVER_ERROR;

            case ImsReasonInfo.CODE_EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE:
                return DisconnectCause.EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE;

            case ImsReasonInfo.CODE_WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION:
                return DisconnectCause.WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION;

            case ImsReasonInfo.CODE_SIP_SERVICE_UNAVAILABLE:
            case ImsReasonInfo.CODE_SIP_SERVER_ERROR:
                return DisconnectCause.SERVER_UNREACHABLE;
Loading