summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2010-09-16 04:11:32 +0800
committerHung-ying Tyan <tyanh@google.com>2010-09-24 10:06:59 +0800
commit84a357bb6a8005e1c5e924e96a8ecf310e77c47c (patch)
tree7562523105a05d9ac3ca03b333c1aa70e08a3b7b /telephony
parent524a6d8e9bb4df9cec0520ac1d9733642b13e76f (diff)
downloadframeworks_base-84a357bb6a8005e1c5e924e96a8ecf310e77c47c.zip
frameworks_base-84a357bb6a8005e1c5e924e96a8ecf310e77c47c.tar.gz
frameworks_base-84a357bb6a8005e1c5e924e96a8ecf310e77c47c.tar.bz2
Refactoring SIP classes to get ready for API review.
+ replace SipAudioCall and its Listener interfaces with real implementations, + remove SipAudioCallImpl.java, most of it is has become part of SipAudioCall, + add SipSession and its Listener classes to wrap ISipSession and ISipSessionListener, + move SipSessionState to SipSession.State, + make SipManager keep context and remove the context argument from many methods of its, + rename SipManager.getInstance() to newInstance(), + rename constant names for action strings and extra keys to follow conventions, + set thread names for debugging purpose. Change-Id: Ie1790dc0e8f49c06c7fc80d33fec0f673a9c3044
Diffstat (limited to 'telephony')
-rwxr-xr-xtelephony/java/com/android/internal/telephony/sip/SipPhone.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java
index 35aa3b3..372acc2 100755
--- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java
+++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java
@@ -27,7 +27,7 @@ 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;
+import android.net.sip.SipSession;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Looper;
@@ -92,7 +92,7 @@ public class SipPhone extends SipPhoneBase {
foregroundCall = new SipCall();
backgroundCall = new SipCall();
mProfile = profile;
- mSipManager = SipManager.getInstance(context);
+ mSipManager = SipManager.newInstance(context);
// FIXME: what's this for SIP?
//Change the system property
@@ -707,8 +707,8 @@ public class SipPhone extends SipPhoneBase {
void dial() throws SipException {
setState(Call.State.DIALING);
- mSipAudioCall = mSipManager.makeAudioCall(mContext, mProfile,
- mPeer, null, SESSION_TIMEOUT);
+ mSipAudioCall = mSipManager.makeAudioCall(mProfile, mPeer, null,
+ SESSION_TIMEOUT);
mSipAudioCall.setRingbackToneEnabled(false);
mSipAudioCall.setListener(mAdapter);
}
@@ -808,20 +808,20 @@ public class SipPhone extends SipPhoneBase {
if (sipAudioCall.isOnHold()) return Call.State.HOLDING;
int sessionState = sipAudioCall.getState();
switch (sessionState) {
- case SipSessionState.READY_TO_CALL: return Call.State.IDLE;
- case SipSessionState.INCOMING_CALL:
- case SipSessionState.INCOMING_CALL_ANSWERING: return Call.State.INCOMING;
- case SipSessionState.OUTGOING_CALL: return Call.State.DIALING;
- case SipSessionState.OUTGOING_CALL_RING_BACK: return Call.State.ALERTING;
- case SipSessionState.OUTGOING_CALL_CANCELING: return Call.State.DISCONNECTING;
- case SipSessionState.IN_CALL: return Call.State.ACTIVE;
+ case SipSession.State.READY_TO_CALL: return Call.State.IDLE;
+ case SipSession.State.INCOMING_CALL:
+ case SipSession.State.INCOMING_CALL_ANSWERING: return Call.State.INCOMING;
+ case SipSession.State.OUTGOING_CALL: return Call.State.DIALING;
+ case SipSession.State.OUTGOING_CALL_RING_BACK: return Call.State.ALERTING;
+ case SipSession.State.OUTGOING_CALL_CANCELING: return Call.State.DISCONNECTING;
+ case SipSession.State.IN_CALL: return Call.State.ACTIVE;
default:
Log.w(LOG_TAG, "illegal connection state: " + sessionState);
return Call.State.DISCONNECTED;
}
}
- private abstract class SipAudioCallAdapter extends SipAudioCall.Adapter {
+ private abstract class SipAudioCallAdapter extends SipAudioCall.Listener {
protected abstract void onCallEnded(Connection.DisconnectCause cause);
protected abstract void onError(Connection.DisconnectCause cause);