diff options
| -rw-r--r-- | services/java/com/android/server/sip/SipSessionGroup.java | 2 | ||||
| -rw-r--r-- | voip/java/android/net/sip/ISipSession.aidl | 1 | ||||
| -rw-r--r-- | voip/java/android/net/sip/SipManager.java | 5 | ||||
| -rw-r--r-- | voip/java/android/net/sip/SipProfile.java | 18 | ||||
| -rw-r--r-- | voip/java/android/net/sip/SipRegistrationListener.java | 4 |
5 files changed, 17 insertions, 13 deletions
diff --git a/services/java/com/android/server/sip/SipSessionGroup.java b/services/java/com/android/server/sip/SipSessionGroup.java index e72027437e73..06b6ec9397a5 100644 --- a/services/java/com/android/server/sip/SipSessionGroup.java +++ b/services/java/com/android/server/sip/SipSessionGroup.java @@ -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); diff --git a/voip/java/android/net/sip/ISipSession.aidl b/voip/java/android/net/sip/ISipSession.aidl index 1a23527988ea..29fcb32da7b3 100644 --- a/voip/java/android/net/sip/ISipSession.aidl +++ b/voip/java/android/net/sip/ISipSession.aidl @@ -17,7 +17,6 @@ package android.net.sip; import android.net.sip.ISipSessionListener; -import android.net.sip.SessionDescription; import android.net.sip.SipProfile; /** diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java index ccae7f9b249c..149053cedb51 100644 --- a/voip/java/android/net/sip/SipManager.java +++ b/voip/java/android/net/sip/SipManager.java @@ -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"); } } } diff --git a/voip/java/android/net/sip/SipProfile.java b/voip/java/android/net/sip/SipProfile.java index aa2da750500d..1a7d8bf68289 100644 --- a/voip/java/android/net/sip/SipProfile.java +++ b/voip/java/android/net/sip/SipProfile.java @@ -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; diff --git a/voip/java/android/net/sip/SipRegistrationListener.java b/voip/java/android/net/sip/SipRegistrationListener.java index 22488d7ab780..e751e46cc51d 100644 --- a/voip/java/android/net/sip/SipRegistrationListener.java +++ b/voip/java/android/net/sip/SipRegistrationListener.java @@ -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); } |