248 Commits

Author SHA1 Message Date
Conley Owens
53ad2c7fe2 am 0793586b: am f8c1f129: am e1d27154: am f87743e7: Merge "Prevent NullPointerException cases while using SipService."
* commit '0793586bf8f4dce71d0b4d7ff2f212129b3f76fe':
  Prevent NullPointerException cases while using SipService.
2011-08-02 13:32:26 -07:00
Conley Owens
0793586bf8 am f8c1f129: am e1d27154: am f87743e7: Merge "Prevent NullPointerException cases while using SipService."
* commit 'f8c1f1298ac3ede518c8d29eeb6719746c6afaf0':
  Prevent NullPointerException cases while using SipService.
2011-08-02 13:30:51 -07:00
Masahiko Endo
25ccbb97ff Prevent NullPointerException cases while using SipService.
Some SipService methods may return null, in such cases like no Wi-Fi
connection. Added minimum check to prevent NullPointerExceptions.

Change-Id: Ia7fae57ee893f2564cbfdedb6dc614938ab60ff7
Signed-off-by: Masahiko Endo <masahiko.endo@gmail.com>
2011-08-01 16:24:59 +09:00
Eric Laurent
5fb3ba60af Issue 3370834: No Echo canceler for SIP
Added detection of platfrom AEC in AudioGroup. If an AEC
is present, the SIP stack will use it, otherwise the echo suppressor
of the stack will be used.

Change-Id: I4aa45a8868466120f5f9fae71b491fe4ae1162c2
2011-07-27 09:33:22 -07:00
repo sync
307f15faaf Add REFER handling.
Handle REFER requests including REFER with Replaces header.

bug:4958680
Change-Id: I96df95097b78bed67ab8abd309a1e57a45c6bc2f
2011-07-13 04:12:28 +08:00
Hung-ying Tyan
3eeb1a98f9 Merge "Keep last known keepalive interval to avoid duplicate effort." 2011-07-04 20:37:33 -07:00
Hung-ying Tyan
9324e04dcf Merge "Do not hold wifi lock when SIP is also available over mobile network." 2011-07-03 20:01:55 -07:00
Hung-ying Tyan
f8c34ad3ef Merge "Do not keep alive for re-established call." 2011-07-03 19:53:35 -07:00
Hung-ying Tyan
9edfa10757 Keep last known keepalive interval to avoid duplicate effort.
The current implementation always starts with default minimum interval when
the measurement process starts. By keeping last known good interval, we can
save the time in re-measurement.

Change-Id: I8f1720acafaa7e101855fe0c66d5c7b0e578e0d7
2011-07-01 21:20:36 +08:00
Hung-ying Tyan
8ba4566c01 Do not keep alive for re-established call.
Only need to keep alive for caller in a newly established call.

Change-Id: I36f9d9499c806c8701e3b78555de399b00593be8
2011-07-01 20:26:48 +08:00
Hung-ying Tyan
f89654dd28 Do not hold wifi lock when SIP is also available over mobile network.
Bug: 3111564
Change-Id: Ifc76e5c378d620e40ce4adf6ffa20807e9750fdb
2011-07-01 19:25:46 +08:00
Hung-ying Tyan
a6cec8feed Synchronize SipWakeupTimer.onReceive()
to fix the race of two threads that change mPendingIntent; one assigns a new one
and the other nullifies it.

Change-Id: I5e01f83ea1ac437811d2073839adef9bd0a30ec9
2011-06-30 18:17:27 +08:00
Hung-ying Tyan
129d0b08fd Make NAT port timeout measurement more flexible.
In two ways:
(1) When there's a session timeout, restart the measurement at a later time
    instead of just stalling.
(2) When there's a port change, do not re-measure the interval if the current
    interval works well in the past. We keep success count and decrement it
    by half when there's a port change. When the count is below a threshold,
    we restart the measurement process.

Change-Id: I7256464435a5e2d2a239bfccaa004e9ceb1d9ce5
2011-06-30 14:37:24 +08:00
Hung-ying Tyan
99705b52ec Record external IP and port from SIP responses
and use them to create the contact header when sending OK response for INVITE.

