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

Commit 90ccecc2 authored by Jack Yu's avatar Jack Yu
Browse files

Removed APN name and types from PreciseDataConnectionState

The APN name and type bitmasks should come from APN setting.
Also fixed a regression caused by ag/9931487 that the APN
field in precise data connection state is changed to APN type in
string, instead of the APN name.

Bug: 161572838
Test: FrameworksTelephonyTests
Merged-In: Ia315c9a59df87bdaeb3ea5f9da2d7ad81b3361ed
Change-Id: Ia315c9a59df87bdaeb3ea5f9da2d7ad81b3361ed
(cherry picked from commit 4023ec05)
parent 426e5cf6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -642,8 +642,9 @@ public class GsmCdmaPhone extends Phone {
                        && !isEmergencyData)) {
            return new PreciseDataConnectionState.Builder()
                    .setState(TelephonyManager.DATA_DISCONNECTED)
                    .setApnTypes(ApnSetting.getApnTypesBitmaskFromString(apnType))
                    .setApn(apnType)
                    .setApnSetting(new ApnSetting.Builder()
                            .setApnTypeBitmask(ApnSetting.getApnTypesBitmaskFromString(apnType))
                            .build())
                    .build();
        }

+0 −3
Original line number Diff line number Diff line
@@ -1187,14 +1187,11 @@ public class DcTracker extends Handler {
        }

        ApnSetting apnSetting = getActiveApnSetting(apnType);
        int apnTypesBitmask = ApnSetting.getApnTypesBitmaskFromString(apnType);

        // TODO: should the data fail cause be populated?
        return new PreciseDataConnectionState.Builder()
                .setState(telState)
                .setNetworkType(networkType)
                .setApnTypes(apnTypesBitmask)
                .setApn(apnType)
                .setLinkProperties(getLinkProperties(apnType))
                .setApnSetting(apnSetting)
                .build();
+9 −6
Original line number Diff line number Diff line
@@ -315,8 +315,9 @@ public class TelephonyRegistryTest extends TelephonyTest {
                new PreciseDataConnectionState.Builder()
                        .setState(0)
                        .setNetworkType(0)
                        .setApnTypes(0)
                        .setApn("default")
                        .setApnSetting(new ApnSetting.Builder()
                                .setApnTypeBitmask(ApnSetting.TYPE_DEFAULT)
                                .build())
                        .setLinkProperties(new LinkProperties())
                        .setFailCause(0)
                        .build());
@@ -333,8 +334,9 @@ public class TelephonyRegistryTest extends TelephonyTest {
                new PreciseDataConnectionState.Builder()
                        .setState(0)
                        .setNetworkType(0)
                        .setApnTypes(0)
                        .setApn("ims")
                        .setApnSetting(new ApnSetting.Builder()
                                .setApnTypeBitmask(ApnSetting.TYPE_IMS)
                                .build())
                        .setLinkProperties(new LinkProperties())
                        .setFailCause(0)
                        .build());
@@ -362,8 +364,9 @@ public class TelephonyRegistryTest extends TelephonyTest {
                new PreciseDataConnectionState.Builder()
                        .setState(0)
                        .setNetworkType(0)
                        .setApnTypes(0)
                        .setApn("ims")
                        .setApnSetting(new ApnSetting.Builder()
                                .setApnTypeBitmask(ApnSetting.TYPE_IMS)
                                .build())
                        .setLinkProperties(new LinkProperties())
                        .setFailCause(0)
                        .build());