From 2811f1625ebdb7f7483b8b866694474f89112d8c Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Mon, 26 Oct 2009 13:11:55 -0700 Subject: 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 --- telephony/java/com/android/internal/telephony/gsm/ApnSetting.java | 7 +++++-- .../android/internal/telephony/gsm/GsmDataConnectionTracker.java | 1 + .../java/com/android/internal/telephony/gsm/PdpConnection.java | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'telephony') diff --git a/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java b/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java index dc6f92d..8d807fd 100644 --- a/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java +++ b/telephony/java/com/android/internal/telephony/gsm/ApnSetting.java @@ -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); } diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index ffd6dd3..d014a7e 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -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()); diff --git a/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java b/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java index 224419e..cb85002 100644 --- a/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java +++ b/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java @@ -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 : - RILConstants.SETUP_DATA_AUTH_NONE; - + 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), -- cgit v1.1