Bug: 3461707
Change-Id: I5b254618f4920cf10a1460631bcd336778f344ec
2011-06-28 20:05:53 +08:00
repo sync
2093561a58 Support INVITE w/o SDP.
bug:3326873

Change-Id: Ie29d2c61b237fee2d8637f4ba3d293a22469cced
2011-06-28 19:45:10 +08:00
Hung-ying Tyan
233718c3c5 Start keepalive process for the caller of a SIP call
so that the callee can send signals (on-hold or bye) back to the caller.
Without the keepalive, the NAT port for the caller will be timed out during the
call. And the signals will be dropped by the NAT device.

Change-Id: I21848d73469045b2ed9e7281556ab184c594c362
2011-06-27 19:33:24 +08:00
repo sync
1aceda35cc Support Invite w/ Replaces request.
bug:3326870
Change-Id: Idbfbe7e3cc6ba83874d42bfb7d149866f454e70a
2011-06-27 16:20:28 +08:00
Hung-ying Tyan
e65f3a896f Restart NAT port timeout measurement when keepalive fails and other fixes
Misc keepalive fixes including:
+ Restart NAT port timeout measurement when keepalive fails. The max interval
  is set to the current keepalive interval.
+ When exception occurs during sending a keepalive, restarts registration.
+ When exception occurs during measurement, retry for a limited times before
  giving up.

Change-Id: I7aa787a5ec7c4c9b4334aa1017371d9049b3520c
2011-06-24 15:28:15 +08:00
Hung-ying Tyan
4af085ff26 Execute all the due wakeup events in SipWakeupTimer.
Events are sorted by periods. So events of larger periods may have trigger
time (i.e., when the event should be processed) earlier than the ones of smaller
periods. So need to scan the whole queue looking for due events. The scan takes
O(n) time but we expect the queue size to be small.

Change-Id: I08bd3bd9d4bb8decb78f3c91c943396463ca023a
2011-06-23 19:23:13 +08:00
Hung-ying Tyan
12750701d0 Keep the keepalive process going after NAT port is changed.
This is a regression from the CL that makes the keep-alive process a reusable
component.

Change-Id: I1d580588e9e303c532bf620056fc0fe88a2fdcda
2011-06-23 18:23:09 +08:00
Hung-ying Tyan
4a267a9158 Move the keepalive process to SipSessionImpl and make it reusable.
Reuse the new component in the original keepalive process and the NAT port
mapping timeout measurement process.

This is the foundation for fixing the following bug.

Bug: 3464181

Change-Id: If7e951c000503fa64843942ad062c4d853e20c8d
2011-06-23 11:41:37 +08:00
Hung-ying Tyan
ac320b2245 Merge "Move WakeupTimer out of SipService." 2011-06-15 03:17:50 -07:00
Hung-ying Tyan
5621554033 Move WakeupTimer out of SipService.
This is to prepare to move keepalive process to SipSessionGroup before fixing
the following bug.
Bug: 3464181

Change-Id: I57d8f6effad76706b5a76e1269c53d558db88ae4
2011-06-14 17:46:48 +08:00
repo sync
c133781723 Fix the issue of onNetwork in UI thread.
bug:458435

This will temporarily start a thread for answering calls, we are
going to add a handler thread to handle this soon.

Change-Id: I9079038d671e1b1631c6e663fc2c3de297d97428
2011-06-13 17:46:41 +08:00
Chung-yih Wang
bb0a989c17 Add KeepAlive Interval Measurement.
Change-Id: Id5ea2fcfa0bcd45198e773a5842d39eacc8ae400
2011-06-09 18:19:07 +08:00
Dima Zavin
34bb419e59 update for new audio.h header location
Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
2011-05-12 14:09:57 -07:00
Andreas Huber
4b3913a3e4 Squashed commit of the following:
commit c80992e419ed567abef451042f09c4958534b90d
Author: Andreas Huber <andih@google.com>
Date:   Wed May 11 14:00:07 2011 -0700

    Support for the mp3 audio decoder as a software OMX component.

    Change-Id: I66e10c4d0be4c3aecdef1c21b15a2c7359ceb807

