Loading voip/java/android/net/sip/SipProfile.java +26 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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. * Loading Loading @@ -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 Loading @@ -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 Loading Loading @@ -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. * Loading voip/java/com/android/server/sip/SipSessionGroup.java +3 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading Loading
voip/java/android/net/sip/SipProfile.java +26 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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. * Loading Loading @@ -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 Loading @@ -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 Loading Loading @@ -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. * Loading
voip/java/com/android/server/sip/SipSessionGroup.java +3 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading