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

Commit 2811f162 authored by Jaikumar Ganesh's avatar Jaikumar Ganesh
Browse files

Add Authentication Type field to the APN settings.

Use auth type to setup data connection.
This value defaults to -1 (unset) to maintain compatibility.
When the value is -1, the auth type gets set to 0 (if no user is specified)
or 3.
Bug: 181700
parent f702f1f3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1669,6 +1669,8 @@ public final class Telephony {

        public static final String NUMERIC = "numeric";

        public static final String AUTH_TYPE = "authtype";

        public static final String TYPE = "type";

        public static final String CURRENT = "current";
+5 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ public class ApnSetting {
    String mmsPort;
    String user;
    String password;
    int authType;
    String[] types;
    int id;
    String numeric;
@@ -38,7 +39,7 @@ public class ApnSetting {

    ApnSetting(int id, String numeric, String carrier, String apn, String proxy, String port,
            String mmsc, String mmsProxy, String mmsPort,
            String user, String password, String[] types) {
            String user, String password, int authType, String[] types) {
        this.id = id;
        this.numeric = numeric;
        this.carrier = carrier;
@@ -50,6 +51,7 @@ public class ApnSetting {
        this.mmsPort = mmsPort;
        this.user = user;
        this.password = password;
        this.authType = authType;
        this.types = types;
    }

@@ -63,7 +65,8 @@ public class ApnSetting {
        .append(", ").append(mmsc)
        .append(", ").append(mmsProxy)
        .append(", ").append(mmsPort)
        .append(", ").append(port);
        .append(", ").append(port)
        .append(", ").append(authType);
        for (String t : types) {
            sb.append(", ").append(t);
        }
+1 −0
Original line number Diff line number Diff line
@@ -556,6 +556,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
                        cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.MMSPORT)),
                        cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.USER)),
                        cursor.getString(cursor.getColumnIndexOrThrow(Telephony.Carriers.PASSWORD)),
                        cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers.AUTH_TYPE)),
                        types);
                result.add(apn);
            } while (cursor.moveToNext());
+5 −3
Original line number Diff line number Diff line
@@ -84,9 +84,11 @@ public class PdpConnection extends DataConnection {
        lastFailCause = FailCause.NONE;
        receivedDisconnectReq = false;

        int authType = (apn.user != null) ? RILConstants.SETUP_DATA_AUTH_PAP_CHAP :
        int authType = apn.authType;
        if (authType == -1) {
            authType = (apn.user != null) ? RILConstants.SETUP_DATA_AUTH_PAP_CHAP :
                RILConstants.SETUP_DATA_AUTH_NONE;

        }
        phone.mCM.setupDataCall(Integer.toString(RILConstants.SETUP_DATA_TECH_GSM),
                Integer.toString(RILConstants.DATA_PROFILE_DEFAULT), apn.apn, apn.user,
                apn.password, Integer.toString(authType),