summaryrefslogtreecommitdiffstats
path: root/voip/java/android
diff options
context:
space:
mode:
authorrepo sync <chiachi@android.com>2010-09-02 09:26:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-02 09:26:24 -0700
commiteaa511fd03e01bdae2bc09e2f29b51f76f64e0d7 (patch)
treec3e8d2e95c9b567b224a3828c2247992fb34b82c /voip/java/android
parent0525f95bb11765e074d4f67b90bd0fc6aa34d6b3 (diff)
parent3d67c5688f4855acbfd6de103b278ceee74a4451 (diff)
downloadframeworks_base-eaa511fd03e01bdae2bc09e2f29b51f76f64e0d7.zip
frameworks_base-eaa511fd03e01bdae2bc09e2f29b51f76f64e0d7.tar.gz
frameworks_base-eaa511fd03e01bdae2bc09e2f29b51f76f64e0d7.tar.bz2
Merge "resolved conflicts for merge of 12eaf9d5 to master"
Diffstat (limited to 'voip/java/android')
-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 b8ac6d7..bd2c1cd 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.os.Message;
import android.os.RemoteException;
import android.os.Vibrator;
@@ -196,7 +188,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())) {
@@ -218,7 +210,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
}
}
- private synchronized void establishCall(byte[] sessionDescription) {
+ private synchronized void establishCall(String sessionDescription) {
stopRingbackTone();
stopRinging();
try {
@@ -234,7 +226,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
@Override
public void onCallEstablished(ISipSession session,
- byte[] sessionDescription) {
+ String sessionDescription) {
establishCall(sessionDescription);
Listener listener = mListener;
if (listener != null) {
@@ -312,10 +304,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);
@@ -390,12 +382,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);
@@ -412,7 +404,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
}
}
- private SessionDescription createHoldSessionDescription() {
+ private String createHoldSessionDescription() {
try {
return createSdpBuilder(false, mCodec)
.addMediaAttribute(AUDIO, "sendonly", (String) null)
@@ -422,7 +414,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
}
}
- 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) {