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

Commit 503f1869 authored by Jack Yu's avatar Jack Yu
Browse files

Added transport type and id in precise data connection state

Added the transport type in precise data connection state. This
would be useful for IWLAN, MAPCON, and 5G development work. Also
added id for listener to keep tracking the same data connection
state.

Bug: 161572838
Test: FrameworksTelephonyTests
Merged-In: Ief6d021b286a67edf6daca9c1381e68af43810a1
Change-Id: Ief6d021b286a67edf6daca9c1381e68af43810a1
(cherry picked from commit 3064cba4)
parent 90ccecc2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -641,6 +641,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;
@@ -313,6 +314,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()
@@ -332,6 +335,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()
@@ -362,6 +367,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()