diff --git a/telephony/java/com/android/internal/telephony/sip/SipCallBase.java b/telephony/java/com/android/internal/telephony/sip/SipCallBase.java index e7eda4f22f341..7e407b2122c4f 100644 --- a/telephony/java/com/android/internal/telephony/sip/SipCallBase.java +++ b/telephony/java/com/android/internal/telephony/sip/SipCallBase.java @@ -26,7 +26,6 @@ import android.net.sip.SipManager; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import javax.sip.SipException; abstract class SipCallBase extends Call { private static final int MAX_CONNECTIONS_PER_CALL = 5; diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java index bf1b93937375c..fd90610f1d612 100755 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -24,6 +24,7 @@ import android.net.rtp.AudioGroup; import android.net.rtp.AudioStream; import android.net.sip.SipAudioCall; import android.net.sip.SipErrorCode; +import android.net.sip.SipException; import android.net.sip.SipManager; import android.net.sip.SipProfile; import android.net.sip.SipSessionState; @@ -67,8 +68,6 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.List; -import javax.sip.SipException; - /** * {@hide} */ diff --git a/voip/java/android/net/sip/SipAudioCall.java b/voip/java/android/net/sip/SipAudioCall.java index 02f82b309739b..39083a5b08b2d 100644 --- a/voip/java/android/net/sip/SipAudioCall.java +++ b/voip/java/android/net/sip/SipAudioCall.java @@ -20,8 +20,6 @@ import android.net.rtp.AudioGroup; import android.net.rtp.AudioStream; import android.os.Message; -import javax.sip.SipException; - /** * Interface for making audio calls over SIP. * @hide diff --git a/voip/java/android/net/sip/SipAudioCallImpl.java b/voip/java/android/net/sip/SipAudioCallImpl.java index 2e2ca5bef3153..67ba97fb43325 100644 --- a/voip/java/android/net/sip/SipAudioCallImpl.java +++ b/voip/java/android/net/sip/SipAudioCallImpl.java @@ -43,7 +43,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import javax.sdp.SdpException; -import javax.sip.SipException; /** * Class that handles an audio call over SIP. diff --git a/voip/java/android/net/sip/SipException.java b/voip/java/android/net/sip/SipException.java new file mode 100644 index 0000000000000..d615342b062b2 --- /dev/null +++ b/voip/java/android/net/sip/SipException.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.net.sip; + +/** + * @hide + */ +public class SipException extends Exception { + public SipException() { + } + + public SipException(String message) { + super(message); + } + + public SipException(String message, Throwable cause) { + // we want to eliminate the dependency on javax.sip.SipException + super(message, ((cause instanceof javax.sip.SipException) + && (cause.getCause() != null)) + ? cause.getCause() + : cause); + } +} diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java index beec8fe0c1842..ccae7f9b249cc 100644 --- a/voip/java/android/net/sip/SipManager.java +++ b/voip/java/android/net/sip/SipManager.java @@ -25,7 +25,6 @@ import android.os.RemoteException; import android.os.ServiceManager; import java.text.ParseException; -import javax.sip.SipException; /** * The class provides API for various SIP related tasks. Specifically, the API @@ -501,15 +500,15 @@ public class SipManager { } @Override - public void onRegistrationFailed(ISipSession session, String className, + public void onRegistrationFailed(ISipSession session, String errorCode, String message) { - mListener.onRegistrationFailed(getUri(session), className, message); + mListener.onRegistrationFailed(getUri(session), errorCode, message); } @Override public void onRegistrationTimeout(ISipSession session) { mListener.onRegistrationFailed(getUri(session), - SipException.class.getName(), "registration timed out"); + SipErrorCode.TIME_OUT.toString(), "registration timed out"); } } }