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

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

Merge "Fixed incorrect data network type when device is on IWLAN" am: e8eb9673

am: cfd6493b

Change-Id: Ic611ac2efb3b56fef27f6ba441b22c58eca744a0
parents a9730195 cfd6493b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1569,6 +1569,17 @@ public class ServiceState implements Parcelable {
    /** @hide */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public @TelephonyManager.NetworkType int getDataNetworkType() {
        final NetworkRegistrationState iwlanRegState = getNetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WLAN);
        if (iwlanRegState != null
                && iwlanRegState.getRegState() == NetworkRegistrationState.REG_STATE_HOME) {
            // If the device is on IWLAN, return IWLAN as the network type. This is to simulate the
            // behavior of legacy mode device. In the future caller should use
            // getNetworkRegistrationState() to retrieve the actual data network type on cellular
            // or on IWLAN.
            return iwlanRegState.getAccessNetworkTechnology();
        }

        final NetworkRegistrationState regState = getNetworkRegistrationState(
                NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN);
        if (regState != null) {