History log of /packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
87ad6e7a229370ef0437f407b2e2a6d986025763 19-Nov-2011 Matthew Xie <mattx@google.com> Decrease the scope of BluetoothHandsfree lock in message handler

The whole message handler of BluetoothHandsfree was locked on
BluetoothHandsfree. It locked many message cases unnecessarily.
This fix uses the lock case by case. 4 messages are freed from
the lock
bug 5639266

Change-Id: Ic86ff79f5b80a8f3b2cfa6289064943773f86f17
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
d9436d8b89bdb18e6ce5e7abcefeab60015d5e81 03-Nov-2011 Matthew Xie <mattx@google.com> Allocate its own looper thead for BluetoothHandfree handler

Move handling of signal strength and battery change messages to
BluetoothHandsfree handler which has its own looper now
bug 5535641

Change-Id: I4075b29b5deefc7994712eb96ed11fd3e31d6091
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
9bb0eee04fe44d4299d2fb053b96556a39b1731a 06-Sep-2011 Matthew Xie <mattx@google.com> Merge "fix mHeadset nullpointer exception and limit reconnect sco within 1 second"
a43debb2022f4f4cbb7a2ca8aa3b2658b2da4231 03-Sep-2011 Eric Laurent <elaurent@google.com> Issue 5252593: any app can restart the runtime

Check for null BT device when receiving
BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED intent.

Change-Id: I9023daeb4fe5de793df1d54972a15572ec7fe17a
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
90eae4375aa85e6ed620e32b12f655ef99356a70 03-Sep-2011 Matthew Xie <mattx@google.com> fix mHeadset nullpointer exception and limit reconnect sco within 1 second

Fix nullpointer error at mHeadset.getRemoteDevice() in failedScoConnect
by not setting mHeadset to null in disconnectHeadset. Instead, reset
mHeadsetType to TYPE_UNKONWN and rely on isHeadsetConnected check instead
of checking (mHeadset == null).
Limit re-connect SCO channel check in 1 second from a active call establishment
bug 5249391 5249392

Change-Id: I40d36632ab6fe58e38fe7fd01c6f19a7c345b8d4
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
ba2b1409db0b7f7901bd30c238f7a63c72dc0a35 27-Jul-2011 jhtop.kim <jhtop.kim@samsung.com> Bluetooth : fix for PTS test TP/TWC/BV-02-I (3 Way - Drop Active/Retrieve Waiting Call)

- in CDMA network, when we got 1st active call and 2nd ringing call
if "CHLD=1" is coming then hanging up all the call (1st and 2nd) is correct.

- whie using CDMA network , can not distinguish 1st call from 2nd call.

Change-Id: Ia11f877cd590bbdbf6aa77b1cc1e8bf4f369c5bd
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
40daae15af3f5626e764ff507872532bafc1aca5 18-Aug-2011 Jaikumar Ganesh <jaikumar@google.com> Merge "Fix SCO audio APIs."
6e979d3698decc3631570a4f7db483cb94262c5d 18-Aug-2011 Jaikumar Ganesh <jaikumar@google.com> Fix SCO audio APIs.

The original meaning of the virtual call variable was to
check if we have sent the CIEV commands to start the virtual call.
However, this meaning changed later on.

In accordance with the original use, the virtual call started variable
was set only when we were able to send CIEV commands. We can send those
commands only to handsfree devices and not to devices which support
just the headset profile. Some devices don't have telephony
support and hence we only support headset profile for such devices.

9760482b introduced the bug where we were checking this variable
during terminate but not setting it during initiation.

Change-Id: I67b870841cff2fd8d9765b4ae4ed8fb49a1d1da4
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
6e2978b10d99879799e21ff246b2827721fe1260 17-Aug-2011 Matthew Xie <mattx@google.com> Move handling of intents from broadcast receiver to handler.

Move the handling of battery changed and signal strengh changed intents from
broadcast receiver to message handler. The functions calls sendURC that makes
socket call into kernel and could take some time to send out the URC codes.
This could block the main thread, causing ANR. Now handle them in the message
handler looper thread.
bug 5162882

Change-Id: I156207b30fe2b33b2cb1d47114b779305f623ee8
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
eccbc2aa0b0a719bcadcdba5e1aeb22a5814d08a 10-Aug-2011 inshik <inshik.shin@samsung.com> Bluetooth : Modified ATD command

When device is dialed numbers include "p" or "w" using ATD command,
device cannot recognize the numebers correctly.

Change-Id: I0d61436f872877be359ec288c9f31009ee76b324
Signed-off-by: inshik <inshik.shin@samsung.com>
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
93db56932abb4ad52c446947048e2af69e5a9848 13-May-2011 Matthew Xie <mattx@google.com> Persist SCO channel when call is active and user desires audio via BT

Sometimes, the SCO channel is torn down by HF with no reason.
We add a check that if we are still in active call, reconnect SCO.
Do max of 3 times retry to get SCO channel back on. Do immediately
retry the first time, then do 1 second delays for next re-tries.
Bug 3435200

Change-Id: If24c5c084055118b3a646e18930239eba3606ee7
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
560fc56157fe899e17fe3e8564962d60db46bc1a 07-Jul-2011 Matthew Xie <mattx@google.com> Merge "Implement access permission for AT+CPBR"
7d9521b93cadfde1e7fb2e7904641982f1a65bb6 26-Jun-2011 Matthew Xie <mattx@google.com> Implement access permission for AT+CPBR

Send access permission check intent to Settings app and process
the results from return intent.
Add ability to reject incoming connections.
bug 4489572

Change-Id: Icd4e6c5504594c7de335b51e93b0821d2f49279e
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
43d59ddb900224b9f6e9df6e3cfda6174fb57507 18-Jun-2011 Matthew Xie <mattx@google.com> Clean dangling unlive sco connect thread

reset mConnectScoThread in failedScoConnect of ScoSocketConnectThread
bug4689446
Change-Id: I19d00db232c1a0a0c3dd76e02f93666bf86511bc
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
65454c803eb305c4740885ad4995a871b034a58a 22-Jun-2011 David Brown <dab@google.com> Use constants for URI schemes

Use SCHEME_* constants instead of hardcoding
"tel" / "sip" / "sms" / etc. everywhere.

Change-Id: I1858384909a54ae86a27a5f557a80ee185873927
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
434df98fc0753560b1b979b2e5360f5e91d5ae5e 26-May-2011 Matthew Xie <mattx@google.com> Merge "Check virtual call status in terminateScoUsingVirtualVoiceCall"
9760482b3e3f8a0c11cae2866ff03fab1b2c3242 25-May-2011 Matthew Xie <mattx@google.com> Check virtual call status in terminateScoUsingVirtualVoiceCall