commit a358d0e1bf2a88897887445f42ccdda0f5f2f528
Author: Andreas Huber <andih@google.com>
Date:   Wed May 11 13:11:23 2011 -0700

    Support for G.711 alaw and mulaw decoders as software OMX components

    Change-Id: Ia5c76c02cb83a9f94ce39a27b2251e5880218f03

commit 79088b9c9a5c8b8c97ea66cb4f90a2b0f0d34553
Author: Andreas Huber <andih@google.com>
Date:   Thu May 5 15:43:32 2011 -0700

    Instead of using an RGB surface and conversion yuv420->rgb565

    convert from OMX_COLOR_FormatYUV420Planar to HAL_PIXEL_FORMAT_YV12 instead.

    Change-Id: I8c4fc3c54c963f0d4ba6377f3c4ab4e0013152e5
    related-to-bug: 4394005

commit 69469d3bd84425777b11b9fc938c5e0c61af26a7
Author: Andreas Huber <andih@google.com>
Date:   Tue May 10 15:46:42 2011 -0700

    voip mustn't link against libstagefright.so

    Change-Id: I4d0ba9a8b9dc9380b792a1bd04bcda231964862c

commit 2a9a9eeeeeb36ae3a9e680469c3016d509ff08c3
Author: Andreas Huber <andih@google.com>
Date:   Tue May 10 14:37:10 2011 -0700

    Remove most non-OMX software decoders by default

    Change-Id: Ic56514bc1b56b8fa952e8c4a164ea7379ecb69d0

commit a4de62c37b335c318217765403a9fb282b20a216
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 16:50:02 2011 -0700

    Conditionally build the old-style software decoders.

    Change-Id: I5de609e1d76c92d26d6eb81d1551462258f3f15f

commit 5d8b039f9449dc3dad1e77c42c80cc0b54b0c846
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 16:13:12 2011 -0700

    Support for MPEG4 and H.263 video decoders as soft OMX components.

    Change-Id: I5e3a4835afab89f98e3aa128d013628f5830eafe

commit b25a1bfbeb0ff6e62e1cc694ce2599c91489c7d0
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 11:49:10 2011 -0700

    Boost Soft OMX thread priority, fix timestamp handling in vorbis Soft OMX decoder.

    Change-Id: I68d26d4999f06fcc451d69e5303663fab0cba9e8

commit c0574362f8dc3319ce84d981097867062a698527
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 11:28:53 2011 -0700

    Support for the AMR decoders (NB and WB) as Soft OMX components.

    Change-Id: Ia565f59833fb52653e23f26536e7e41fc329a754

commit 3e5575a8f0e27a490cb7bde77bd9456087837f08
Author: Andreas Huber <andih@google.com>
Date:   Wed May 4 13:41:25 2011 -0700

    Signal an error if the aac decoder failed to initialize from codec specific data.

    Change-Id: I01da7831bdf722edd7d6dc5974486daa2cf2b209
    related-to-bug: 4272179

commit f94aeaa9886e772ff4823e671ed237096649f4af
Author: Andreas Huber <andih@google.com>
Date:   Tue May 3 13:07:38 2011 -0700

    Software OMX nodes don't (yet?) support native_window mode.

    Change-Id: I7d9ca9164ef4abf66b573ca21dba12d672f8b12d

commit eefdfabac8dc659e00daa56da69aea705c49cb67
Author: Andreas Huber <andih@google.com>
Date:   Tue May 3 12:57:16 2011 -0700

    Fixing the OMX tests to refer to appropriate files from test content.

    Change-Id: I5b61c3498749bfb876abbd3946a5132356e3f6ff

commit f31b7326aef14b6a1b7946520a9688f092e844d5
Author: Andreas Huber <andih@google.com>
Date:   Tue May 3 11:08:38 2011 -0700

    Soft OMX components are now dynamiclly loaded/unloaded, not directly linked against.

    Change-Id: I1e2ecfbfab67a8869886f738eaf0c7b3c948b6d9

