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

Commit a218bf79 authored by Sarah Chin's avatar Sarah Chin Committed by Automerger Merge Worker
Browse files

DeactivateDataCall remove network on all errors am: 72ec990b

parents e17e3f5f 72ec990b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -92,9 +92,8 @@ public class CellularDataService extends DataService {
                            int error = (int) ar.result;
                            callback.onDeactivateDataCallComplete(ar.exception != null
                                    ? DataServiceCallback.RESULT_ERROR_ILLEGAL_STATE
                                    : error == RadioError.RADIO_NOT_AVAILABLE
                                            ? DataServiceCallback.RESULT_ERROR_RADIO_NOT_AVAILABLE
                                            : RESULT_SUCCESS);
                                    : error == RadioError.NONE ? RESULT_SUCCESS
                                            : DataServiceCallback.RESULT_ERROR_INVALID_RESPONSE);
                            break;
                        case SET_INITIAL_ATTACH_APN_COMPLETE:
                            callback.onSetInitialAttachApnComplete(ar.exception != null
+3 −3
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ import java.util.stream.Collectors;
 * {@link DisconnectingState} when performing graceful tear down or when sending the data
 * deactivation request. At the end, it enters {@link DisconnectedState} when {@link DataService}
 * notifies data disconnected. Note that an unsolicited disconnected event from {@link DataService}
 * or a RADIO_NOT_AVAILABLE response can immediately move data network from {@link ConnectedState}
 * or any vendor HAL failure response can immediately move data network from {@link ConnectedState}
 * to {@link DisconnectedState}. {@link DisconnectedState} is the final state of a data network.
 *
 * State machine diagram:
@@ -2034,8 +2034,8 @@ public class DataNetwork extends StateMachine {
    private void onDeactivateResponse(@DataServiceCallback.ResultCode int resultCode) {
        logl("onDeactivateResponse: resultCode="
                + DataServiceCallback.resultCodeToString(resultCode));
        if (resultCode == DataServiceCallback.RESULT_ERROR_RADIO_NOT_AVAILABLE) {
            log("Remove network since deactivate request returned RADIO_NOT_AVAILABLE.");
        if (resultCode == DataServiceCallback.RESULT_ERROR_INVALID_RESPONSE) {
            log("Remove network since deactivate request returned an error.");
            mDataNetworkCallback.invokeFromExecutor(
                    () -> mDataNetworkCallback.onDisconnected(
                            DataNetwork.this, DataFailCause.RADIO_NOT_AVAILABLE));
+1 −1
Original line number Diff line number Diff line
@@ -697,7 +697,7 @@ public class DataNetworkTest extends TelephonyTest {
        testCreateDataNetwork();
        assertThat(mDataNetworkUT.isConnected()).isTrue();
        mDataNetworkUT.sendMessage(19/*EVENT_DEACTIVATE_DATA_NETWORK_RESPONSE*/,
                6/*RESULT_ERROR_RADIO_NOT_AVAILABLE*/);
                6/*RESULT_ERROR_INVALID_RESPONSE*/);
        processAllMessages();

        verify(mDataNetworkCallback).onDisconnected(eq(mDataNetworkUT), eq(