Check whether virtual call is in progress at the start of
terminateScoUsingVirtualVoiceCall. If not, we do no-op and return false.
This avoids turning off normal SCO channel that was carrying virtual
voice traffic.
bug 4364098

Change-Id: I08dbc86d7673f38c737e1786a2374b1bf698bc87
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
3564c7703848797f9accbde117e691164e0b6e9a 19-May-2011 Jaikumar Ganesh <jaikumar@google.com> am e9829eeb: am 19b92b6a: am 11ae53b6: Merge "Fix CDMA three way call handling." into gingerbread

* commit 'e9829eeb4610d425ed41d984f05b0d61ec69c2a6':
Fix CDMA three way call handling.
e9829eeb4610d425ed41d984f05b0d61ec69c2a6 18-May-2011 Jaikumar Ganesh <jaikumar@google.com> am 19b92b6a: am 11ae53b6: Merge "Fix CDMA three way call handling." into gingerbread

* commit '19b92b6aaea00f9486d86734bd2d3d52a4762d69':
Fix CDMA three way call handling.
19b92b6aaea00f9486d86734bd2d3d52a4762d69 18-May-2011 Jaikumar Ganesh <jaikumar@google.com> am 11ae53b6: Merge "Fix CDMA three way call handling." into gingerbread

* commit '11ae53b607436c801abe8b6aa25b8c5c7fc267e6':
Fix CDMA three way call handling.
91f4a3ccc2ac2e146f54c4b4b88b62c16595602a 07-Apr-2011 Jaikumar Ganesh <jaikumar@google.com> Fix CDMA three way call handling.

This should fix all PTS tests cases except AT+CHLD=1 cases. PTS needs
to be updated for that.

1. Send Call Held Status when mimicing call transition of the second MO call.
2. Handle sending CIEV: 4 when calls are switched using AT+CHLD =2.

Change-Id: I9b0e6372a8223dda5c5a8d08b4e871d80235753e
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
f0c4d0e94b7fa915bcfacd28ee432f8b3846511a 10-May-2011 David Brown <dab@google.com> Singleton pattern code cleanup

Fix a few of the phone app's singleton classes to be more explicit about
their singleton-ness, by making the constructor private, and instead
providing a public factory method that creates the singleton instance.

TESTED: Basic telephony (including bluetooth) on crespo.

Change-Id: Idb5bac1cf97a6864b898b09645779de214ac5266
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
36656f4d7d5c714c11d11454ef279fe5e6d46044 24-Nov-2010 Srinivas Krovvidi <skrovvid@codeaurora.org> phone app:Fix for wrong call status report in CDMA

When there 2 Mobile teriminated calls, that are not conference
( 1 held call and 1 accepted call ), in case of CDMA network
the call status return in AT+CLCC is multiparty. Added fix to
determine if it is a real multy party call.

Change-Id: Ib83abc1a71b57e2903c619b1509442b5b2f1f4f1
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
5ab8ecfc1fdfbbba65ed0a972cf750d95514857b 12-Apr-2011 Jaikumar Ganesh <jaikumarg@android.com> am 84db7a88: am bde386d4: Merge "phone app:Fix for wrong call status report in CDMA"

* commit '84db7a885e52a10c9ee8b948c9c11b0b5615b17a':
phone app:Fix for wrong call status report in CDMA
c39c3c9ada26aa8fab1373ad94c9b0d9e8875caa 24-Nov-2010 Srinivas Krovvidi <skrovvid@codeaurora.org> phone app:Fix for wrong call status report in CDMA

When there 2 Mobile teriminated calls, that are not conference
( 1 held call and 1 accepted call ), in case of CDMA network
the call status return in AT+CLCC is multiparty. Added fix to
determine if it is a real multy party call.

Change-Id: Id9fa37dd0b4a7b41318342310db58f2f05544879
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
e5d4f38445a097390b72c53b40f86e126c0cd75e 13-Mar-2011 Eric Laurent <elaurent@google.com> Fix issue 3515250 again: end chat and BT SCO start

The fix in commit e28e6bd3 was not complete and some deadlock
possiblities were left.

This fix consists in simplifying the locking mechanism by removing
mScoLock and only synchonize on the BluetoothHandsfree object.

Also do not wait for the SCO connection thread to exit when
shuting down in audioOff(): as this method can be called from the UI
thread and the SCO connection can take several seconds we should not
block on join().

Change-Id: Ie11dd0031661397cfa385baaf34b9344d1e69aaf
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
e28e6bd39098d1af6459b27a6c423c43c906c5a2 09-Mar-2011 Eric Laurent <elaurent@google.com> Fix issue 3515250: end chat while starting BT SCO

There is a potential deadlock if the outgoing SCO socket
thread (BluetoothHandsfree.ScoSocketConnectThread) is interrupted
while the socket is being connected. If the socket is successfully
connected, the thread tries to update the audio state by calling
setAudioState() which is a synchronized method. At the same time,
the thread that requested the interruption is executing audioOff()
which is also a synchronized method and is waiting on join() on
the SCO socket thread => deadlock.

The fix consists in aborting SCO audio setup in the SCO socket thread
if an interrupt is detected when returning from connect().

Also fixed a similar deadlock for incoming SCO socket.

Change-Id: Idde547dd113e58d105338003d9e8ebb033ca9dd6
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
34a30a05feb48e56b8f6d5e05d9d58ce649bfdd1 08-Dec-2010 Srinivas Krovvidi <skrovvid@codeaurora.org> Phone: Send AT+RING when phone is ringing and headset connected

When Phone is in ringing state and headset is connected at that time,
ring or beep is not heard on the headset. The added change fixes the
issue.

Change-Id: Id737564062c86dd1b39ac01ee9459ea323c08574
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
02369485c4c2b977e6a26cd01ab817b364758bfe 05-Jan-2011 SRINIVAS <skrovvid@codeaurora.org> Phone: Send RING,CLIP,CIEV updates only after SLC establishment.

Unsolicited RING, CLIP and CIEV notifications were being sent during
service level connection establishment. Violates BT spec. Added code
to disable.

Change-Id: I94778b4da6560e8fe013fa9179680ea8a65e23cf
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
eeab0c52a0542179621ee7854d7913cfd2445429 26-Jan-2011 Jaikumar Ganesh <jaikumar@google.com> Revert "Temporary Changes for certification of SCO."

This reverts commit 65308de41eef7c1f3f392b341e5a0c0bd8765fb9.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a8b5afa3f830a05fd6679642a6a29dd3265cd273 24-Jan-2011 Jaikumar Ganesh <jaikumar@google.com> Fix BT audio manager API.

When the headset gets disconnect the state was not being reset.
There are 2 parts for this API: The audio, the virtual call part.
Create this distinction in the variables and end the virtual call
when the headset is disconnected.