commit b7f0343879e4df06f0a1c9bfece24df557954e2f
Author: Andreas Huber <andih@google.com>
Date:   Mon May 2 15:58:36 2011 -0700

    Support for the AVC software decoder as an OMX component.

    Change-Id: I13c12df435ba4afbd968a9fc659f66b91c818bc2

commit 5bb9e616d6c8e1b13d531fe996b9a9affdfb2977
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 12:05:37 2011 -0700

    Fix Vorbis OMX decoder's component role.

    Change-Id: I5e871e5e11b3f951c93590210e63fd7987c467b5

commit 089c91f2333062e196c7afd5fb0ca914878aa474
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 12:05:18 2011 -0700

    Support vorbis_decoder OMX testing.

    Change-Id: I1985be178a12ae3f8768bc72067d9236238be170

commit 56e241fa36fc37219bc536b823bdc2ab82dc1fad
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 12:01:46 2011 -0700

    SoftVorbis OMX component now respects the number of valid frames per page.

    Change-Id: I82a117a064d9b083fc58a54ad900a987a763ef03

commit fcd618ec520c376fdb78f4cbb44b8d9f5d213e2b
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 10:59:38 2011 -0700

    Support for the vorbis audio decoder as a soft OMX component.

    Change-Id: Iaeb057e58ca306d3dce205c0445b74d5aefef492

commit d1fcc3203fc8003ad79c6e96b3a1fc4261743f16
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 10:07:50 2011 -0700

    VPX decoder now properly resizes buffers after a port settings change.

    Change-Id: I110749a31b6cba087891d8e5dfe420830bdbf831

commit 35c7168243cb69849d88911144a2c7fdfed5c54e
Author: Andreas Huber <andih@google.com>
Date:   Thu Apr 28 13:23:34 2011 -0700

    Support for the VPX video decoder as a Software OMX component.

    Change-Id: Ic345add2d6d768d4af631160153f2e9b97fcea71

commit 923b2534b4211fc5405377b5190bfa6f2dd27f32
Author: Andreas Huber <andih@google.com>
Date:   Thu Apr 28 11:34:40 2011 -0700

    Table-based registration of soft omx components.

    Change-Id: I7f45f0fa5b3a7950776e69c66349731f7674e937

commit 04a88f3edb2266a463da9c4481b80178be460902
Author: Andreas Huber <andih@google.com>
Date:   Thu Apr 28 11:22:31 2011 -0700

    Apparently OMX_GetParameter is valid in any state other than OMX_StateInvalid

    OMX_SetParameter is still constrained to OMX_StateLoaded or a disabled port.

    Change-Id: I1032d7cf4011982d306aa369d4158a82830d26fb

commit 9d70ca68445e7c40f5c9b2d12466e468f514de88
Author: Andreas Huber <andih@google.com>
Date:   Wed Apr 27 15:03:18 2011 -0700

    Use the new soft OMX aac decoder for HTTP live playback.

    Change-Id: Ifbcfb732a9edb855cb46b49f6d0ac942170ee28f

commit 213fe4a10ea93cce08e8622dc3908053f29878a1
Author: Andreas Huber <andih@google.com>
Date:   Tue Apr 12 16:39:45 2011 -0700

    Foundation for supporting software decoders as OMX components

    Change-Id: I7fdab256563b35d1d090617abaea9a26b198d816

Change-Id: I83e9236beed4af985d10333c203f065df9e09a42
2011-05-11 14:24:58 -07:00
Scott Main
b8df57d876 am d81214da: am a7a9c4cb: am 46524f83: Merge "docs: add package description for RTP" into honeycomb-mr1
* commit 'd81214dae45a4b38919296af41bf756e3931675a':
  docs: add package description for RTP
