Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99bf4e45 authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

SIP: remove dependency on javax.sip

and change errorCodeString to errorCode in
SipRegistrationListener.onRegistrationFailed().

Change-Id: Id9618f5a4b0effaed04f8b0dc60347499d9e4501
parent 5dde95b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.net.sip;

import android.net.sip.ISipSessionListener;
import android.net.sip.SessionDescription;
import android.net.sip.SipProfile;

/**
+3 −2
Original line number Diff line number Diff line
@@ -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");
        }
    }
}
+11 −7
Original line number Diff line number Diff line
@@ -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 {
        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;
+2 −2
Original line number Diff line number Diff line
@@ -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);
}