Test Cases:
* Start and stop SCO using API
* Start SCO, Disconnect Headset, Connect, Start SCO
* Start SCO, Disconnect headset from remote end, Connect, Start SCO
* Start SCO, Transfer Audio, Start SCO should work.
Bug: 3381532
Change-Id: Iea56daa7dbde9c423b734b14f34ea0ab7a96b6f7
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
65308de41eef7c1f3f392b341e5a0c0bd8765fb9 20-Jan-2011 Jaikumar Ganesh <jaikumar@google.com> Temporary Changes for certification of SCO.

Bug: 3349475
Change-Id: I5447c22a824606d5ed98eba337892ca2763c7bf9
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
179bbc0b646d7af4cb6662927c7a3e7a36332ded 08-Dec-2010 Srinivas Krovvidi <skrovvid@codeaurora.org> Phone: Send AT+RING when phone is ringing and headset connected

When Phone is in ringing state and headset is connected at that time,
ring or beep is not heard on the headset. The added change fixes the
issue.

Change-Id: Id737564062c86dd1b39ac01ee9459ea323c08574
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
0280bd6306692055f42ed0b7408dcc089a235c37 05-Jan-2011 SRINIVAS <skrovvid@codeaurora.org> Phone: Send RING,CLIP,CIEV updates only after SLC establishment.

Unsolicited RING, CLIP and CIEV notifications were being sent during
service level connection establishment. Violates BT spec. Added code
to disable.

Change-Id: I94778b4da6560e8fe013fa9179680ea8a65e23cf
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
1c5ea6e6845b1e81b987a33e0d5fd3944552d7ed 08-Dec-2010 Eric Laurent <elaurent@google.com> Issue 3159946: more checks on voice recognition

- Do not start voice recognition if a virtual call or another voice recognition is active.
- Do not stop voice recognition if no voice recognition is active
- Do not start Virtual call if Voice recognition is active.

Change-Id: I9f169f998a07d69a9e36aa4b3281b5d836196e04
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
56a13c103c09f2f6af10cf7b66ac6af7266189b5 07-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am 6df5710f: am f886303d: am 6a7f56bd: Merge "Change response when AT+COPS? is received when no network"

* commit '6df5710fd13ee124cc3e4a331abefd24f64c0677':
Change response when AT+COPS? is received when no network
f886303d22eee009d8a42e9169c2e0dd1b628462 06-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am 6a7f56bd: Merge "Change response when AT+COPS? is received when no network"

* commit '6a7f56bd844b0d1d319afc4ed0fd6d97acd9cb51':
Change response when AT+COPS? is received when no network
5b58955238953dd3c689b1d1342cb9d79ec3e9de 01-Dec-2010 Jesper Hansson <jesper.hansson@sonyericsson.com> Change response when AT+COPS? is received when no network

The response to the AT+COPS command is not according to
specification when no operator is selected. The response
'+COPS: 0,0,"UNKNOWN",0' or similar is incorrect and will look
bad on the display of a car kit. The response should be on the
format +COPS: <mode> if no network is found.

Change-Id: Ic4635b114e917adc571ac01723308822573a6ec1
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
eb1d4e290a13b55430960fd7ba58404608f10593 25-Nov-2010 Eric Laurent <elaurent@google.com> Fix issue 3159946.

Do not start voice recognition if the request is received while a virtual call is active.
virtual calls are managed by AudioService and cannot be started if voice recognition or
a call is already active.

Change-Id: Iafd0e5552a115c76c99cddc71ed43f33937fb634
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
b5d4288b3b4f336601bf6ebf16861d399a4d83a9 03-Nov-2010 Jaikumar Ganesh <jaikumar@google.com> Support for VirtualVoiceCall over SCO

Original Change by: Kausik@broadcomm.com

Change-Id: I320ab10f5ca6a0fcfd6e710e2514fea1004a722e
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
912186b04d22881fd025a7cbe586228b85721a05 01-Nov-2010 Jaikumar Ganesh <jaikumar@google.com> Add STATE_AUDIO_CONNECTING state.

SCO Clients, make a call and wait for SCO Audio. We don't
inform them in case of failure. Also fix incoming and outgoing
SCO synchronization. BluetoothHandsfree code desperately needs
to reimplemented as a proper state machine.

Change-Id: Id837250d8e87831582f04972340681bdfe929786
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
86324d3be365c1104c40ba007e671de8f1306021 19-Oct-2010 Jaikumar Ganesh <jaikumar@google.com> Reply with Errors for Read and Test for Vendor specific intents.

Also add the AT command type and the intent category.

Change-Id: I5042226720fd5e5c6f0bb7a89f805b3ef3094df3
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
081ad13057d92c3d34857a581a47e6fcd94a7bae 30-Sep-2010 John Wang <johnwang@google.com> am dd9cfccd: am f8453f9e: Use phone service state in bluetooth service state.

Merge commit 'dd9cfccdc2d156178e3aaab7204057e7276ba2b5'

* commit 'dd9cfccdc2d156178e3aaab7204057e7276ba2b5':
Use phone service state in bluetooth service state.
dd9cfccdc2d156178e3aaab7204057e7276ba2b5 30-Sep-2010 John Wang <johnwang@google.com> am f8453f9e: Use phone service state in bluetooth service state.

Merge commit 'f8453f9e061b237d83d006e07009402fa7680583' into gingerbread-plus-aosp

* commit 'f8453f9e061b237d83d006e07009402fa7680583':
Use phone service state in bluetooth service state.
f8453f9e061b237d83d006e07009402fa7680583 30-Sep-2010 John Wang <johnwang@google.com> Use phone service state in bluetooth service state.

Use the service state of default phone as BT service state to

avoid situation such as no cell or wifi connection but still

reporting in service (since SipPhone always reports in service).

See bug 2996054.

Change-Id: Ib123890adad3ac7d695146e9b92082dfa0b5d5a0
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
1d417d7ede71bbcf72a7edebf528efbfcf9b82bb 26-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> Update code for new Bluetooth Public profile APIs.

Change-Id: I125e7643d2aab9a31470d7602060cf4604352707
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
c65912200e16b17dfceedbb2f289f507d5c23c13 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> am 1bd89bf0: am dc1e86ff: Merge "Parse GSM character set encoding." into gingerbread

Merge commit '1bd89bf0c4b6acd571f9cdfc82696dcf7e77047e'

* commit '1bd89bf0c4b6acd571f9cdfc82696dcf7e77047e':
Parse GSM character set encoding.
1bd89bf0c4b6acd571f9cdfc82696dcf7e77047e 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> am dc1e86ff: Merge "Parse GSM character set encoding." into gingerbread