2011-05-05 18:04:28 -07:00
Scott Main
d81214dae4 am a7a9c4cb: am 46524f83: Merge "docs: add package description for RTP" into honeycomb-mr1
* commit 'a7a9c4cbbc2315a59ad27b43c83c66e272dcc2f2':
  docs: add package description for RTP
2011-05-05 18:02:47 -07:00
Scott Main
de9acb76d9 docs: add package description for RTP
Change-Id: I02c181a48101be288fb4aabf497f573f00038f90
2011-05-05 17:32:01 -07:00
Dima Zavin
24fc2fb1c5 audio/media: convert to using the audio HAL and new audio defs
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-27 13:10:10 -07:00
Eric Laurent
d8cbd16659 am 7a492a9a: am b7a76e84: am a482d83c: Merge "Issue 4157048: mic gain for VoIP/SIP calls." into gingerbread
* commit '7a492a9ad42947a3a7b777b0eb6eec56f5bb942b':
  Issue 4157048: mic gain for VoIP/SIP calls.
2011-04-05 10:27:06 -07:00
Eric Laurent
7a492a9ad4 am b7a76e84: am a482d83c: Merge "Issue 4157048: mic gain for VoIP/SIP calls." into gingerbread
* commit 'b7a76e84fde7fe534d46aaaa71e3224798354009':
  Issue 4157048: mic gain for VoIP/SIP calls.
2011-04-04 17:44:50 -07:00
Eric Laurent
b7a76e84fd am a482d83c: Merge "Issue 4157048: mic gain for VoIP/SIP calls." into gingerbread
* commit 'a482d83ccf35ccd6cc29a9e1ace3d77b5f28d013':
  Issue 4157048: mic gain for VoIP/SIP calls.
2011-04-04 12:25:37 -07:00
Eric Laurent
d7a724e6d8 Issue 4157048: mic gain for VoIP/SIP calls.
Herring board exhibits a strong echo even in non speakerphone modes.
To compensate the lack of AEC or AES when not in speakerphone, the mic gain
had been reduced in the ADC. But this has an adverse effect on other VoIP applications
that have their own AEC and are penalized by the weak mic gain.

This workaround enables an acceptable mic gain for other VoIP apps while offering a
SIP call experience which is not worse than it was with the residual echo that was
present even with mic gain reduction.

Change-Id: I33fd37858758e94e42ef5b545d3f0dc233220bf1
2011-03-29 18:44:03 -07:00
Brad Fitzpatrick
397de169e5 am fae5e289: am 6f67e7bf: am 2e383bc6: Merge "Making it possible to call SIP calls with special allowed chars."
* commit 'fae5e2894ff3c09f27efac2a7ee6b9cfd4ed14b0':
  Making it possible to call SIP calls with special allowed chars.
2011-03-29 08:53:48 -07:00
Brad Fitzpatrick
fae5e2894f am 6f67e7bf: am 2e383bc6: Merge "Making it possible to call SIP calls with special allowed chars."
* commit '6f67e7bf831147257e078dd72a22f2e43e009122':
  Making it possible to call SIP calls with special allowed chars.
2011-03-29 08:45:30 -07:00
Magnus Strandberg
b5c72ead01 Making it possible to call SIP calls with special allowed chars.
Since String.replaceFirst uses regex and since SIP user names are
allowed to include regex charaters such as '+', the code must
fist convert the string to a literal pattern String before using
replaceFirst method.

Change-Id: I25eac852bd620724ca1c5b2befc023af9dae3c1a
2011-03-22 08:03:58 +01:00
Carl Shapiro
3f9e08973f Include strings.h instead of string.h for the strcasecmp prototype.
Change-Id: I6b0ddc2408c30851edcffb36f1bc74245403ffc7
2011-03-21 20:21:40 -07:00
Iliyan Malchev
3070af0882 frameworks/base: remove LOCAL_PRELINK_MODULE
Change-Id: I54dd62ebef47e7690afa5a858f3cad941b135481
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-03-14 14:25:59 -07:00
Chia-chi Yeh
6defd2d47e NEW_API: Unhide RTP APIs.
This change unhides RTP related classes including AudioCodec,
AudioGroup, AudioStream, and RtpStream. This allows developers
to control audio streams directly and also makes conference
calls possible with the combination of the public SIP APIs.

