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

Commit 2f1cb741 authored by Sukanya Rajkhowa's avatar Sukanya Rajkhowa Committed by Linux Build Service Account
Browse files

Check config for data call errors

As certain data call errors can be treated as temporary or
permanent errors by different carriers, use the carrier
specific config to determine retry behaviour

CRs-Fixed: 650922

Change-Id: Ie07c448d026d9cc801b137d33bd871c6b42d81c5
parent b26e3b4c
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@
package com.android.internal.telephony.dataconnection;

import android.content.res.Resources;
import android.content.Context;
import android.telephony.SubscriptionManager;

import com.android.internal.R;

import java.util.HashMap;

/**
@@ -87,16 +92,22 @@ public enum DcFailCause {
        return (this == REGULAR_DEACTIVATION && mRestartRadioOnRegularDeactivation);
    }

    public boolean isPermanentFail() {
    public boolean isPermanentFail(Context context, int subId) {
        if (this == ACTIVATION_REJECT_GGSN) {
            return (SubscriptionManager.getResourcesForSubId(context, subId).
                    getBoolean(com.android.internal.R.bool.config_reject_ggsn_perm_failure));
        } else if (this == PROTOCOL_ERRORS) {
            return (SubscriptionManager.getResourcesForSubId(context, subId).
                    getBoolean(com.android.internal.R.bool.config_protocol_errors_perm_failure));
        } else {
            return (this == OPERATOR_BARRED) || (this == MISSING_UNKNOWN_APN) ||
                    (this == UNKNOWN_PDP_ADDRESS_TYPE) || (this == USER_AUTHENTICATION) ||
                (this == ACTIVATION_REJECT_GGSN) || (this == SERVICE_OPTION_NOT_SUPPORTED) ||
                    (this == SERVICE_OPTION_NOT_SUPPORTED) ||
                    (this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) ||
                    (this == ONLY_IPV4_ALLOWED) || (this == ONLY_IPV6_ALLOWED) ||
                (this == PROTOCOL_ERRORS) ||
                    (this == RADIO_POWER_OFF) || (this == TETHERED_CALL_ACTIVE) ||
                (this == RADIO_NOT_AVAILABLE) || (this == UNACCEPTABLE_NETWORK_PARAMETER) ||
                (this == SIGNAL_LOST);
                    (this == RADIO_NOT_AVAILABLE) || (this == UNACCEPTABLE_NETWORK_PARAMETER);
        }
    }

    public boolean isEventLoggable() {
+1 −1
Original line number Diff line number Diff line
@@ -1192,7 +1192,7 @@ public class DcTracker extends DcTrackerBase {

    @Override
    protected boolean isPermanentFail(DcFailCause dcFailCause) {
        return (dcFailCause.isPermanentFail() &&
        return (dcFailCause.isPermanentFail(mPhone.getContext(), mPhone.getSubId()) &&
                (mAttached.get() == false || dcFailCause != DcFailCause.SIGNAL_LOST));
    }