Merge commit 'dc1e86ff975f6169f4da047efbded094abe90453' into gingerbread-plus-aosp

* commit 'dc1e86ff975f6169f4da047efbded094abe90453':
Parse GSM character set encoding.
f5945125c4e044b860f89a370fe376b97bd91d37 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> Parse GSM character set encoding.

Fixes German umlaut character problem.

Change-Id: I78b5649e98b4713b1c7e8d6f84d04dbe5e644a12
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
78b66e4ccae67ec04b9a8f56b003791b300b816e 25-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> am 4acc683c: am 8baba3f9: Merge "Unbundle signal strength only when needed." into gingerbread

Merge commit '4acc683c04a66a06fd432d6d4c3e5efe52067507'

* commit '4acc683c04a66a06fd432d6d4c3e5efe52067507':
Unbundle signal strength only when needed.
4acc683c04a66a06fd432d6d4c3e5efe52067507 25-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> am 8baba3f9: Merge "Unbundle signal strength only when needed." into gingerbread

Merge commit '8baba3f9b133152e6dbf783a145667b97a2b532d' into gingerbread-plus-aosp

* commit '8baba3f9b133152e6dbf783a145667b97a2b532d':
Unbundle signal strength only when needed.
d16be9780f29c031e3d854fde5b92f05392836e3 24-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> Unbundle signal strength only when needed.

Unbundling signal strength bundle is a costly operation.
Do it only when a headset is connected.

Change-Id: I3e447020f26134d4e3ea303c2647dea8a9123264
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
138423ea2126035f7e316de18fc478362cf3b891 03-Sep-2010 John Wang <johnwang@google.com> am 507876ad: am 2b250f76: Merge "Fix mute/unmute operation with CallManager." into gingerbread

Merge commit '507876ad11ae076c2eae93ff219843b62eb7113d'

* commit '507876ad11ae076c2eae93ff219843b62eb7113d':
Fix mute/unmute operation with CallManager.
507876ad11ae076c2eae93ff219843b62eb7113d 03-Sep-2010 John Wang <johnwang@google.com> am 2b250f76: Merge "Fix mute/unmute operation with CallManager." into gingerbread

Merge commit '2b250f76e11c76c37ad89a590cb690491548311a' into gingerbread-plus-aosp

* commit '2b250f76e11c76c37ad89a590cb690491548311a':
Fix mute/unmute operation with CallManager.
a50e10e2efadac960987eaadc0938c6f92d3ee90 03-Sep-2010 John Wang <johnwang@google.com> Fix mute/unmute operation with CallManager.

It is for bug 2968263.

The Mute concept is call based. PhoneUitls maintains a connectionMuteTable to track

the mute state of each connection. For every preciseCallSateChanged event, the table

gets updated for all foreground and background connections. For every UI mute/unmute

operation the table gets updated for affected foreground connections.

Meanwhile, clean up setMute() and getMute() APIs in PhoneUtils since all in-call operation

can only mute/unmute foreground call, which means works on foreground phone.

Also enforce all in-call UI use setMute() instead of setMuteInternal().

Change-Id: Ib608e040230d46b57434a0ac2597a6fb676ad639
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
6b4d37ced9d2db95b988482789cf299da00d2dae 28-Aug-2010 John Wang <johnwang@google.com> resolved conflicts for merge of fcf90596 to master

Change-Id: Iaa7e7cdd0beb8cb83169455021206154b25efc2d
fcf905963c8bca570686594aa696f81def669a93 27-Aug-2010 John Wang <johnwang@google.com> am 1986fc4f: Merge "Integrate CallManager with Bluetooth call service." into gingerbread

Merge commit '1986fc4f4ad5e2a188faa63f6a1ddbf8c81b0f99' into gingerbread-plus-aosp

* commit '1986fc4f4ad5e2a188faa63f6a1ddbf8c81b0f99':
Integrate CallManager with Bluetooth call service.
8058bbc4c7d0d56e133bd2fb9dfc559004e4d61a 23-Aug-2010 John Wang <johnwang@google.com> Integrate CallManager with Bluetooth call service.

Replace Phone APIs with CallManager APIs in bluetooth call service.

Delete mForegroundCall, mBackgroundCall and mRingingCall in bluetooth class.

Since those calls dynamically refer to calls of different phones, bluetooth call handler has to access them via CallManager APIs.

Change-Id: Icdb04fbc0caef2dfda7ca73a3f67bd4177d4e92d
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
df82529a7cfd472e52d747114aa0793a8a8ccad4 24-Aug-2010 Jean-Baptiste Queru <jbq@google.com> am 870bd7f0: resolved conflicts for merge of 1498a77b to gingerbread-plus-aosp

Merge commit '870bd7f09582278afaf7447a3be72653a742b1bd'

* commit '870bd7f09582278afaf7447a3be72653a742b1bd':
BluetoothHandsfree.java:
870bd7f09582278afaf7447a3be72653a742b1bd 21-Aug-2010 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 1498a77b to gingerbread-plus-aosp

Change-Id: Ie63501035b682e91a6e259bc549df4304d7fa983
47bf9386b2db81cdc7194711412194fce5b489c6 19-Aug-2010 Hung-ying Tyan <tyanh@google.com> resolved conflicts for merge of 4000ce7e to master

Change-Id: Ibbc34e5e1533b7eef54ab62169e002ecc0b1e7ea
b045b9344f339170d134cf814357361d96c349cf 17-Aug-2010 Hung-ying Tyan <tyanh@google.com> Integrate confcall support with CallManager

Change-Id: Ifb5116a175b1f63d879c4bd64d4fabadd6c4e5a4
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
9afe1de771110096822a2501d78135575101421d 14-Aug-2010 John Wang <johnwang@google.com> resolved conflicts for merge of 17509be3 to master

Change-Id: Ie52e3bfd5f127788840b11e56ba5fe9dd5b97cf0
1498a77b9d76318817fe5a1e3a961070ead26fad 10-Aug-2010 Herb Jellinek <Herb.Jellinek@gmail.com> BluetoothHandsfree.java:
Added mechanism to broadcast vendor-specific headset events.

BluetoothHeadsetService.java:
Reformatted code.

Change-Id: I6c613d185f0ab96f9f040f54e8b8d7de9df4735b

Event broadcasts should include the Bluetooth company ID.

Change-Id: I969bbb4d963c4f257f5d122436a55add3de02c89
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
8343169cc89621d46dce86449f5ee1ff5d3a4919 11-Aug-2010 John Wang <johnwang@google.com> Enable CallManager to handle SIP call.

Using CallManager to handle SIP call

1. Register SIP phone in SipBroadcastReceiver

2. Answer SIP incoming call

3. Reject SIP incoming call

4. Make SIP outgoing call

