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

Commit b3de8a8c authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Fail handover request if source data connection not in correct state"

am: 7bc09ed1

Change-Id: I078138cc6bc6054903e970f71902c6b87166d36e
parents 1cd188ce 7bc09ed1
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ import com.android.internal.telephony.dataconnection.DcTracker.RequestNetworkTyp
import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.internal.telephony.nano.TelephonyProto.RilDataCall;
import com.android.internal.util.AsyncChannel;
import com.android.internal.util.CollectionUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Protocol;
import com.android.internal.util.State;
@@ -684,19 +685,26 @@ public class DataConnection extends StateMachine {
                return DataFailCause.HANDOVER_FAILED;
            }

            linkProperties = dc.getLinkProperties();
            // Preserve the potential network agent from the source data connection. The ownership
            // is not transferred at this moment.
            mHandoverLocalLog.log("Handover started. Preserved the agent.");
            mHandoverSourceNetworkAgent = dc.getNetworkAgent();
            log("Get the handover source network agent: " + mHandoverSourceNetworkAgent);
            dc.setHandoverState(HANDOVER_STATE_BEING_TRANSFERRED);
            if (linkProperties == null) {
            if (mHandoverSourceNetworkAgent == null) {
                loge("Cannot get network agent from the source dc " + dc.getName());
                return DataFailCause.HANDOVER_FAILED;
            }

            linkProperties = dc.getLinkProperties();
            if (linkProperties == null || CollectionUtils.isEmpty(
                    linkProperties.getLinkAddresses())) {
                loge("connect: Can't find link properties of handover data connection. dc="
                        + dc);
                return DataFailCause.HANDOVER_FAILED;
            }

            mHandoverLocalLog.log("Handover started. Preserved the agent.");
            log("Get the handover source network agent: " + mHandoverSourceNetworkAgent);

            dc.setHandoverState(HANDOVER_STATE_BEING_TRANSFERRED);
            reason = DataService.REQUEST_REASON_HANDOVER;
        }