summaryrefslogtreecommitdiffstats
path: root/voip
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2010-09-02 08:13:01 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-02 08:13:01 -0700
commitdc296b0d4bd6fef8764c10fb4cd59c85bc5186f6 (patch)
treec277e94045a5ec36fe0f8593001a218e9d1ca735 /voip
parent60264b306453a3043442719b970f2edb3f46f51b (diff)
parent95b15c35608fe3ea679c8a478c6cbd841623371e (diff)
downloadframeworks_base-dc296b0d4bd6fef8764c10fb4cd59c85bc5186f6.zip
frameworks_base-dc296b0d4bd6fef8764c10fb4cd59c85bc5186f6.tar.gz
frameworks_base-dc296b0d4bd6fef8764c10fb4cd59c85bc5186f6.tar.bz2
Merge "SipService: reduce the usage of javax.sdp.*." into gingerbread
Diffstat (limited to 'voip')
-rw-r--r--voip/java/android/net/sip/ISipSession.aidl7
-rw-r--r--voip/java/android/net/sip/ISipSessionListener.aidl4
-rw-r--r--voip/java/android/net/sip/SdpSessionDescription.java4
-rw-r--r--voip/java/android/net/sip/SipAudioCall.java4
-rw-r--r--voip/java/android/net/sip/SipAudioCallImpl.java26
-rw-r--r--voip/java/android/net/sip/SipManager.java14
-rw-r--r--voip/java/android/net/sip/SipSessionAdapter.java6
7 files changed, 27 insertions, 38 deletions
diff --git a/voip/java/android/net/sip/ISipSession.aidl b/voip/java/android/net/sip/ISipSession.aidl
index fbcb056..1a23527 100644
--- a/voip/java/android/net/sip/ISipSession.aidl
+++ b/voip/java/android/net/sip/ISipSession.aidl
@@ -115,8 +115,7 @@ interface ISipSession {
* @param sessionDescription the session description of this call
* @see ISipSessionListener
*/
- void makeCall(in SipProfile callee,
- in SessionDescription sessionDescription);
+ void makeCall(in SipProfile callee, String sessionDescription);
/**
* Answers an incoming call with the specified session description. The
@@ -125,7 +124,7 @@ interface ISipSession {
*
* @param sessionDescription the session description to answer this call
*/
- void answerCall(in SessionDescription sessionDescription);
+ void answerCall(String sessionDescription);
/**
* Ends an established call, terminates an outgoing call or rejects an
@@ -143,5 +142,5 @@ interface ISipSession {
*
* @param sessionDescription the new session description
*/
- void changeCall(in SessionDescription sessionDescription);
+ void changeCall(String sessionDescription);
}
diff --git a/voip/java/android/net/sip/ISipSessionListener.aidl b/voip/java/android/net/sip/ISipSessionListener.aidl
index 8570958..c552a57 100644
--- a/voip/java/android/net/sip/ISipSessionListener.aidl
+++ b/voip/java/android/net/sip/ISipSessionListener.aidl
@@ -39,7 +39,7 @@ interface ISipSessionListener {
* @param sessionDescription the caller's session description
*/
void onRinging(in ISipSession session, in SipProfile caller,
- in byte[] sessionDescription);
+ String sessionDescription);
/**
* Called when a RINGING response is received for the INVITE request sent
@@ -55,7 +55,7 @@ interface ISipSessionListener {
* @param sessionDescription the peer's session description
*/
void onCallEstablished(in ISipSession session,
- in byte[] sessionDescription);
+ String sessionDescription);
/**
* Called when the session is terminated.
diff --git a/voip/java/android/net/sip/SdpSessionDescription.java b/voip/java/android/net/sip/SdpSessionDescription.java
index 0c29935..f6ae837 100644
--- a/voip/java/android/net/sip/SdpSessionDescription.java
+++ b/voip/java/android/net/sip/SdpSessionDescription.java
@@ -186,8 +186,8 @@ public class SdpSessionDescription extends SessionDescription {
}
}
- public SdpSessionDescription build() {
- return mSdp;
+ public String build() {
+ return mSdp.toString();
}
}
diff --git a/voip/java/android/net/sip/SipAudioCall.java b/voip/java/android/net/sip/SipAudioCall.java
index 3cdd114..8254543 100644
--- a/voip/java/android/net/sip/SipAudioCall.java
+++ b/voip/java/android/net/sip/SipAudioCall.java
@@ -168,9 +168,9 @@ public interface SipAudioCall {
* Attaches an incoming call to this call object.
*
* @param session the session that receives the incoming call
- * @param sdp the session description of the incoming call
+ * @param sessionDescription the session description of the incoming call
*/
- void attachCall(ISipSession session, SdpSessionDescription sdp)
+ void attachCall(ISipSession session, String sessionDescription)
throws SipException;
/** Ends a call. */
diff --git a/voip/java/android/net/sip/SipAudioCallImpl.java b/voip/java/android/net/sip/SipAudioCallImpl.java
index 5789cd4..a312f83 100644
--- a/voip/java/android/net/sip/SipAudioCallImpl.java
+++ b/voip/java/android/net/sip/SipAudioCallImpl.java
@@ -28,14 +28,6 @@ import android.net.rtp.AudioCodec;
import android.net.rtp.AudioGroup;
import android.net.rtp.AudioStream;
import android.net.rtp.RtpStream;
-import android.net.sip.ISipSession;
-import android.net.sip.SdpSessionDescription;
-import android.net.sip.SessionDescription;
-import android.net.sip.SipAudioCall;
-import android.net.sip.SipManager;
-import android.net.sip.SipProfile;
-import android.net.sip.SipSessionAdapter;
-import android.net.sip.SipSessionState;
import android.net.wifi.WifiManager;
import android.os.Message;
import android.os.RemoteException;
@@ -200,7 +192,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
@Override
public synchronized void onRinging(ISipSession session,
- SipProfile peerProfile, byte[] sessionDescription) {
+ SipProfile peerProfile, String sessionDescription) {
try {
if ((mSipSession == null) || !mInCall
|| !session.getCallId().equals(mSipSession.getCallId())) {
@@ -222,7 +214,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
}
}
- private synchronized void establishCall(byte[] sessionDescription) {
+ private synchronized void establishCall(String sessionDescription) {
stopRingbackTone();
stopRinging();
try {
@@ -238,7 +230,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
@Override
public void onCallEstablished(ISipSession session,
- byte[] sessionDescription) {
+ String sessionDescription) {
establishCall(sessionDescription);
Listener listener = mListener;
if (listener != null) {
@@ -316,10 +308,10 @@ public class SipAudioCallImpl extends SipSessionAdapter
}
public synchronized void attachCall(ISipSession session,
- SdpSessionDescription sdp) throws SipException {
+ String sessionDescription) throws SipException {
mSipSession = session;
- mPeerSd = sdp;
try {
+ mPeerSd = new SdpSessionDescription(sessionDescription);
session.setListener(this);
} catch (Throwable e) {
Log.e(TAG, "attachCall()", e);
@@ -394,12 +386,12 @@ public class SipAudioCallImpl extends SipSessionAdapter
if (audioGroup != null) audioGroup.setMode(AudioGroup.MODE_NORMAL);
}
- private SessionDescription createOfferSessionDescription() {
+ private String createOfferSessionDescription() {
AudioCodec[] codecs = AudioCodec.getSystemSupportedCodecs();
return createSdpBuilder(true, convert(codecs)).build();
}
- private SessionDescription createAnswerSessionDescription() {
+ private String createAnswerSessionDescription() {
try {
// choose an acceptable media from mPeerSd to answer
SdpSessionDescription.AudioCodec codec = getCodec(mPeerSd);
@@ -416,7 +408,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
}
}
- private SessionDescription createHoldSessionDescription() {
+ private String createHoldSessionDescription() {
try {
return createSdpBuilder(false, mCodec)
.addMediaAttribute(AUDIO, "sendonly", (String) null)
@@ -448,7 +440,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
return (mWm.getConnectionInfo().getBSSID() == null) ? false : true;
}
- private SessionDescription createContinueSessionDescription() {
+ private String createContinueSessionDescription() {
return createSdpBuilder(true, mCodec).build();
}
diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java
index 40792b9..700fb4e 100644
--- a/voip/java/android/net/sip/SipManager.java
+++ b/voip/java/android/net/sip/SipManager.java
@@ -298,21 +298,19 @@ public class SipManager {
throw new SipException("Call ID missing in incoming call intent");
}
- byte[] offerSd = getOfferSessionDescription(incomingCallIntent);
+ String offerSd = getOfferSessionDescription(incomingCallIntent);
if (offerSd == null) {
throw new SipException("Session description missing in incoming "
+ "call intent");
}
try {
- SdpSessionDescription sdp = new SdpSessionDescription(offerSd);
-
ISipSession session = mSipService.getPendingSession(callId);
if (session == null) return null;
SipAudioCall call = new SipAudioCallImpl(
context, session.getLocalProfile());
call.setRingtoneEnabled(ringtoneEnabled);
- call.attachCall(session, sdp);
+ call.attachCall(session, offerSd);
call.setListener(listener);
return call;
} catch (Throwable t) {
@@ -329,7 +327,7 @@ public class SipManager {
public static boolean isIncomingCallIntent(Intent intent) {
if (intent == null) return false;
String callId = getCallId(intent);
- byte[] offerSd = getOfferSessionDescription(intent);
+ String offerSd = getOfferSessionDescription(intent);
return ((callId != null) && (offerSd != null));
}
@@ -351,8 +349,8 @@ public class SipManager {
* @return the offer session description or null if the intent does not
* have it
*/
- public static byte[] getOfferSessionDescription(Intent incomingCallIntent) {
- return incomingCallIntent.getByteArrayExtra(OFFER_SD_KEY);
+ public static String getOfferSessionDescription(Intent incomingCallIntent) {
+ return incomingCallIntent.getStringExtra(OFFER_SD_KEY);
}
/**
@@ -365,7 +363,7 @@ public class SipManager {
* @hide
*/
public static Intent createIncomingCallBroadcast(String action,
- String callId, byte[] sessionDescription) {
+ String callId, String sessionDescription) {
Intent intent = new Intent(action);
intent.putExtra(CALL_ID_KEY, callId);
intent.putExtra(OFFER_SD_KEY, sessionDescription);
diff --git a/voip/java/android/net/sip/SipSessionAdapter.java b/voip/java/android/net/sip/SipSessionAdapter.java
index cfb71d7..770d4eb 100644
--- a/voip/java/android/net/sip/SipSessionAdapter.java
+++ b/voip/java/android/net/sip/SipSessionAdapter.java
@@ -26,14 +26,14 @@ public class SipSessionAdapter extends ISipSessionListener.Stub {
}
public void onRinging(ISipSession session, SipProfile caller,
- byte[] sessionDescription) {
+ String sessionDescription) {
}
public void onRingingBack(ISipSession session) {
}
- public void onCallEstablished(
- ISipSession session, byte[] sessionDescription) {
+ public void onCallEstablished(ISipSession session,
+ String sessionDescription) {
}
public void onCallEnded(ISipSession session) {