5. hangup SIP outgoing call

6. Add SIP call while there is foreground call

7. Answer SIP call while there is foreground call

8. Swap SIP call and background call

Change-Id: I2fc1f88e0fc100da45eb497469d69c784f44d06a
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
6f4ee5d33aec58afec76c6a288ef95865df91a25 10-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> am 4762b68a: am fc25a582: Merge "PTS Certification issue: AT+CHLD should be followed by OK, before CIEV commands are send out." into gingerbread

Merge commit '4762b68a73dfdad5fc343aebbeee0aa31d116405'

* commit '4762b68a73dfdad5fc343aebbeee0aa31d116405':
PTS Certification issue: AT+CHLD should be followed by OK, before
81a26f368128024620b0dc7b0eb32debf3fe3419 06-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> PTS Certification issue: AT+CHLD should be followed by OK, before
CIEV commands are send out.

We were sending commands in DISCONNECTING state itself, and this
was causing problems with PTS and possibly with some headsets in
multi call scenarios.

Based on a report and patch by: Shawn.C_Huang@htc.com

Bug: 2777410
Change-Id: I8e6e8104f6f795e43cadaed121c01ff372efe2e4
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
91b4c99be8dbdd8fca6b76a0e34e8a4b989b2b87 04-Jun-2010 Danica Chang <danicachang@google.com> Changed BluetoothHandsfree to use BluetoothSocket's Sco Socket instad of ScoSocket.java

Change-Id: I7c31f5e8453d7c58927f8a7ed2dfe83de10cfb98
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
f6adf1a33b12c9900b3ce9c15130642ce515ae91 05-May-2010 Jaikumar Ganesh <jaikumar@google.com> Synchronize connect and disconnect headset calls.

mHeadset becomes null because of the disconnect.

Log:
D/BT HSHFP( 1086): Rfcomm connected
D/BT HSHFP( 1086): Headset state 1 -> 2, result = 1
<snip>
D/BT HSHFP( 1086): Saved priority 00:13:17:71:E6:1F = 1001
<For some reason headset got disconnected>
D/BT HSHFP( 1086): Headset state 2 -> 0, result = 2
D/BT HSHFP( 1086): Headset state 0 -> 1, result = 1
D/BT HSHFP( 1086): SDP UUID: TYPE_HANDSFREE
I/BT HSHFP( 1086): Created RFCOMM socket fd 26
I/BT HSHFP( 1086): async connect is in progress (Operation now in progress)
D/AndroidRuntime( 1086): Shutting down VM
W/dalvikvm( 1086): threadid=3: thread exiting with uncaught exception (group=0x4001b180)
E/AndroidRuntime( 1086): Uncaught handler: thread main exiting due to uncaught exception
V/BluetoothEventRedirector(13646): Received android.bluetooth.headset.action.STATE_CHANGED
D/CachedBluetoothDevice(13646): onProfileStateChanged:[CONNECT Address:00:1D:DF:00:10:A8 Profile:HEADSET TimeSent:10:38:46 AM]
E/AndroidRuntime( 1086): java.lang.NullPointerException
E/AndroidRuntime( 1086): at com.android.phone.BluetoothHandsfree.configAudioParameters(BluetoothHandsfree.java:293)
E/AndroidRuntime( 1086): at com.android.phone.BluetoothHandsfree.connectHeadset(BluetoothHandsfree.java:254)
E/AndroidRuntime( 1086): at com.android.phone.BluetoothHeadsetService$5.handleMessage(BluetoothHeadsetService.java:448)

Change-Id: I9c615ab8da013ea06f604e12263d2ea3be0d9976
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
bfc44512504ebc93c101ddb394719840f2d25072 14-Apr-2010 Jaikumar Ganesh <jaikumar@google.com> Reset AT phone state on a remote disconnect.

Bug: 2412195
Change-Id: I91fda76cda8ed83e3826ea58f220a64b00a02756
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
819fc69ac472a8d77be8e5dd79a21434c6de8a37 24-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> 1. Fix crash when we get a disconnect and audio transfer at the same time.

Bug id: 2537188

03-22 15:22:12.905 I/Bluetooth HeadsetBase( 1184): headset read error 5
03-22 15:22:12.905 I/bluetooth_ScoSocket.cpp( 1184): Connecting to socket
03-22 15:22:12.944 I/bluetooth_ScoSocket.cpp( 1184): SCO socket connected (outgoing)
03-22 15:22:13.030 D/BT HSHFP( 1184): Headset state 2 -> 0, result = 0
03-22 15:22:13.030 D/ScoSocket( 1184): android.bluetooth.ScoSocket@44c60868 SCO OBJECT close() mState = 4
03-22 15:22:13.054 D/ScoSocket( 1184): android.bluetooth.ScoSocket@44c60868 SCO OBJECT close() mState = 5
03-22 15:22:13.085 D/AndroidRuntime( 1184): Shutting down VM
03-22 15:22:13.085 W/dalvikvm( 1184): threadid=3: thread exiting with uncaught exception (group=0x4001b180)
03-22 15:22:13.093 E/AndroidRuntime( 1184): Uncaught handler: thread main exiting due to uncaught exception
03-22 15:22:13.132 E/AndroidRuntime( 1184): java.lang.NullPointerException
03-22 15:22:13.132 E/AndroidRuntime( 1184): at com.android.phone.BluetoothHandsfree$1.handleMessage
(BluetoothHandsfree.java:978)

2. Also close incoming listening SCO socket only when BT is switched off.
Call audioOff when SCO is closed so that we don't leak sockets.
The outgoing socket gets set to NULL when the SCO connect gets connected.

Change-Id: Ibf9cb4d5b3bdc77cad9fd7e610daee908d7a9b9c
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
f0316a1fb5c00585d0fe4b500723557afabec70b 18-Mar-2010 Eric Olsen <eolsen@android.com> Pass the device name to the SCO connection.
This allow Blacklists to be implemented.

Change-Id: I0f5fc2a0377cd0609e87fe80212adeee7556b270
Signed-off-by: Eric Olsen <eolsen@android.com>
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
b8dbab241df3aa3487c1bdb488fd4e0b694d2d9a 17-Mar-2010 Eric Laurent <elaurent@google.com> Use new method of BluetoothHeadset API to check if voice dialer over bluetooth is supported.

Needed for issue 2416481: Support Voice Dialer over BT SCO.

Change-Id: Iac63b427980e04e2b1a9973dbffffdae19c65605
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
c786eb3f4a06317d8cd75bb69edf1b3a391b2c63 05-Feb-2010 Nick Pelly <npelly@google.com> Hangup active call not ringing call on AT+CHUP.

