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

Commit e4e3a116 authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Added transport type and id in precise data connection state"

parents 393541ba 3064cba4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -643,6 +643,8 @@ public class GsmCdmaPhone extends Phone {
                || ((mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE)
                        && !isEmergencyData)) {
            return new PreciseDataConnectionState.Builder()
                    .setTransportType(mTransportManager.getCurrentTransport(
                            ApnSetting.getApnTypesBitmaskFromString(apnType)))
                    .setState(TelephonyManager.DATA_DISCONNECTED)
                    .setApnSetting(new ApnSetting.Builder()
                            .setApnTypeBitmask(ApnSetting.getApnTypesBitmaskFromString(apnType))
+5 −1
Original line number Diff line number Diff line
@@ -1188,8 +1188,12 @@ public class DcTracker extends Handler {

        ApnSetting apnSetting = getActiveApnSetting(apnType);

        // TODO: should the data fail cause be populated?
        DataConnection dc = getDataConnectionByApnType(apnType);

        // TODO: Move this entirely into Data Connection
        return new PreciseDataConnectionState.Builder()
                .setTransportType(mTransportType)
                .setId(dc != null ? dc.getCid() : -1)
                .setState(telState)
                .setNetworkType(networkType)
                .setLinkProperties(getLinkProperties(apnType))
+7 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import static org.mockito.Mockito.when;
import android.content.Intent;
import android.net.LinkProperties;
import android.os.ServiceManager;
import android.telephony.AccessNetworkConstants;
import android.telephony.Annotation;
import android.telephony.PhoneCapability;
import android.telephony.PhoneStateListener;
@@ -312,6 +313,8 @@ public class TelephonyRegistryTest extends TelephonyTest {
        mTelephonyRegistry.notifyDataConnectionForSubscriber(
                /*phoneId*/ 0, subId, ApnSetting.TYPE_DEFAULT,
                new PreciseDataConnectionState.Builder()
                        .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                        .setId(1)
                        .setState(0)
                        .setNetworkType(0)
                        .setApnSetting(new ApnSetting.Builder()
@@ -331,6 +334,8 @@ public class TelephonyRegistryTest extends TelephonyTest {
        mTelephonyRegistry.notifyDataConnectionForSubscriber(
                /*phoneId*/ 0, subId, ApnSetting.TYPE_IMS,
                new PreciseDataConnectionState.Builder()
                        .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                        .setId(1)
                        .setState(0)
                        .setNetworkType(0)
                        .setApnSetting(new ApnSetting.Builder()
@@ -361,6 +366,8 @@ public class TelephonyRegistryTest extends TelephonyTest {
        mTelephonyRegistry.notifyDataConnectionForSubscriber(
                /*phoneId*/ 0, subId, ApnSetting.TYPE_IMS,
                new PreciseDataConnectionState.Builder()
                        .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                        .setId(1)
                        .setState(0)
                        .setNetworkType(0)
                        .setApnSetting(new ApnSetting.Builder()