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

Commit 9a8ddf5b authored by Jack Yu's avatar Jack Yu Committed by Gerrit Code Review
Browse files

Merge changes I6ad7b1fe,I12c9e5b5,I202d254a

* changes:
  Handle setup data result of RESULT_ERROR_INVALID_ARG
  Transit to inactive state when starting handover failed
  Clean up outstanding handover request when tearing down
parents e3719376 67684a0b
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -1008,6 +1008,12 @@ public class DataConnection extends StateMachine {
        }
    }

    private void onRquestHandoverFailed(ConnectionParams cp) {
        sendMessage(obtainMessage(EVENT_CANCEL_HANDOVER));
        notifyConnectCompleted(cp, DataFailCause.UNKNOWN,
                    DataCallResponse.HANDOVER_FAILURE_MODE_UNKNOWN, false);
    }

    private void requestHandover(boolean inCorrectState, DataConnection srcDc,
            @DataServiceCallback.ResultCode int resultCode,
            ConnectionParams cp, Message msg, DataProfile dp, boolean isModemRoaming,
@@ -1025,8 +1031,7 @@ public class DataConnection extends StateMachine {
                            + "srcdc = null");
                }
            }
            notifyConnectCompleted(cp, DataFailCause.UNKNOWN,
                    DataCallResponse.HANDOVER_FAILURE_MODE_UNKNOWN, false);
            onRquestHandoverFailed(cp);
            return;
        } else if (!isResultCodeSuccess(resultCode)) {
            if (DBG) {
@@ -1034,8 +1039,7 @@ public class DataConnection extends StateMachine {
                        + "setupDataCall will not be called, result code = "
                        + DataServiceCallback.resultCodeToString(resultCode));
            }
            notifyConnectCompleted(cp, DataFailCause.UNKNOWN,
                    DataCallResponse.HANDOVER_FAILURE_MODE_UNKNOWN, false);
            onRquestHandoverFailed(cp);
            return;
        }

@@ -1060,8 +1064,7 @@ public class DataConnection extends StateMachine {
        if (linkProperties == null || linkProperties.getLinkAddresses().isEmpty()) {
            loge("requestHandover: Can't find link properties of handover data connection. dc="
                    + srcDc);
            notifyConnectCompleted(cp, DataFailCause.UNKNOWN,
                    DataCallResponse.HANDOVER_FAILURE_MODE_UNKNOWN, false);
            onRquestHandoverFailed(cp);
            return;
        }

@@ -1381,6 +1384,9 @@ public class DataConnection extends StateMachine {
        } else if (resultCode == DataServiceCallback.RESULT_ERROR_ILLEGAL_STATE) {
            result = SetupResult.ERROR_RADIO_NOT_AVAILABLE;
            result.mFailCause = DataFailCause.RADIO_NOT_AVAILABLE;
        } else if (resultCode == DataServiceCallback.RESULT_ERROR_INVALID_ARG) {
            result = SetupResult.ERROR_INVALID_ARG;
            result.mFailCause = DataFailCause.UNACCEPTABLE_NETWORK_PARAMETER;
        } else if (response.getCause() != 0) {
            if (response.getCause() == DataFailCause.RADIO_NOT_AVAILABLE) {
                result = SetupResult.ERROR_RADIO_NOT_AVAILABLE;
@@ -2722,6 +2728,10 @@ public class DataConnection extends StateMachine {
                    ((Consumer<Boolean>) msg.obj).accept(true /* is in correct state*/);
                    retVal = HANDLED;
                    break;
                case EVENT_CANCEL_HANDOVER:
                    transitionTo(mInactiveState);
                    retVal = HANDLED;
                    break;
                default:
                    if (VDBG) {
                        log("DcActivatingState not handled msg.what=" +
+3 −0
Original line number Diff line number Diff line
@@ -1862,6 +1862,9 @@ public class DcTracker extends Handler {
            apnContext.setDataConnection(null);
        }

        // If there is any outstanding handover request, we need to respond it.
        sendHandoverCompleteMessages(apnContext.getApnTypeBitmask(), false, false);

        // Make sure reconnection alarm is cleaned up if there is no ApnContext
        // associated to the connection.
        if (dataConnection != null) {