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

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

Merge "Fixed that emergency APN is a duplicate in APN list"

am: 1e7b03ba

Change-Id: I671fb4b9af552e5cebcecc5b260b3546c8c5dd6d
parents cab1f8ab 1e7b03ba
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -3930,7 +3930,10 @@ public class DcTracker extends Handler {


            // If all of the APN settings cannot handle emergency, we add the emergency APN to the
            // If all of the APN settings cannot handle emergency, we add the emergency APN to the
            // list explicitly.
            // list explicitly.
            if (!mAllApnSettings.contains(mEmergencyApn)) {
                mAllApnSettings.add(mEmergencyApn);
                mAllApnSettings.add(mEmergencyApn);
                log("Adding emergency APN : " + mEmergencyApn);
            }
        }
        }
    }
    }


+2 −9
Original line number Original line Diff line number Diff line
@@ -97,7 +97,6 @@ import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Arrays;
import java.util.List;


public class DcTrackerTest extends TelephonyTest {
public class DcTrackerTest extends TelephonyTest {


@@ -108,8 +107,6 @@ public class DcTrackerTest extends TelephonyTest {
            "mobile_ims,11,0,2,60000,true", "mobile_cbs,12,0,2,60000,true",
            "mobile_ims,11,0,2,60000,true", "mobile_cbs,12,0,2,60000,true",
            "mobile_ia,14,0,2,-1,true", "mobile_emergency,15,0,2,-1,true"};
            "mobile_ia,14,0,2,-1,true", "mobile_emergency,15,0,2,-1,true"};


    private final static List<String> sApnTypes = Arrays.asList(
            "default", "mms", "cbs", "fota", "supl", "ia", "emergency", "dun", "hipri", "ims");
    private static final int LTE_BEARER_BITMASK = 1 << (ServiceState.RIL_RADIO_TECHNOLOGY_LTE - 1);
    private static final int LTE_BEARER_BITMASK = 1 << (ServiceState.RIL_RADIO_TECHNOLOGY_LTE - 1);
    private static final int EHRPD_BEARER_BITMASK =
    private static final int EHRPD_BEARER_BITMASK =
            1 << (ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD - 1);
            1 << (ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD - 1);
@@ -137,14 +134,10 @@ public class DcTrackerTest extends TelephonyTest {
    @Mock
    @Mock
    IBinder mBinder;
    IBinder mBinder;
    @Mock
    @Mock
    NetworkRequest mNetworkRequest;
    @Mock
    SubscriptionInfo mSubscriptionInfo;
    SubscriptionInfo mSubscriptionInfo;
    @Mock
    @Mock
    ApnContext mApnContext;
    ApnContext mApnContext;
    @Mock
    @Mock
    ApnSetting mApnSetting;
    @Mock
    DataConnection mDataConnection;
    DataConnection mDataConnection;
    @Mock
    @Mock
    PackageManagerService mMockPackageManagerInternal;
    PackageManagerService mMockPackageManagerInternal;
@@ -367,7 +360,7 @@ public class DcTrackerTest extends TelephonyTest {
                    });
                    });


                    mc.addRow(new Object[]{
                    mc.addRow(new Object[]{
                            2166,                   // id
                            2167,                   // id
                            FAKE_PLMN,              // numeric
                            FAKE_PLMN,              // numeric
                            "b-mobile for Nexus",   // name
                            "b-mobile for Nexus",   // name
                            FAKE_APN5,              // apn
                            FAKE_APN5,              // apn
@@ -622,7 +615,7 @@ public class DcTrackerTest extends TelephonyTest {
        result.status = 0x10004;
        result.status = 0x10004;


        // Simulate RIL fails the data call setup
        // Simulate RIL fails the data call setup
        mSimulatedCommands.setDataCallResult(false, result);
        mSimulatedCommands.setDataCallResult(true, result);


        DataConnectionReasons dataConnectionReasons = new DataConnectionReasons();
        DataConnectionReasons dataConnectionReasons = new DataConnectionReasons();
        boolean allowed = isDataAllowed(dataConnectionReasons);
        boolean allowed = isDataAllowed(dataConnectionReasons);