Merge "Add auth. username in SipProfile." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
65ba2c421c
@@ -49,6 +49,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
private String mDomain;
|
||||
private String mProtocol = UDP;
|
||||
private String mProfileName;
|
||||
private String mAuthUserName;
|
||||
private int mPort = DEFAULT_PORT;
|
||||
private boolean mSendKeepAlive = false;
|
||||
private boolean mAutoRegistration = true;
|
||||
@@ -146,6 +147,18 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
: "sip:" + uriString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the username used for authentication.
|
||||
*
|
||||
* @param name auth. name of the profile
|
||||
* @return this builder object
|
||||
* @hide // TODO: remove when we make it public
|
||||
*/
|
||||
public Builder setAuthUserName(String name) {
|
||||
mProfile.mAuthUserName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the profile. This name is given by user.
|
||||
*
|
||||
@@ -300,6 +313,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
mAutoRegistration = (in.readInt() == 0) ? false : true;
|
||||
mCallingUid = in.readInt();
|
||||
mPort = in.readInt();
|
||||
mAuthUserName = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -314,6 +328,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
out.writeInt(mAutoRegistration ? 1 : 0);
|
||||
out.writeInt(mCallingUid);
|
||||
out.writeInt(mPort);
|
||||
out.writeString(mAuthUserName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -374,6 +389,17 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
return getUri().getUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the username for authentication. If it is null, then the username
|
||||
* should be used in authentication instead.
|
||||
*
|
||||
* @return the auth. username
|
||||
* @hide // TODO: remove when we make it public
|
||||
*/
|
||||
public String getAuthUserName() {
|
||||
return mAuthUserName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the password.
|
||||
*
|
||||
|
||||
@@ -895,7 +895,9 @@ class SipSessionGroup implements SipListener {
|
||||
challengedTransaction, String realm) {
|
||||
return new UserCredentials() {
|
||||
public String getUserName() {
|
||||
return mLocalProfile.getUserName();
|
||||
String username = mLocalProfile.getAuthUserName();
|
||||
return (!TextUtils.isEmpty(username) ? username :
|
||||
mLocalProfile.getUserName());
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
|
||||
Reference in New Issue
Block a user