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

Commit 5e9632cd authored by Sebastian Achim's avatar Sebastian Achim Committed by Jack Yu
Browse files

Re-add check for metered APNs regardless of IWLAN



While in legacy mode and registered to IWLAN, we need
to check for metered APNs.
Supl request will -NOT- be offloaded to wifi, hence in case of
roaming and data roaming off, user will end up with extra costs

Bug: 143091304
Test: Precondition, In roaming network with roaming disabled in settings
1. Enable flight mode (important)
2. Reboot phone
3. Disable flight mode
4. Wait for phone to connect to wifi and network (IWLAN reported by modem)
5. Unplug the network cable from the router
6. Use Google Chrome and Google Maps.
Result: Data should not be sent over cellular network.

Merged-In: I8cf8fe8f75889029db2c6d4ad945dcc79ab3fed6
Change-Id: I8cf8fe8f75889029db2c6d4ad945dcc79ab3fed6
Signed-off-by: default avatarSebastian Achim <sebastian.1.achim@sony.com>
(cherry picked from commit db5d0dca)
parent 2109a63f
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1381,11 +1381,8 @@ public class DcTracker extends Handler {
        // At this point, if data is not allowed, it must be because of the soft reasons. We
        // should start to check some special conditions that data will be allowed.
        if (!reasons.allowed()) {
            // If the device is on IWLAN, then all data should be unmetered. Check if the transport
            // is WLAN (for AP-assisted mode devices), or RAT equals IWLAN (for legacy mode devices)
            if (mTransportType == AccessNetworkConstants.TRANSPORT_TYPE_WLAN
                    || (mPhone.getTransportManager().isInLegacyMode()
                    && dataRat == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN)) {
            // Check if the transport is WLAN ie wifi (for AP-assisted mode devices)
            if (mTransportType == AccessNetworkConstants.TRANSPORT_TYPE_WLAN) {
                reasons.add(DataAllowedReasonType.UNMETERED_APN);
            // Or if the data is on cellular, and the APN type is determined unmetered by the
            // configuration.