summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2010-07-28 10:24:55 +0800
committerChung-yih Wang <cywang@google.com>2010-07-28 17:45:21 +0800
commit485d613b667f7698370fe9e5fcabc6d2ad8e97cb (patch)
treee94c001c07287210a887a872661969b0734a985a
parent3fe4a16d8fa091357d5adf2a32d5d64edbf08865 (diff)
downloadandroid_external_nist-sip-485d613b667f7698370fe9e5fcabc6d2ad8e97cb.tar.gz
android_external_nist-sip-485d613b667f7698370fe9e5fcabc6d2ad8e97cb.tar.bz2
android_external_nist-sip-485d613b667f7698370fe9e5fcabc6d2ad8e97cb.zip
Add the missing functions for compatibility.
+change the default incoming call intent to Phone2. Change-Id: Ifd3585a5c1d2484258261650422d66334664776e
-rw-r--r--settings/com/android/settings/sip/SipSettings.java2
-rw-r--r--src/android/net/rtp/AudioCodec.java21
2 files changed, 22 insertions, 1 deletions
diff --git a/settings/com/android/settings/sip/SipSettings.java b/settings/com/android/settings/sip/SipSettings.java
index b7c26ba..289772e 100644
--- a/settings/com/android/settings/sip/SipSettings.java
+++ b/settings/com/android/settings/sip/SipSettings.java
@@ -70,7 +70,7 @@ public class SipSettings extends PreferenceActivity {
private static final String UNREGISTERED = "NOT REGISTERED";
public static final String INCOMING_CALL_ACTION =
- "com.android.sip.demo.SipMain";
+ "com.android.phone.SIP_INCOMING_CALL";
private static final int REQUEST_ADD_OR_EDIT_SIP_PROFILE = 1;
diff --git a/src/android/net/rtp/AudioCodec.java b/src/android/net/rtp/AudioCodec.java
index 0b43e89..242ad58 100644
--- a/src/android/net/rtp/AudioCodec.java
+++ b/src/android/net/rtp/AudioCodec.java
@@ -20,6 +20,27 @@ public class AudioCodec {
public static final AudioCodec ULAW = new AudioCodec("PCMU", 8000, 160, 0);
public static final AudioCodec ALAW = new AudioCodec("PCMA", 8000, 160, 8);
+ /**
+ * Returns system supported codecs.
+ */
+ public static AudioCodec[] getSystemSupportedCodecs() {
+ return new AudioCodec[] {AudioCodec.ULAW, AudioCodec.ALAW};
+ }
+
+ /**
+ * Returns the codec instance if it is supported by the system.
+ *
+ * @param name name of the codec
+ * @return the matched codec or null if the codec name is not supported by
+ * the system
+ */
+ public static AudioCodec getSystemSupportedCodec(String name) {
+ for (AudioCodec codec : getSystemSupportedCodecs()) {
+ if (codec.name.equals(name)) return codec;
+ }
+ return null;
+ }
+
public final String name;
public final int sampleRate;
public final int sampleCount;