am 99bf4e45: SIP: remove dependency on javax.sip
Merge commit '99bf4e45c4566172189735b34b368b76660ca57a' into gingerbread-plus-aosp * commit '99bf4e45c4566172189735b34b368b76660ca57a': SIP: remove dependency on javax.sip
This commit is contained in:
@@ -1161,7 +1161,7 @@ class SipSessionGroup implements SipListener {
|
||||
.setPort(uri.getPort())
|
||||
.setDisplayName(address.getDisplayName())
|
||||
.build();
|
||||
} catch (InvalidArgumentException e) {
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new SipException("createPeerProfile()", e);
|
||||
} catch (ParseException e) {
|
||||
throw new SipException("createPeerProfile()", e);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package android.net.sip;
|
||||
|
||||
import android.net.sip.ISipSessionListener;
|
||||
import android.net.sip.SessionDescription;
|
||||
import android.net.sip.SipProfile;
|
||||
|
||||
/**
|
||||
|
||||
@@ -502,13 +502,14 @@ public class SipManager {
|
||||
@Override
|
||||
public void onRegistrationFailed(ISipSession session, String errorCode,
|
||||
String message) {
|
||||
mListener.onRegistrationFailed(getUri(session), errorCode, message);
|
||||
mListener.onRegistrationFailed(getUri(session),
|
||||
Enum.valueOf(SipErrorCode.class, errorCode), message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistrationTimeout(ISipSession session) {
|
||||
mListener.onRegistrationFailed(getUri(session),
|
||||
SipErrorCode.TIME_OUT.toString(), "registration timed out");
|
||||
SipErrorCode.TIME_OUT, "registration timed out");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,11 +167,15 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
*
|
||||
* @param port port number of the server
|
||||
* @return this builder object
|
||||
* @throws InvalidArgumentException if the port number is out of range
|
||||
* @throws IllegalArgumentException if the port number is out of range
|
||||
*/
|
||||
public Builder setPort(int port) throws InvalidArgumentException {
|
||||
mUri.setPort(port);
|
||||
return this;
|
||||
public Builder setPort(int port) throws IllegalArgumentException {
|
||||
try {
|
||||
mUri.setPort(port);
|
||||
return this;
|
||||
} catch (InvalidArgumentException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,16 +184,16 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
|
||||
*
|
||||
* @param protocol the protocol string
|
||||
* @return this builder object
|
||||
* @throws InvalidArgumentException if the protocol is not recognized
|
||||
* @throws IllegalArgumentException if the protocol is not recognized
|
||||
*/
|
||||
public Builder setProtocol(String protocol)
|
||||
throws InvalidArgumentException {
|
||||
throws IllegalArgumentException {
|
||||
if (protocol == null) {
|
||||
throw new NullPointerException("protocol cannot be null");
|
||||
}
|
||||
protocol = protocol.toUpperCase();
|
||||
if (!protocol.equals("UDP") && !protocol.equals("TCP")) {
|
||||
throw new InvalidArgumentException(
|
||||
throw new IllegalArgumentException(
|
||||
"unsupported protocol: " + protocol);
|
||||
}
|
||||
mProfile.mProtocol = protocol;
|
||||
|
||||
@@ -40,9 +40,9 @@ public interface SipRegistrationListener {
|
||||
* Called when the registration fails.
|
||||
*
|
||||
* @param localProfileUri the URI string of the SIP profile to register with
|
||||
* @param errorCode error code defined in {@link SipErrorCode}
|
||||
* @param errorCode error code of this error
|
||||
* @param errorMessage error message
|
||||
*/
|
||||
void onRegistrationFailed(String localProfileUri, String errorCode,
|
||||
void onRegistrationFailed(String localProfileUri, SipErrorCode errorCode,
|
||||
String errorMessage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user