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

Commit 1ed33192 authored by Hui Wang's avatar Hui Wang Committed by Amit Mahajan
Browse files

Control radio restart on PDP_FAIL_REGULAR_DEACTIVATION by a config variable

Bug: 17567651, 16308209
Change-Id: I6bb1519a795dcb7e99a94d366afdfaec21c43d84
parent 33c5842f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.internal.telephony.dataconnection;

import android.content.res.Resources;
import java.util.HashMap;

/**
@@ -37,7 +38,7 @@ public enum DcFailCause {
    SERVICE_OPTION_NOT_SUBSCRIBED(0x21),    /* no retry */
    SERVICE_OPTION_OUT_OF_ORDER(0x22),
    NSAPI_IN_USE(0x23),                     /* no retry */
    REGULAR_DEACTIVATION(0x24),             /* Restart radio */
    REGULAR_DEACTIVATION(0x24),             /* possibly restart radio, based on config */
    ONLY_IPV4_ALLOWED(0x32),                /* no retry */
    ONLY_IPV6_ALLOWED(0x33),                /* no retry */
    ONLY_SINGLE_BEARER_ALLOWED(0x34),
@@ -62,6 +63,8 @@ public enum DcFailCause {
    LOST_CONNECTION(0x10004),
    RESET_BY_FRAMEWORK(0x10005);

    private final boolean mRestartRadioOnRegularDeactivation = Resources.getSystem().getBoolean(
            com.android.internal.R.bool.config_restart_radio_on_pdp_fail_regular_deactivation);
    private final int mErrorCode;
    private static final HashMap<Integer, DcFailCause> sErrorCodeToFailCauseMap;
    static {
@@ -81,7 +84,7 @@ public enum DcFailCause {

    /** Radio has failed such that the radio should be restarted */
    public boolean isRestartRadioFail() {
        return (this == REGULAR_DEACTIVATION);
        return (this == REGULAR_DEACTIVATION && mRestartRadioOnRegularDeactivation);
    }

    public boolean isPermanentFail() {