Plantronics @ Unplugfest recommended to hangup active call in the active/incoming case. The HFP spec does not clearly say what to do here, it just says that CHUP can hangup incoming call or active call. The 3GP spec does say to hangup the current call. So it seems like Plantronics are correct to hangup the active call in the active/ringing case.

Change-Id: I973eb607b46cd83351d0ea1513b699bc032e30b1
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
1b69b5d702539a74d1511d7467737eddc24b7744 03-Feb-2010 Nick Pelly <npelly@google.com> Disconnect SCO link before switching audio routing.

This avoids noise on some headsets due to us sending junk on the SCO
link for the brief period between switching audio routing and taking down the
SCO link.

Change-Id: Ia1237658c2c233ab387b17cc8e0e5c62668a4283
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a23972e3605fb235897250fd4edc2b70be13e00d 26-Jan-2010 Nick Pelly <npelly@google.com> Revert the setup-SCO-early patches.

We now go back to the old behavior of connecting SCO only once an incoming
call is answered by the user. We found too many compatability issues when we
try to connect SCO during ringing phase - many headsets will stop generating
internal ring tones once we connect SCO because they think this means we
support in-band ringtone (despite not advertising in-band ringing in our SDP
record and BRSF records).

I hope that a recent kernel change to exit sniff mode before setting up SCO
will help speed up SCO connections so we don't lose 2 seconds of audio when
answering a call (which is what originally prompted this patch series).

Revert "Delay setting up SCO."
This reverts commit 0aabf735b2c686fd8f6763e5ef5c0b71b47497b2.
Revert "Delay setting up SCO by 1 second for incoming calls."
This reverts commit 7e18d08cd85d567c47579ac4e02380c5642c26d2.
Revert "Set up SCO channel as soon as we ring, instead of when we answer."
This reverts commit 46caf76cd77ab6b903d2de21ce2b2b2dc365d11b.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
105bb2145aba70c03b43bfab906c1b0551387309 07-Dec-2009 Jaikumar Ganesh <jaikumar@google.com> Fix handling of SINK_STATE_CHANGE while suspend / resuming.

Update state only for the device which is connected.
We will hit this issue more often with car docks.

Bug:2133530
Dr No:Eastham
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
0aabf735b2c686fd8f6763e5ef5c0b71b47497b2 04-Dec-2009 Jaikumar Ganesh <jaikumar@google.com> Delay setting up SCO.

Ideally, we would like to set up the SCO channel
before sending the ring() so that we don't miss any
incall audio. However, some headsets don't play the
ringtone in such scenarios. So send the 2 ring()s first
and then setup SCO after a delay of 2 seconds.

If we still find that headsets don't play ringtones, we will back
out the change for opening up SCO early.

Dr No: Eastham
Bug: 2181474
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
1ec7e6b9b3bf1dfc384676244bec1edb50fedc58 23-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> Fix incoming call answer AT command sequence.

This causes issues with certain headsets and puts them in a bad state.

Bug:2280318
Dr No: Eastham
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a41427328932deb7cbadf586a1ec58e0ba26a932 18-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> Allow incoming SCO connections even in Dialing state.

Sometimes when we are in the dialing state for long, the remote
ends tries to establish audio which we reject. Then when we try
to establish audio connection, the remote end doesn't behave well.
This was observed with Audi A6.

Dr no: Eastham
Bug: 2268474
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
c335ba22b8d739eddaed89b78fad4520abf36b19 10-Nov-2009 Nick Pelly <npelly@google.com> Fix NPE when quickly disconnecting from BT headset with slow SCO while in-call.

There was a race when the SCO was connected, and the disconnected, after RFCOMM
is disconnected. Use NPE check to fix. Sending a null BluetoothDevice in the
AUDIO_STATE_DISCONNECTED is ok - it is how we used to behave before the API
change to introduce BluetoothDevice.

Change-Id: I287eda166b7469c09c6ea619a0a7eac07985b1e3
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
7e18d08cd85d567c47579ac4e02380c5642c26d2 07-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> Delay setting up SCO by 1 second for incoming calls.

Some headsets don't play the ringtone because the SCO
was connected.

Bug: 2181474
Dr No: Eastham
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
3eb2a4ae98eb737004d40f7ce03a8d83883fb079 24-Oct-2009 Kuanting Zhu <frank.zhu@motorola.com> Fix the CDMA issue that incorrectly send the conference status in CLCC response

Multiparty flag should not be set when calls are not really in conference.
To use CdmaPhoneCallState.PhoneCallState.CONF_CALL instead of SINGLE_ACTIVE

Bug: 2238628
Dr No: Eastham
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
3904e979ce9a501acbe6d8739393767a495388e8 28-Oct-2009 Jaikumar Ganesh <jaikumar@google.com> Fix BT PTS certification case for GSM devices.

When a call is active, and another call is made from the headset,
we don't respond with OK to command when the call is being dialed.
The PhoneState hasn't changed but the foreground call state has
changed from Active to Dialing.
Fix in discussion with: Fan Jackson who reported it
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a1478a9074b126d13124c99b7543b2518b3de3b7 16-Oct-2009 Eric Laurent <elaurent@google.com> do not merge - Fix for issue 2184627 cherry picked from eclair-mr2

Bluetooth A2DP suspend-resume improvements.

This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 2184627, 2181005 and possibly 2189628.

Make sure the A2DP suspend flag is restored when bluetooth is disabled or BT device is disconnect.
Do not attempt to resume the A2DP sink if the BT device has been disconnected.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
ab377a6e67c195c230db42e98d597bf4deba14bd 08-Oct-2009 Eric Laurent <elaurent@google.com> Fix issue 2174002: After rejecting Call when device ringtone is mute and playing music, audio is not transfered to BT device.

Make sure the A2DP sink is resumed by audioOff() even if the suspend is not completed.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
cec56587c1d3c90014848d7adfe817bef9c325ea 08-Oct-2009 Nick Pelly <npelly@google.com> Update application code for BluetoothAdapter.getDefaultAdapter().

Change-Id: I6163a1522678658b76a6eee0c96868a170638e35
DrNo: eastham
Bug: 2158765
Joke: What did Batman say to Robin before they got in the car? Robin, get in the car.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
310e6fb854504637a4cefd123d8dd387660cf811 01-Oct-2009 Nick Pelly <npelly@google.com> Only call resumeSink() if we actually shut down an active SCO connection.

This is just precautionary, to avoid spurious calls to resumeSink().

Change-Id: Ib5c97262b9a287bf06cd54fedf1cec835e1a8ceb
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
337c7eb41d344b39efcf740cdc579257152a1c58 30-Sep-2009 Nick Pelly <npelly@google.com> Fix regression for suspend/sesume patcheset.

We were not setting up SCO at all for the non-HFP/A2DP multi function case.

