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
This commit is contained in:
Ye Jingjing
2012-03-19 14:18:44 +08:00
committed by Robert Greenwalt
parent 70c8723e63
commit 53eb13ce0a

View File

@@ -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;