Change-Id: Idfd4edf65a1cbf3245ec2786fbc03b06438b0fb3
2011-03-08 05:59:09 +08:00
Chia-chi Yeh
c52f5b2ec5 RTP: update javadocs.
Change-Id: If600df0eb1e6135aed9f3b2eacfb6bc9ed5d78ff
2011-03-03 08:01:01 +08:00
Chung-yih Wang
89bc1fe73e Activate the wifi high perf. for sip calls.
bug:3487791

Change-Id: I7d8d146f8542cd7df387547c7ce3d5ded27f8e97
2011-02-25 10:21:37 +08:00
Chung-yih Wang
fcd0e50da5 Add rport argument for a reinvite request.
bug:3461707
Change-Id: I69a4f84dde3929c754c838fd12e624b774f44826
2011-02-21 11:53:58 +08:00
Chung-yih Wang
9e25df4463 Make SIP AuthName APIs public.
bug:3326867
Change-Id: I766e6e28f6ad3e84de2c9e24850d472ad00271cc
2011-02-17 15:06:08 +08:00
Jean-Michel Trivi
2ba92c71b5 do not merge bug 3370834 Cherrypick from master
Cherripick from master CL 79833, 79417, 78864, 80332, 87500

Add new audio mode and recording source for audio communications
 other than telelphony.

The audio mode MODE_IN_CALL signals the system the device a phone
 call is currently underway. There was no way for audio video
 chat or VoIP applications to signal a call is underway, but not
 using the telephony resources. This change introduces a new mode
 to address this. Changes in other parts of the system (java
 and native) are required to take this new mode into account.
The generic AudioPolicyManager is updated to not use its phone
 state variable directly, but to use two new convenience methods,
 isInCall() and isStateInCall(int) instead.

Add a recording source used to designate a recording stream for
voice communications such as VoIP.

Update the platform-independent audio policy manager to pass the
 nature of the audio recording source to the audio policy client
 interface through the AudioPolicyClientInterface::setParameters()
 method.

SIP calls should set the audio mode to MODE_IN_COMMUNICATION,
 Audio mode MODE_IN_CALL is reserved for telephony.

SIP: Enable built-in echo canceler if available.
1. Always initialize AudioRecord with VOICE_COMMUNICATION.
2. If echo canceler is available, disable our echo suppressor.

Note that this CL is intentionally not correcting the
 getAudioSourceMax() return value in MediaRecorder.java as the
 new source is hidden here.

Change-Id: Ie68cd03c50553101aa2ad838fe9459b2cf151bc8
2011-01-26 11:20:01 -08:00
Hung-ying Tyan
14b6d0620b Merge changes Ib70e0cf2,I0691cd70 into gingerbread
* changes:
  SipService: registers broadcast receivers on demand.
  SipService: release wake lock for cancelled tasks.
2011-01-24 19:41:42 -08:00
Hung-ying Tyan
f46013b672 Merge "Merge "SipService: registers broadcast receivers on demand."" into honeycomb 2011-01-18 02:25:52 -08:00
Hung-ying Tyan
e9b5407727 Merge "SipService: registers broadcast receivers on demand."
The previous implementation registers receivers when SipService starts up.
If the user doesn't use SIP at all, SipService will still process connecivity
and wifi state change events, which involves holding wake lock and thus
consumes power unnecessarily.

With this CL, SipService is completely idle if the user doesn't use SIP at all.
It registers receivers only when at least one account is opened.

Bug: 3326998
Change-Id: Idea43747f8204b0ccad3fc05a1b1c0b29c9b2557
2011-01-18 16:55:44 +08:00
Hung-ying Tyan
40f2cacbc9 Merge "SipService: release wake lock for cancelled tasks."
Bug: 3327004
Change-Id: Ice47f973b5f2969f26eaa83a3e4795b2e153ba8b
2011-01-18 16:50:56 +08:00