Change-Id: I464a61e420a903c294babea5444a7d95041c16dc
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
f9f946bc1e3ba287f0fa8f47a662e42f20892526 24-Jun-2009 Zhu Lan <mtcb47@motorola.com> Suspend A2DP before attempting SCO connection.

This is to follow HFP/A2DP inter-op recommendations.

Significantly rewritten from Zhu Lan's original commit by
Nick Pelly <npelly@google.com>

Change-Id: Ia6e8ec7abe7635f56c04235b7ee430be5a1366ec
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
79b9f6e30e8402b103f1ec3ed9dda1fcad2b1cd5 22-Sep-2009 Tammo Spalink <tammo@google.com> Replace Phone.getPhoneName() calls with getPhoneType().

The latter is numeric, and hence allows some compiler protection
against typos.

Addresses issue:
http://buganizer/issue?id=1905415

Change-Id: If46c709fd7bfb817a2801d0200eac0ad8cf819e0
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
46caf76cd77ab6b903d2de21ce2b2b2dc365d11b 18-Sep-2009 Nick Pelly <npelly@google.com> Set up SCO channel as soon as we ring, instead of when we answer.

SCO setup can take up to 2 seconds with some headsets, so if we setup on answer
the BT headset can miss 2 seconds of audio.

The HFP 1.5 spec allows SCO setup at any time during the in-call process. I am
still somewhat concerned with compatability, so we will have to watch out for
regressions. I tested with the following devices and found no problems:
Sony HBH-IV840
Jabra BT-8010
LG HBS-200
Motorola HS270
Motorola H3

Note this change does not turn on in-band ringing. We set up the SCO channel
when ringing, but do not route audio until the call is answered.

Change-Id: I551ce239393be71d2f6ff45928526d4febff868c
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
18e0a07cc700234f5a02fe10eee9b3ea10db58b3 10-Sep-2009 Nick Pelly <npelly@google.com> Update application for Bluetooth API changes.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
487f0e7aa6b2db7212e76713199d4812a61c4625 03-Sep-2009 Jaikumar Ganesh <jaikumar@google.com> Fix CDMA 3 way calling state.

Again, we get updatePhoneState when the PreciseCall state changes.
This is different from Phone.State which is basically IDLE, OFFHOOK,
RINGING. We check if the previous state in case of GSM/CDMA i.e mPhoneState
and newState in the function updatePhoneState. 3 way calling for CDMA
needs to be handled as a special case, since the network doesn't
report all states. Hence the class CdmaPhoneCallState. Add a similar check
for CDMA3 way calling to check for previous CdmaPhoneCallState before
sending the CIEV responses. Also, abstract some code to a function.
And change the handler function name so there is no confusion in
the future.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
586668fe6a1259083fbbc67de8ecac850c1475f1 21-Aug-2009 Jaikumar Ganesh <jaikumar@google.com> Send OK immediately after receiving CHUP (as per spec).
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
8eb32ddb60cfe1a0d0733735c30ecfc814452806 14-Aug-2009 Jackson Fan <xyfan@motorola.com> Modify DBG flag

Use VDBG for logging and DBG for handsfree debug mode as suggested in PhoneApp.java
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
db065e9834bcad9b0cb16c272b4b272dee8bdf62 07-Aug-2009 Nick Pelly <npelly@google.com> Bluetooth: Update Phone.apk to match BT API change.

Split BluetoothDevice into BluetoothDevice and BluetoothAdapter.

BluetoothAdapter: Represents the local BT adapter. Operations on the local
adapter (start a scan, etc).
BluetoothDevice: Represents a remote BT device. Operations on remote devices
(pair, connect, etc).
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
1b7bc65530abaac8827a92d4df13803d3255f6d4 13-Aug-2009 Abhishek Pillai <pillai@motorola.com> CDMA BT fix for BLND response during 2ndMO call in a 3Way Call

BluetoothHandsfree.java Changes:
- Modified updatePhoneState() to call callStarted() for 3Way Calling in CDMA.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
ed1d155825eb32990fde95eef9d89a7260e4c3f1 12-Aug-2009 w36256 <pillai@motorola.com> CDMA BT fix for CIND and PIP SignalInfo fix

1. BluetoothHandsfree.java Changes:
Modified updatePhoneState() to update mCallheld info as per CDMA Call State.

2. CallNotifier.java Changes:
Modified SignalInfo tone generator instantiation to use AudioManager.STREAM_VOICE_CALL
instead of AudioManager.STREAM_NOTIFICATION cause of recent changes in AudioPolicyManager
which places NOTIFICATION as low visibility and does not play it while on a call.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
60877272381161201c6969dea501e683705d6e32 07-Aug-2009 w36256 <pillai@motorola.com> Fix for possible crash from "CDMA Bluetooth calling fixes" change
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
c9d9ed30aa547b79b81adc13a4d148a003b6ee62 30-Jul-2009 w36256 <pillai@motorola.com> CDMA Bluetooth calling fixes

BluetoothHandsfree.java Changes:
- Added CDMA_MAX_CONNECTIONS definition for CDMA CLCC connections update

- Added mCdmaIsSecondCallActive CDMA specific flag used in context with BT
devices having display capabilities to show which Caller is active.
This state might not be always true as in CDMA networks if a caller drops
off no update is provided to the Phone. This flag is just used as a toggle
to provide a update to the BT device to specify which caller is active.

- Modified BluetoothHandsfree() to initialize mCdmaIsSecondCallActive

- Modified updatePhoneState() to build CIEV response for:
1: 3 Way Call origination
2: Swaping between calls and merging two calls.

- Modified cdmaGetClccResult() for better readability

- Added CDMA specific interface to handle CLCC request
1: cdmaGetClccResult()
2: cdmaConnectionToClccEntry()

- Modified CLCC handler to call cdmaGetClccResult for CDMA phones

- Added new interface cdmaSwapSecondCallState() accessible to rest of the PhoneApp
to update the mCdmaIsSecondCallActive state.

- Modified CHLD handler to add capability to
1: Swap between calls after accepting a Call waiting and
2: Merge calls if on a Three-Way Call.
3: hangup a call on receiving CHLD=1 based on the phone state.

- Added cdmaSetSecondCallState() api to set second call state for CDMA

InCallScreen.java Changes:
- Modified internalSwapCalls() for calling cdmaSwapSecondCallState() if a BluetoothHandsfree
is connected.

- Modified handleCallKey() for calling internalSwapCalls() for CDMA.

PhoneApp.java Changes:
- Rearranged the creation and initialization of CdmaPhoneCallState before the BluetoothHandsfree creation.

PhoneUtils.java Changes:
- Added DBG statement for Merge calls in CDMA part.
- Modified answerCall() so as to set the second call state in Bluetooth as active
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
fe3abbbaea34fc41d6fa11f4abf5d69082e313d6 29-Jul-2009 Abhishek Pillai <pillai@motorola.com> Power key press handling for ending call in CDMA

