From 53eb13ce0a05426ceed03465ed37f7f3587eb4f4 Mon Sep 17 00:00:00 2001 From: Ye Jingjing Date: Mon, 19 Mar 2012 14:18:44 +0800 Subject: Set AuthType to NONE if username of APN is not set When APN is edited, if authType and username are both not set, authType should be set to NONE before setup of data call. The code today checks mApn.user for NULL, but if user has edited APN the mApn.user field will be set to an empty string. Change the check of mApn.user to also take care of this case. Change-Id: I0e49247d46e1ba93da6dd951bbb75acc63fac73f --- .../java/com/android/internal/telephony/gsm/GsmDataConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'telephony') diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java index fec0158..df3278b 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java @@ -91,8 +91,8 @@ public class GsmDataConnection extends DataConnection { int authType = mApn.authType; if (authType == -1) { - authType = (mApn.user != null) ? RILConstants.SETUP_DATA_AUTH_PAP_CHAP : - RILConstants.SETUP_DATA_AUTH_NONE; + authType = TextUtils.isEmpty(mApn.user) ? RILConstants.SETUP_DATA_AUTH_NONE + : RILConstants.SETUP_DATA_AUTH_PAP_CHAP; } String protocol; -- cgit v1.1