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

Commit b71bf216 authored by Andalam Parthasarathi's avatar Andalam Parthasarathi Committed by Steve Kondik
Browse files

Add pdp data reject with cause code 29 and 33

Following changes made:
1. Added config flag for data reject cause 29 and 33
2.  Modify access specifiers.

Change-Id: Ibd04b307176b492a26955d8f3e2e640010197555
CRs-Fixed: 774782
parent af238e59
Loading
Loading
Loading
Loading
+33 −17
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.RetryManager;
import com.android.internal.telephony.ServiceStateTracker;
import com.android.internal.telephony.TelephonyPluginDelegate;
import com.android.internal.util.AsyncChannel;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.Protocol;
@@ -86,9 +87,9 @@ import java.util.HashMap;
 * NOTE: All DataConnection objects must be running on the same looper, which is the default
 * as the coordinator has members which are used without synchronization.
 */
public final class DataConnection extends StateMachine {
    private static final boolean DBG = true;
    private static final boolean VDBG = true;
public class DataConnection extends StateMachine {
    protected static final boolean DBG = true;
    protected static final boolean VDBG = true;

    /** Retry configuration: A doubling of retry times from 5secs to 30minutes */
    private static final String DEFAULT_DATA_RETRY_CONFIG = "default_randomization=2000,"
@@ -107,25 +108,25 @@ public final class DataConnection extends StateMachine {
    // The Tester for failing all bringup's
    private DcTesterFailBringUpAll mDcTesterFailBringUpAll;

    private static AtomicInteger mInstanceNumber = new AtomicInteger(0);
    protected static AtomicInteger mInstanceNumber = new AtomicInteger(0);
    private AsyncChannel mAc;

    // Utilities for the DataConnection
    private DcRetryAlarmController mDcRetryAlarmController;
    protected DcRetryAlarmController mDcRetryAlarmController;

    // The DCT that's talking to us, we only support one!
    private DcTrackerBase mDct = null;
    protected DcTrackerBase mDct = null;

    protected String[] mPcscfAddr;

    private ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil();
    protected ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil();

    /**
     * Used internally for saving connecting parameters.
     */
    static class ConnectionParams {
    public static class ConnectionParams {
        int mTag;
        ApnContext mApnContext;
        public ApnContext mApnContext;
        int mInitialMaxRetry;
        int mProfileId;
        int mRilRat;
@@ -157,7 +158,7 @@ public final class DataConnection extends StateMachine {
    /**
     * Used internally for saving disconnecting parameters.
     */
    static class DisconnectParams {
    public static class DisconnectParams {
        int mTag;
        ApnContext mApnContext;
        String mReason;
@@ -182,7 +183,7 @@ public final class DataConnection extends StateMachine {
    private DisconnectParams mDisconnectParams;
    private DcFailCause mDcFailCause;

    private PhoneBase mPhone;
    protected PhoneBase mPhone;
    private LinkProperties mLinkProperties = new LinkProperties();
    private long mCreateTime;
    private long mLastFailTime;
@@ -195,7 +196,7 @@ public final class DataConnection extends StateMachine {
    private NetworkAgent mNetworkAgent;

    //***** Package visible variables
    int mTag;
    protected int mTag;
    int mCid;
    HashMap<ApnContext, ConnectionParams> mApnContexts = null;
    PendingIntent mReconnectIntent = null;
@@ -214,7 +215,7 @@ public final class DataConnection extends StateMachine {
    static final int EVENT_DATA_STATE_CHANGED = BASE + 7;
    static final int EVENT_TEAR_DOWN_NOW = BASE + 8;
    static final int EVENT_LOST_CONNECTION = BASE + 9;
    static final int EVENT_RETRY_CONNECTION = BASE + 10;
    protected static final int EVENT_RETRY_CONNECTION = BASE + 10;
    static final int EVENT_DATA_CONNECTION_DRS_OR_RAT_CHANGED = BASE + 11;
    static final int EVENT_DATA_CONNECTION_ROAM_ON = BASE + 12;
    static final int EVENT_DATA_CONNECTION_ROAM_OFF = BASE + 13;
@@ -281,7 +282,7 @@ public final class DataConnection extends StateMachine {
        return dc;
    }

    void dispose() {
    protected void dispose() {
        log("dispose: call quiteNow()");
        quitNow();
    }
@@ -422,7 +423,7 @@ public final class DataConnection extends StateMachine {
    }

    //***** Constructor (NOTE: uses dcc.getHandler() as its Handler)
    private DataConnection(PhoneBase phone, String name, int id,
    protected DataConnection(PhoneBase phone, String name, int id,
                DcTrackerBase dct, DcTesterFailBringUpAll failBringUpAll,
                DcController dcc) {
        super(name, dcc.getHandler());
@@ -696,7 +697,7 @@ public final class DataConnection extends StateMachine {
     *
     * @param dp is the DisconnectParams.
     */
    private void notifyDisconnectCompleted(DisconnectParams dp, boolean sendAll) {
    protected void notifyDisconnectCompleted(DisconnectParams dp, boolean sendAll) {
        if (VDBG) log("NotifyDisconnectCompleted");

        ApnContext alreadySent = null;
@@ -1619,7 +1620,7 @@ public final class DataConnection extends StateMachine {
            return retVal;
        }
    }
    private DcRetryingState mRetryingState = new DcRetryingState();
    protected DcRetryingState mRetryingState = new DcRetryingState();

    /**
     * The state machine is activating a connection.
@@ -1663,6 +1664,7 @@ public final class DataConnection extends StateMachine {
                            // All is well
                            mDcFailCause = DcFailCause.NONE;
                            transitionTo(mActiveState);
                            handlePdpRejectCauseSuccess();
                            break;
                        case ERR_BadCommand:
                            // Vendor ril rejected the command and didn't connect.
@@ -1693,6 +1695,10 @@ public final class DataConnection extends StateMachine {
                                    + " result.isPermanentFail=" +
                                    mDct.isPermanentFail(result.mFailCause);
                            if (DBG) log(str);
                            boolean isHandled = isPdpRejectCauseFailureHandled(result, cp);
                            if (isHandled) {
                                break;
                            }
                            if (cp.mApnContext != null) cp.mApnContext.requestLog(str);
                            if (result.mFailCause.isRestartRadioFail() ||
                                    (cp.mApnContext != null &&
@@ -2349,4 +2355,14 @@ public final class DataConnection extends StateMachine {
        pw.println(" mDcRetryAlarmController=" + mDcRetryAlarmController);
        pw.flush();
    }

    protected void handlePdpRejectCauseSuccess() {
        if (DBG) log("handlePdpRejectCauseSuccess()");
    }

    protected boolean isPdpRejectCauseFailureHandled(DataCallResponse.SetupResult result,
            ConnectionParams cp) {
        if (DBG) log("isPdpRejectCauseFailureHandled()");
        return false;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ import java.util.HashMap;
 * multiple data connections. For instance listening for unsolicited messages
 * and then demultiplexing them to the appropriate DC.
 */
class DcController extends StateMachine {
public class DcController extends StateMachine {
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ public enum DcFailCause {
    RADIO_POWER_OFF(-5),                    /* no retry */
    TETHERED_CALL_ACTIVE(-6),               /* no retry */
    ERROR_UNSPECIFIED(0xFFFF),
    PDP_FAIL_IPV4_CALL_THROTTLED(-7),
    PDP_FAIL_IPV6_CALL_THROTTLED(-8),

    // Errors generated by the Framework
    // specified here
+12 −3
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class DcRetryAlarmController {
    private String mActionRetry;
    private static final String INTENT_RETRY_ALARM_WHAT = "what";
    private static final String INTENT_RETRY_ALARM_TAG = "tag";
    private PendingIntent mRetryIntent = null;

    private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
            @Override
@@ -109,7 +110,7 @@ public class DcRetryAlarmController {
     * @param ar is the result from SETUP_DATA_CALL
     * @return < 0 if no retry is needed otherwise the delay to the next SETUP_DATA_CALL
     */
    int getSuggestedRetryTime(DataConnection dc, AsyncResult ar) {
    public int getSuggestedRetryTime(DataConnection dc, AsyncResult ar) {
        int retryDelay;

        DataCallResponse response = (DataCallResponse) ar.result;
@@ -147,10 +148,18 @@ public class DcRetryAlarmController {
                    " what=" + what + " tag=" + tag);
        }

        PendingIntent retryIntent = PendingIntent.getBroadcast (mPhone.getContext(), 0,
        mRetryIntent = PendingIntent.getBroadcast (mPhone.getContext(), 0,
                                        intent, PendingIntent.FLAG_UPDATE_CURRENT);
        mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                SystemClock.elapsedRealtime() + delay, retryIntent);
                SystemClock.elapsedRealtime() + delay, mRetryIntent);
    }

    public void cancel(){
        if(mRetryIntent != null) {
            if (DBG) log("cancel event: "+mRetryIntent);
            mAlarmManager.cancel(mRetryIntent);
            mRetryIntent = null;
        }
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -2613,7 +2613,7 @@ public class DcTracker extends DcTrackerBase {
    }

    /** Return the DC AsyncChannel for the new data connection */
    private DcAsyncChannel createDataConnection() {
    protected DcAsyncChannel createDataConnection() {
        if (DBG) log("createDataConnection E");

        int id = mUniqueIdGenerator.getAndIncrement();