If the user presses the Power button we end the complete call session i.e.:
- Hang up the Incoming/waiting Call by calling PhoneUtils.hangupRingingCall()
- Hang up the Ongoing call by Calling PhoneUtils.hangupActiveCall().

PhoneUtils.java Changes:
- Modified hangupRingingCall() specifically to check for WAITING state to
hangup a Call waiting call and added a default case which returns false if the RigningCall
state is not INCOMING or WAITING.

- Modified hangup(phone) interface to specifically call hangupRingingCall as in CDMA special
care needs to be taken for rejecting Call waiting.

- Added a new interface hangupRingingAndActive() which is used in
CDMA phones to end the complete Call session

InCallScreen.java Changes:
- Modified onClick() api for handling menuIgnore case to directly call internalHangupRingingCall().

BluetoothHandsfree.java Changes:
- Modified CHUP handler to call PhoneUtils.hangupRingingCall(), PhoneUtils.hangupActiveCall()
and PhoneUtils.hangupHoldingCall(). Changed the order of handling the CHUP cmd i.e.:
First hangup the ringingCall if any, then hangup hangup the foregroundCall if any and
lastly hangup the backgroundCall if any.

PhoneInterfaceManager.java Changes:
- Modified endCall() interface for CDMA to send an async request with CMD_END_CALL.

- Added new case to handle CMD_END_CALL and call endCallInternal().

- Added a new interface endCallInternal() for CDMA only to end the complete Call session
when the user presses the Power key.

- Modified endCall() for GSM to also use the sendRequest()

- Modified handleMessage() to call hangup api's based on phone type
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
aa23e1c3c758bad23d8b6709147cc1ff7cd1e43c 17-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 1795088 Improve audio routing code

Initial commit for review.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
9f8a2331fb865392d15a50d4ea59156737886f25 22-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> am b1164d37: Fix crash in phone app.

Merge commit 'b1164d370e8d83a8a4f3cbdc73dffc087254cabd'

* commit 'b1164d370e8d83a8a4f3cbdc73dffc087254cabd':
Fix crash in phone app.
b1164d370e8d83a8a4f3cbdc73dffc087254cabd 22-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Fix crash in phone app.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
4fc89bb2de9a193eac5c894e7630799a9a38e3e0 22-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> am 13df4bba: Assign the state to the serviceState variable.

Merge commit '13df4bba7e39d516317d005b4b917b1f1c6baf8d'

* commit '13df4bba7e39d516317d005b4b917b1f1c6baf8d':
Assign the state to the serviceState variable.
13df4bba7e39d516317d005b4b917b1f1c6baf8d 22-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Assign the state to the serviceState variable.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
376578a7c7201a7e3a922a8201b613372e29020c 22-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> am 34b9266f: Fix CDMA signal strength reporting.

Merge commit '34b9266fbd8c9c4d52e8faf708e02037a7ddcc4c'

* commit '34b9266fbd8c9c4d52e8faf708e02037a7ddcc4c':
Fix CDMA signal strength reporting.
34b9266fbd8c9c4d52e8faf708e02037a7ddcc4c 21-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Fix CDMA signal strength reporting.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
b01429c99653aef893ca3b9a92a85ab31ae85bc0 20-Jul-2009 Wink Saville <wink@google.com> DO NOT MERGE - Fix CDMA call-waiting accept issue with BT headsets

Fix issue on CDMA where attempting to answer a CallWaiting call from a BT
headset would drop the active call, miss the incoming call, and freeze
the incall UI on incoming screen.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a76113dcb0def438d0b3019aeb88fdbfbfbe90d4 16-Jul-2009 Paul Berman <paul.berman@motorola.com> Fix CDMA call-waiting accept issue with BT headsets

Fix issue on CDMA where attempting to answer a CallWaiting call from a BT
headset would drop the active call, miss the incoming call, and freeze
the incall UI on incoming screen.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
19dd8f9c63ba7471c76fc31847a8063d18a83b6d 13-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Rename registerPhoneStateChange to registerPreciseCallStateChange

As registerPhoneStateChange was actually notifying CallStateChange,
rename appropriately.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
7757ebca8f27cd580bc85b6afe66ca43122b8c39 14-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Take the lock on the right object in the handler.

The handler was taking a lock on Handler instead of BluetootHandsfree.
So in some cases when the headset is disconnected, the SCO_CLOSED
event will set the mConnectedSco object to null, at the same time
when the disconnect thread is in audioOff code.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
1dad0387bf2f280c12bdac172604e9779134fbcd 13-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Check for phone state change.

There are two state change notifications - Call State change
and Phone State change. We register for Call State change,
and so when we get a notification Phone State might not have changed.
Hence, check for old Phone state change. This was causing a problem
with some headsets where we were sending updates twice.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
d2b5e78809bc2532b2377ba2c351d48710097c0c 07-Jul-2009 Nick Pelly <npelly@google.com> Fix HFP-dont-work-on-some-carkits bug. Send OK after AT+CHLD=?
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
0966f42d45611b961635c8d23fc4a4df0f5e29c4 24-Jun-2009 Nick Pelly <npelly@google.com> Do not establish audio until HFP service level connection is established.

This was causing compatability issues with some headsets such as Jabra 8040,
Plantronics 855, and Nokia 103 when connecting while in-call.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
404edc94de563aef5fd5ba48be9114a970cb93bb 18-May-2009 Wink Saville <wink@google.com> Teleca 2b changes.
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a69de9f9a2e99fe08f0009bb218b95ed7985c575 02-Apr-2009 Wink Saville <> AI 144185: Integrate cdma into the main code base.

Automated import of CL 144185
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
6967e2d953bc077c99c4831946201f3d333b833f 26-Mar-2009 Nick Pelly <> Automated import from //branches/donutburger/...@142766,142766
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
4b8337277ec2e375c3536b97c40e6617a7b12990 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake_rel/...@140373
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
4079f559beb3e414036056b4b33ad40de5e89c4a 13-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake_rel/...@138607
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
b16363f5fc191b769e88c364243e34b92eb22688 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
a412e78a7bba553a66503370b4c618db83528916 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
62f98540ff39eb68eea5e393d5a2ac61e412c313 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
0918cc33174eebee7ae13449a76a2fe48f84d6dc 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
56874fd9c8f91d484990a634396c809419f77547 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
bb1e6add51a1d0c4ed2ee63fd314503e8d62cdd8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java
abc47110c17fa8e8cb6161bc045e87f31eeb7a1c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/packages/apps/Phone/src/com/android/phone/BluetoothHandsfree.java