History log of /packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f4cc3112101d48b546464bfb8766e6d8d6e6ae14 06-Oct-2017 Tyler Gunn <tgunn@google.com> Fix NPE in TelecomManager#isOutgoingCallAllowed

There is a potential for a NPE if "excludeCall" is null. Adding null
check and unit tests to verify operation of the isOutgoingCallAllowed API,
as well as basic outgoing self-managed calls (which rely on this API).

Test: Added unit tests.
Change-Id: Ia5e92a7cb418af0d131daa2ca88b7cd4d36ab057
Fixes: 67495237
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
bcf23de07aed59ed34d0121a76d29b6ed9a14288 04-Aug-2017 Tyler Gunn <tgunn@google.com> Change getAgeMillis to use elapsed system time instead of wall-clock time.

Changing getAgeMillis to rely on SystemClock#elapsedRealtime() to determine
the duration of a call. This ensures that changes to the device time zone,
clock updates by the network and user initiated time changes to not
impact the duration of calls in the call log.

Test: Manual, unit
Bug: 64068300
Merged-In: I62924dc7889c86a7457d05f8fbb20ab8189ece1a
Change-Id: I62924dc7889c86a7457d05f8fbb20ab8189ece1a
(cherry picked from commit 6c3a2dd68c9ac5584f48cf5f62fa01896fccdc7d)
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d987c7e6979cb532f00d0eeaa247cda9ed3c185d 23-Aug-2017 Tyler Gunn <tgunn@google.com> Disconnect calls from other CS when hanging over to a self-mgd CS.

When handing over to a self-maanged ConnectionService, automatically
disconnect the other ongoing calls in other ConnectionServices.

Test: Manual
Change-Id: I4d5d51b2ec288fc4fd9c99751654c54f6c8539d6
Fixes: 63154841
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f7d32b57ef5e98a56a2e3960ae2f3636002bd55b 22-Jun-2017 Tyler Gunn <tgunn@google.com> Handle Telecom binder death.

There are instances where a ConnectionService dies, but we don't get the
onServiceDisconnected callback. This is most common in catastrophic
crashes of a ConnectionService. The result of this is that the calls
associated with that CS get orphaned in Telecom and never cleaned up.

Added a ServiceDeathRecipient implementation to ServiceBinder in Telecom
so that death of a CS is always caught.

Also made some logging changes to ensure we can more easily see when
a CS dies unexpectedly and why its calls were disconnected.

Fixed an issue where DtmfLocalTonePlayer was not finishing its subsession.

Test: Manual
Bug: 62912175
Change-Id: I5099592ec781af46c9d123ef2c53f48846b9ec19
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
845a677cc7ee462e7f8cb02b150c64edb3fcc528 23-Jun-2017 Tyler Gunn <tgunn@google.com> Send event when handover source disconnects prior to acceptance of handover.

When the source call disconnects prior to the acceptance of a handover,
send a call event so that the destination connection source is aware
of the fact the source disconnected. This ensures the destination is
able to either complete the handover (there are cases where a source can
disconnect prior to handover acceptance), or to abort the handover.

Test: Manual using test app
Bug: 62904673
Change-Id: I5b89113160e2697269ecbac7ef4f64844fd8a953
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8e3d34e45f8562ada80e022b7098f3eeb3adc313 22-Jun-2017 Tyler Gunn <tgunn@google.com> Merge "Audio routing fixes for handover scenarios." into oc-dr1-dev
a3198af063b309e14c2ca388a52dc30872f87ef2 22-Jun-2017 Tyler Gunn <tgunn@google.com> Merge "Ensure IMS conference participants have number presentation set." into oc-dr1-dev
b821f92b0b30e295091deb8b6beccaf293f00314 21-Jun-2017 Tyler Gunn <tgunn@google.com> Audio routing fixes for handover scenarios.

1) Change maybeMoveToSpeakerPhone so when initiating a handover to
a self-managed CS for a video call, we do not enter speakerphone until
the call goes active (this is when the handover is accepted). This
ensures we don't go to speaker even if the handover is rejected.
2) Modify processIncomingCallIntent to automatically go to speakerphone
on the receiving side of a handover once the call goes active.

Test: Manual
Bug: 37772102
Change-Id: I2617ff19681eec2a54faa210a5a73e8a29d6126c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
26d478f19c2433dde5329c69aa5b7f2558e1c6ae 20-Jun-2017 Tyler Gunn <tgunn@google.com> Ensure IMS conference participants have number presentation set.

When anonymous participants are added in an IMS conference call, the
number presentation was not set. Since the address is null it meant
they would be defaulted to UNKNOWN.

Fixed to ensure the number presentation is set as well.

Test: Manual
Bug: 62475520
Change-Id: I98fbbd0c0a04ef34e9b26d092d6b45fa226f9d7b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
59a314c44c0d5ad56c99943cfa26369b46665475 20-Jun-2017 Tony Mak <tonymak@google.com> Fix NPE when addingIncomingCall is called with null extras

Fix: b/62815961

Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest#testManagedCall

Change-Id: I3b460d8d5e005201ee08d78fa3d40a909c487c20
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
733c863ef28467113506394f5f26518f40b32045 16-Jun-2017 Tyler Gunn <tgunn@google.com> Merge "Fix to set audio mode for SIP call" into oc-dr1-dev
5b8facb5650b1f414353721697a2c85cf1d056c6 17-Feb-2015 Srikanth Chintala <srikchin@codeaurora.org> Fix to set audio mode for SIP call

Set the audio mode for sip call as
MODE_IN_COMMUNICATION if the phone
account has extra
EXTRA_ALWAYS_USE_VOIP_AUDIO_MODE with
true value.

Test: Manual
Bug: 34869196
Change-Id: I367fbfb05779f80ebde78cb8dcebeafa3f885b3b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7b05c99aab1577f705b412b9ec95aff855c60467 14-Jun-2017 Brad Ebinger <breadley@google.com> Merge "Fixes some of the flakiness in Telecom" into oc-dr1-dev
141ef5805d18b0c8b71d2a50f77837e719672569 26-May-2017 Tyler Gunn <tgunn@google.com> Call handover improvements

- Set handover_from attribute when initiating a handover to another phone
account. This lets the recipient know where the call is coming from.
- Replace "handover successful" indicator on calls with a handover state.
This ensures there is sufficient state to ensure that if a call is
hung up before the handover is accepted that we don't treat that hangup
as if the handover was successful.
- Ensure failed handovers are not logged.
- Prevent EXTRA_IS_HANDOVER from being set for outgoing calls.

Test: Unit, Manual
Bug: 37977155
Bug: 38027075
Change-Id: Ie5240c28163714be71825e718daa560eb568330f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7bba1112556e122254013562650aac6a6af80ac6 08-Jun-2017 Brad Ebinger <breadley@google.com> Fixes some of the flakiness in Telecom

- Fixes some flakiness in the tests
- Mocks out the ToneGenerator

Test: Run Telecom Unit Tests
Change-Id: If3bd51fe4a82068cc0d712d2e499abde4fdb0481
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
420e19e53331f8ffa5c2807d28991e8dd5d5a58f 01-Jun-2017 Tyler Gunn <tgunn@google.com> Merge "Fix lack of notification of un-parent on disconnecting conference child." into oc-dev am: a32bdf7289
am: c7ab7a366b

Change-Id: I1b1722d2268804aed9dc82d96971143fe34d2097
c7ab7a366bfd0322133fa12ed50a289d67be4a9c 01-Jun-2017 Tyler Gunn <tgunn@google.com> Merge "Fix lack of notification of un-parent on disconnecting conference child." into oc-dev
am: a32bdf7289

Change-Id: I8db5151004940974b5638ad689659473fcd82895
988ccc80cafa46fcb28a74bb487fbd5a6ae7e1fc 01-Jun-2017 Tyler Gunn <tgunn@google.com> Fix lack of notification of un-parent on disconnecting conference child.

As a consequence of recent changes to improve efficiency of IMS conferences,
there was a regression when unparenting a child of a conference when it
was disconnected. We would neglect to send the connection event notifying
the InCallService of the change in parent for the call.

To fix this I split notifying of parent change into a new method which
is called in the right place for the "add existing call" case, and also
from within setParentAndChildCall. This actually reads nicer and we're
no longer sending this from setChildOf.

Test: Manual, ran CTS, ran unit tests
Bug: 62236503
Change-Id: Ie59a00a39c2ebeee44a81c2db6edf2968fa5b643
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
15bd6917198449eb47491a4df43fc1631d5a30d1 25-May-2017 Tyler Gunn <tgunn@google.com> Merge "Add ability to set parent at the same time as adding a connection." into oc-dev am: 60da84f041
am: 2d932458bc

Change-Id: I46ba03b854d6ddbd50c9862f38b525c21b2b72c7
2d932458bcc0ce43bec9425523ad036794a95c0e 25-May-2017 Tyler Gunn <tgunn@google.com> Merge "Add ability to set parent at the same time as adding a connection." into oc-dev
am: 60da84f041

Change-Id: I8312190ea419e8141f269468ca5fd23b694e72e5
7658171d6d496686263d0fc9da55a0ed7a61f818 09-May-2017 Tyler Gunn <tgunn@google.com> Add ability to set parent at the same time as adding a connection.

This is used when adding the children of IMS conferences to prevent jank
in the UI.

Test: Manual
Bug: 37581781
Change-Id: I5effdcfaa51fcdf85155ab6bedffdb20270cccb5
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
064bd03121b8f2f326bb115930db0232c09c4cb9 11-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove auto-DND while in call." into oc-dev
15d096bd78c71959651d71a8981b9f89520537bc 04-May-2017 Tyler Gunn <tgunn@google.com> Fix issue where incoming call shows up while handing over call.

Fixing issue where the "Answering will end your other call" UX shows up
while a handover is in process. This was a race-condition which could
happen when the handover is marked as success and the incoming handover
call is not yet active.

Solved by tracking in a Call whether it has successfully handed over or
not. Using this to filter the call out from IncomingCallNotifier.

Test: Manual
Bug: 37768995
Change-Id: I8eeacb88c0c38953f1e4709ea5777c005cbeaf39
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9daa42dceb2d8fe3d7fad7fde6cc7d8a9aa0fb97 03-May-2017 Tyler Gunn <tgunn@google.com> Merge "Confirm managed call when there are ongoing self-managed calls." into oc-dev
am: ba03779236

Change-Id: Ie9c99152af59dab4225a911285fcd6005248a1d6
c723d7d14adbdddcdcc92cbbb3ac4ab7dbd2a563 03-May-2017 Tyler Gunn <tgunn@google.com> Merge "Do not send call event if handover call has no ConnectionService bound."
754dc5de096b43b83154866e70676c6b84226824 30-Apr-2017 Tyler Gunn <tgunn@google.com> Confirm managed call when there are ongoing self-managed calls.

When the user places a managed call while there are ongoing self-managed
calls, the system will now display a dialog giving the user the option of
NOT placing the managed call, or placing the managed call and disconnecting
the ongoing self-managed call(s).

This is done by stopping the outgoing call during startOutgoingCall and
bringing up a dialog to confirm whether the user wants to place the call.
If they chose to place the call, ongoing self-mgds calls are disconnected,
the call is added, and the NewutgoingCallBroadcast is sent as usual.

If the user chooses not to start the call, the call is cancelled.

Test: Manual
Bug: 37828805
Merged-In: I8539b0601cf5f324d2fb204485ee0d9bbf03426d
Change-Id: I8539b0601cf5f324d2fb204485ee0d9bbf03426d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e1cab751c50c0734b0ea0072e711868405f23545 02-May-2017 Tyler Gunn <tgunn@google.com> Do not send call event if handover call has no ConnectionService bound.

If the handover TO ConnectionService returns a null Connection, failing
the handover, Telecom will still try to report to the "to" Connection
that the handover failed, when it is in reality not possible to report
that.

Adding a null CS check when sending this CallEvent.

Test: Manual
Bug: 37896563
Change-Id: I4e041dade46de173247ea6110b9da0e356af606b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
bbd78a76f8a3d103018474ecd52bead71cd5fc5a 30-Apr-2017 Tyler Gunn <tgunn@google.com> Confirm managed call when there are ongoing self-managed calls.

When the user places a managed call while there are ongoing self-managed
calls, the system will now display a dialog giving the user the option of
NOT placing the managed call, or placing the managed call and disconnecting
the ongoing self-managed call(s).

This is done by stopping the outgoing call during startOutgoingCall and
bringing up a dialog to confirm whether the user wants to place the call.
If they chose to place the call, ongoing self-mgds calls are disconnected,
the call is added, and the NewutgoingCallBroadcast is sent as usual.

If the user chooses not to start the call, the call is cancelled.

Test: Manual
Bug: 37828805
Change-Id: I8539b0601cf5f324d2fb204485ee0d9bbf03426d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1e6864ed8822880578a414692f59f215e9d31902 27-Apr-2017 Tyler Gunn <tgunn@google.com> Merge "Further call handover changes."
6f6f1c51c0675a67ef7d7e6ea9264429a4cb269d 18-Apr-2017 Tyler Gunn <tgunn@google.com> Further call handover changes.

Support logging self-managed calls based on PhoneAccount extra.
Support passing handover extras to the handover connection service.
Improve signalling to handover initiator on fail/success of hanndover.

Test: Manual
Bug: 37102939
Change-Id: Idd23d1f3489a640666ef20d51ed18e5b80028726
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
cca957f37bf851c10767db541eb87f3150370702 11-Apr-2017 Tyler Gunn <tgunn@google.com> Remove auto-DND while in call.

Removing the auto DND functionality while in a call.
This functionality is being phased out due to b/28688969.

Test: Unit/Manual
Bug: 37154069
Merged-In: I5690116fc6a3938e7725a4b2963741885ddc8ac0
Change-Id: I5690116fc6a3938e7725a4b2963741885ddc8ac0
(cherry picked from commit daeffaf3dbcfadfcb58b07a56169982eacb697db)
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
daeffaf3dbcfadfcb58b07a56169982eacb697db 11-Apr-2017 Tyler Gunn <tgunn@google.com> Remove auto-DND while in call.

Removing the auto DND functionality while in a call.
This functionality is being phased out due to b/28688969.

Test: Unit/Manual
Bug: 37154069
Change-Id: I5690116fc6a3938e7725a4b2963741885ddc8ac0
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
983fe0e53a85e161b31404e92b26d900ca581b19 18-Apr-2017 Orion Hodson <oth@google.com> Fix duplication of CALL_ constants

From merges of baf105bf8 and 4a05d5cc0.

Test: m -j32

Change-Id: I115d78d6c840ac97922ea44cff53a1508dd57849
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6be3fbc46d7885200c0144cab404c0426b628ec6 18-Apr-2017 Tyler Gunn <tgunn@google.com> DO NOT MERGE Ensure TelecomManager#isIncall returns true when in phone acct selection.
am: 4a05d5cc0a

Change-Id: I7b2140754937416029d58a7fb989c414150091f7
4a05d5cc0acedb616ff6d22151f4ccf0043f0810 15-Apr-2017 Tyler Gunn <tgunn@google.com> DO NOT MERGE Ensure TelecomManager#isIncall returns true when in phone acct selection.

Cherry-pick from AOSP-Master.

am: baf105bf8b am: 82fafefe96 am: 75256f10e7
am: f6318ddade

Test: Manual
Bug: 34469716
Merged-In: Iec7e77bfbf2f0e493d8cc21187baca6a0a7d032d
Change-Id: Iec7e77bfbf2f0e493d8cc21187baca6a0a7d032d
(cherry picked from commit 44c54a2eda27f59219e078067efe1d68ee034aaa)
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0409b98501a5b4c0c00d1cad8f9a33185e1888c2 15-Apr-2017 Tyler Gunn <tgunn@google.com> resolve merge conflicts of 334108b08 to oc-dev-plus-aosp

Test: Manual
Change-Id: I6323bf1842cbefd5aa7a099fcc93e535d871eb52
3a04bdbd0ec0b970a3fa932b8de4f074d2faa417 14-Apr-2017 Tyler Gunn <tgunn@google.com> DO NOT MERGE Send PhoneAccount register/unregistered intents to default dialer.

A few cleanups:
1. When sending the register/unregister phone account intents, previously
there was no attempt made to ensure the intents were only sent when a
new account was added, or an existing one was removed. Cleaned this up
so that we don't over-send the intents.
2. Minor fix to account diff string in PhoneAccountRegistrar which would
cause icon to always be shown as a diff; removed since bitmaps can't be
compared.
3. Also sending the intents to the default dialer app as an explicit
intent.
Cherry-pick from aosp master to resolve conflicts.

Test: Manual
Bug: 37106957
Change-Id: I7fdaa3e225df6fe3aaf292f9b0b93042f69ca469
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0edfc66ef6c5c218f26601474bb3958a7958075b 14-Apr-2017 Tyler Gunn <tgunn@google.com> Send PhoneAccount register/unregistered intents to default dialer.

A few cleanups:
1. When sending the register/unregister phone account intents, previously
there was no attempt made to ensure the intents were only sent when a
new account was added, or an existing one was removed. Cleaned this up
so that we don't over-send the intents.
2. Minor fix to account diff string in PhoneAccountRegistrar which would
cause icon to always be shown as a diff; removed since bitmaps can't be
compared.
3. Also sending the intents to the default dialer app as an explicit
intent.

Test: Manual
Bug: 37106957
Merged-In: I7fdaa3e225df6fe3aaf292f9b0b93042f69ca469
Change-Id: I7fdaa3e225df6fe3aaf292f9b0b93042f69ca469
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
ea4c6fb7dc46c96b5ecf2c2b81bce51fa58d774c 14-Apr-2017 Tyler Gunn <tgunn@google.com> Send PhoneAccount register/unregistered intents to default dialer.

A few cleanups:
1. When sending the register/unregister phone account intents, previously
there was no attempt made to ensure the intents were only sent when a
new account was added, or an existing one was removed. Cleaned this up
so that we don't over-send the intents.
2. Minor fix to account diff string in PhoneAccountRegistrar which would
cause icon to always be shown as a diff; removed since bitmaps can't be
compared.
3. Also sending the intents to the default dialer app as an explicit
intent.
Cherry-pick from aosp master to resolve conflicts.

Test: Manual
Bug: 37106957
Change-Id: I7fdaa3e225df6fe3aaf292f9b0b93042f69ca469
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
44c54a2eda27f59219e078067efe1d68ee034aaa 15-Apr-2017 Tyler Gunn <tgunn@google.com> Ensure TelecomManager#isIncall returns true when in phone acct selection. am: baf105bf8b am: 82fafefe96 am: 75256f10e7
am: f6318ddade

Change-Id: Iec7e77bfbf2f0e493d8cc21187baca6a0a7d032d
f6318ddade2ba6ad03de3e321b6ab1b5b81a01ff 15-Apr-2017 Tyler Gunn <tgunn@google.com> Ensure TelecomManager#isIncall returns true when in phone acct selection. am: baf105bf8b am: 82fafefe96
am: 75256f10e7

Change-Id: If13e76bca6899a5f858686188b01df03756f75a3
baf105bf8b27ebb87887632f8227c71cf9d8ce86 12-Apr-2017 Tyler Gunn <tgunn@google.com> Ensure TelecomManager#isIncall returns true when in phone acct selection.

Change TelecomManager#isInCall to return true when a call is in phone acct
selection. Also modify isInManagedCall to be consistent in which states
it checks.

Test: Unit, manual
Bug: 34469716
Change-Id: If969015b24348d96c74622a2790bd3d742401dc6
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6f9ceb2c1fbb9565cc6f6fdf32e996e8a1eab7c8 06-Apr-2017 Tyler Gunn <tgunn@google.com> Support Connection handover between ConnectionServices.

Call:
- added support for initiation of handover on receipt of the
EVENT_REQUEST_HANDOVER call event.
CallAudioManager:
- suppress disconnect tone when handover is in process for a call.
CallsManager:
- when the ConnectionService adds a new incoming call with
EXTRA_IS_HANDOVER, this indicates that the call is being added as the
destination for the handover. Adding logic to find the ongoing call on
the device which will be handed over to this new call, and confirm that
handover is supported by both ConnectionService.
- on call removal, clean up handover call references.
- When calls change state, handle completion or failure of overall
handover.
- ensure it is possible to add handover calls when there are other ongoing
calls which would normally prevent them from being added.
TestApps:
- Added ability to initiate handover from Test Incall UI.
- Added ability to receive handover from test self-mgd calling app.

Test: Manual
Bug: 37102939
Change-Id: Idfa4325bb1aee34abad5cdb3d8edb48f0186692e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e0d7233f24a808e61e16f49881292269b2669583 31-Mar-2017 Tyler Gunn <tgunn@google.com> Merge "Self-Managed Incoming Call Disambiguation UX." am: b77f30fa1f am: be4ff39882
am: c6e9cba5a9

Change-Id: I6f186038a14efe86d31bcc4616f194dd40b1981f
ca766d28471cc41d9ef33682a41edd1f99448d42 08-Mar-2017 Tyler Gunn <tgunn@google.com> Self-Managed Incoming Call Disambiguation UX.

- Handle auto-disconnect of foreground call when answering a self-managed
call.
- Enforce restriction that the PhoneAccount associated with a self-managed
CS must have a label which is the app's name.
- Ensure self-managed phone accounts can't be registered with
call provider, connection manager, or sim sub capabilities.
- Add "incoming call" UX which is shown when a new incoming call from a
self-managed CS comes in and there is an existing call for another CS.

Test: Unit, manual
Bug: 34159263
Merged-In: I371be9baa6f56c77aa83349977c0131f0e319047
Change-Id: I371be9baa6f56c77aa83349977c0131f0e319047
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
be4ff39882a2009b5e48ed6ca9cf79c6000bf048 31-Mar-2017 Tyler Gunn <tgunn@google.com> Merge "Self-Managed Incoming Call Disambiguation UX."
am: b77f30fa1f

Change-Id: I213b0d78a647086ce3bfa4728e4445854ab45e45
2b17f23d3257dec66d965ac7b4a59aa2226b43a5 08-Mar-2017 Tyler Gunn <tgunn@google.com> Self-Managed Incoming Call Disambiguation UX.

- Handle auto-disconnect of foreground call when answering a self-managed
call.
- Enforce restriction that the PhoneAccount associated with a self-managed
CS must have a label which is the app's name.
- Ensure self-managed phone accounts can't be registered with
call provider, connection manager, or sim sub capabilities.
- Add "incoming call" UX which is shown when a new incoming call from a
self-managed CS comes in and there is an existing call for another CS.

Test: Unit, manual
Bug: 34159263
Change-Id: I371be9baa6f56c77aa83349977c0131f0e319047
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b36f7abf80b46e2c4c9b1493975430754d58e570 15-Mar-2017 Srikanth Chintala <srikchin@codeaurora.org> Held Conference call should not be automatically resumed am: 5bf7502170 am: c029061232
am: 2cbe545d7e

Change-Id: Idc062d0363d8f4b1c50b99859eb81ed27ad8bedf
c029061232d28ded896368ff15a458138ee41d0d 15-Mar-2017 Srikanth Chintala <srikchin@codeaurora.org> Held Conference call should not be automatically resumed
am: 5bf7502170

Change-Id: I32b16b41616ed985cabfe89866a76f2882812a88
5bf75021706e526ab1d8afafc3ce992f8bc84196 03-Feb-2017 Srikanth Chintala <srikchin@codeaurora.org> Held Conference call should not be automatically resumed

While removing call, if the forground call is in hold, then
CallsManager in Telecom is trying to resume the call.
foreground call should not be resumed when the disconnected
call was one of the conference call. So, other calls state
will remain same as before.

Test: manual - conference call scenarios
Bug: 34830478
Change-Id: I27a1d4fa09d4dd8e6dbb78d2fe60efe1b230e0e6
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0a23cd2c97366ffb5d9b43c4ead5d2b65df62ef7 13-Mar-2017 Hall Liu <hallliu@google.com> Merge "Fix unit tests and coverage" am: 1414f0e89d am: f003ab8a49
am: aa816b1517

Change-Id: I410e707cd9971ead3831738343566ab7e0e79fd0
f003ab8a49e5602f4c957ef130e49a3068e89119 13-Mar-2017 Hall Liu <hallliu@google.com> Merge "Fix unit tests and coverage"
am: 1414f0e89d

Change-Id: I2f64ced00c8bfd0da1733c66f64ec80a2a6d7176
5b8551ef79dc6e31bd945380097c13ff18b37359 11-Mar-2017 Hall Liu <hallliu@google.com> Fix unit tests and coverage

1. Fix the NPE that happened because hasVideoCall in CallsManager was
not visible to the unit tests
2. Add additional env variables to ensure that emma is in the classpath
when generating code coverage

Test: unit tests
Change-Id: Ibd621267b4af4e20c41458eb674fd120ca0a1859
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9f0b884fbd811e688441335a16c32cba921632ca 10-Mar-2017 Hall Liu <hallliu@google.com> Remove old pending calls if not reused am: 10139b2da3 am: 999194b20e
am: 15a2b01441

Change-Id: I8ed9cc249d174c000328c3432ca0ba6d48a823c7
999194b20e0234cfd2a4dbd2a4ba2579742ba45d 10-Mar-2017 Hall Liu <hallliu@google.com> Remove old pending calls if not reused
am: 10139b2da3

Change-Id: I152cddeee93ea28c63d33c420b4f68ab1d877b9b
10139b2da372d561b639613031d8add781b29d0c 07-Mar-2017 Hall Liu <hallliu@google.com> Remove old pending calls if not reused

When trying to make an outgoing call, remove all of the pending outgoing
calls from the iterator if we're not going to use them again.

Test: manual
Bug: 33842702
Change-Id: I414624172b74772fa9a75626e6675afead5b6ee4
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e4ecf59caf4301c74c3c15befbcc31c1660c603b 07-Mar-2017 Hall Liu <hallliu@google.com> Implement mid-call RTT initiation and teardown
am: b8b5a6976b

Change-Id: Ifa7fb93be70faacf4e7545fcc354cc2e60427ff7
b8b5a6976b44f92494971672ca3c1e6a71974d54 15-Feb-2017 Hall Liu <hallliu@google.com> Implement mid-call RTT initiation and teardown

Adds functionality to testapps and to framework to allow for local and
remote initiation and disconnection of RTT.

Test: manual
Merged-In: I0e8248b495a7d3750c840591f1fa5388b34a32e2
Change-Id: I0e8248b495a7d3750c840591f1fa5388b34a32e2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d5d7f034a08d85fdc58fa85059187a7144cfe7d1 07-Mar-2017 Hall Liu <hallliu@google.com> Merge "Implement mid-call RTT initiation and teardown"
df4d6471b20137d0bf3ae66d8ae12c42c5ece6eb 02-Mar-2017 Tyler Gunn <tgunn@google.com> Support for InCallServices receiving self-managed calls. am: 37e782b421 am: 3e62d5863c
am: 5fe85030aa

Change-Id: I20ffcace93257bfda07654d52af15a9c67d191ef
aeece4ec4184b76e0ac2e8a012af05638ad866f6 15-Feb-2017 Hall Liu <hallliu@google.com> Implement mid-call RTT initiation and teardown

Adds functionality to testapps and to framework to allow for local and
remote initiation and disconnection of RTT.

Test: manual
Change-Id: I0e8248b495a7d3750c840591f1fa5388b34a32e2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
3e62d5863cce97190012940cf7e85ce15f34d83e 01-Mar-2017 Tyler Gunn <tgunn@google.com> Support for InCallServices receiving self-managed calls.
am: 37e782b421

Change-Id: I519842bbd25d7e4b805c3c478515d0c305ae3628
37e782b421f63a81bfae1efaa1eb01f0fbdd7abf 10-Feb-2017 Tyler Gunn <tgunn@google.com> Support for InCallServices receiving self-managed calls.

Also adding isInManagedCall telecomManager API.

Test: Manual, CTS
Bug: 34159263
Change-Id: I2e30cf2800b7febf56566755f7b97e4ad46ec1ad
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
cabfa813b4866c34e9abc708fceab73167849810 01-Mar-2017 Hall Liu <hallliu@google.com> Merge "Redo DtmfLocalTonePlayer" am: f9592be953 am: 5faa4d15a0
am: 936fd6208f

Change-Id: I5f9f51a46b9ac3ab9d9afedcb84957b541b1fce4
5faa4d15a096a0bc98e308afbda32a1bffdbf3be 01-Mar-2017 Hall Liu <hallliu@google.com> Merge "Redo DtmfLocalTonePlayer"
am: f9592be953

Change-Id: I8db00beccda8ba4500d8e907c984b9c1971f832b
5507671b2ecba6c2e2de7df1a2177776f4a8db46 01-Mar-2017 Hall Liu <hallliu@google.com> Redo DtmfLocalTonePlayer

The system of locks in DtmfLocalTonePlayer and the constant thread
creation/destruction seems to be behind a system ANR bug. This change
refactors the class to rely on a single Handler and associated
HandlerThread that lives for the entire duration of Telecom.

Bug: 34886553
Test: manual and unit
Change-Id: I1d86c644aaecdb6ff93d31e2b9e97792e3e301e0
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
86f417aa84995ffba44ea98b32d5ba4ee338aa6f 22-Feb-2017 Hall Liu <hallliu@google.com> Add support for RTT calls (part 1) am: dd68bc36a3 am: 399f7e50b0
am: 1d36154ab9

Change-Id: Id768015a354c9a3428b4c817507d058df6ea15f7
399f7e50b0e2f58f010dc0704e98b67787106097 22-Feb-2017 Hall Liu <hallliu@google.com> Add support for RTT calls (part 1)
am: dd68bc36a3

Change-Id: Ie33cd4a343bd306836f7e23edd33cb2da07f6157
dd68bc36a3278557b1c4d9183ed9e3dee077eb20 26-Jan-2017 Hall Liu <hallliu@google.com> Add support for RTT calls (part 1)

Adds logic for handling RTT call initiation and communication with the
InCallService and the ConnectionService and includes changes to the
testapps that exercise this functionality. This change handles RTT
initiation from the beginning of a call.

Change-Id: I3d713b662a100b2e0ad817b92005f044bcc60c62
Test: manual, through testapps
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f4fc3e0fc4178c2b7748fb0be0465d66383b1237 15-Feb-2017 Hall Liu <hallliu@google.com> Merge "Accept timeout from apps requesting call disconnect" am: b2d915147c am: f8a3007b8d am: fa72ae2e73
am: 1482b899c5

Change-Id: I95fd852526c18ad0cb9f4c1e84c9b553858f7129
fa72ae2e735ae333581cd09aca1a8f7bd843ab02 15-Feb-2017 Hall Liu <hallliu@google.com> Merge "Accept timeout from apps requesting call disconnect" am: b2d915147c
am: f8a3007b8d

Change-Id: I60b6b6520c4ad0abee9ff8b328e34ccb9bd51c7d
63e690cba4c50577c6dcfc98ca1d7e5f1b1fc3c4 15-Feb-2017 Hall Liu <hallliu@google.com> Accept timeout from apps requesting call disconnect

When processing a call disconnected via the ACTION_NEW_OUTGOING_CALL
broadcast, use the timeout specified by the app instead of the default
timeout. This allows apps that may take a bit longer to place a new call
some more time if they need it.

This also changes the default timeout to 500ms and sets a max timeout of
10s for an app-specified timeout.

Bug: 34474757
Test: manual, unit
Change-Id: I1b535f17aefffe423cfbc2cb1d42352e8f4b57f0
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
90b7645af4b13f24ab923f594d6024e1f8170b25 08-Feb-2017 Tyler Gunn <tgunn@google.com> When setting camera, ensure calling user is the same as logged in user. am: d8a27d5fc7
am: 05a2ac2df1

Change-Id: I944074c727e93e66bf758ed0eea56cc4f8b6c63f
8625297e25ebd382f65024b7a33659c2410fd648 08-Feb-2017 Tyler Gunn <tgunn@google.com> Merge "Self-managed CS implementation continued." am: 13378b9966 am: 3bc084188e am: f9ce9ef8b7
am: f6bee08284

Change-Id: Iab916c7d79dde1b8549d1b5a2afa50773d2ef9da
d8a27d5fc787f8839d3185f2b9137a8c2f1d68a0 01-Dec-2016 Tyler Gunn <tgunn@google.com> When setting camera, ensure calling user is the same as logged in user.

When the VideoProvider API is used to change the camera, in addition to
performing permission checks on the caller, adding logic to ensure that
the calling UserHandle is the currently logged in User (this is to ensure
that a background app can't access the camera).

Test: Unit, manual
Bug: 32747443
Change-Id: I0856f991c520dd1f5fa0146919941c052cba8a01
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f9ce9ef8b7169a71adc29c846bec5a892b9d34e1 08-Feb-2017 Tyler Gunn <tgunn@google.com> Merge "Self-managed CS implementation continued." am: 13378b9966
am: 3bc084188e

Change-Id: If4f66d61ed0d83d46c931906adeef5248b831347
9e806ee181a8422040f51b06effd433c9675a66f 07-Feb-2017 Tyler Gunn <tgunn@google.com> Self-managed CS implementation continued.

As I wrote the CTS tests, I ran into a few cases that needed to be handled
properly.

1. When attempting to register a self-managed CS, if the caller has included
property call provider, sim sub, or connection mgr, we throw a security
exception.
2. Added implementation for the wait-on-handlers telecom command.
3. Prevent logging of self-managed calls.

Test: Manual, CTS
Bug: 34159263
Change-Id: Ia239c4f64411bbdd184a479170d2d9df75667c0f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f7a93647b0242397143ba1f47f8b5342befa9423 06-Feb-2017 Tyler Gunn <tgunn@google.com> resolve merge conflicts of 77f7b2c92 to nyc-mr1-dev-plus-aosp

Test: Fix merge conflict.
Change-Id: Iea6ad814af2b7d0d7ebfab5ee507064a645cc572
9517c960762f1ac4a3c558ff834fa1ace69f1e39 26-Jan-2017 Tyler Gunn <tgunn@google.com> Self Managed CS implementation.

Implementation for self-managed connection service APIs.

Add ability for self-managed CS to:
- register a phone account and have it be auto-enabled.
- add ability for self-managed calls, ensuring only self-manage calls
can be added.

Add implementations for new isXCallPermitted APIs.
Filter self-managed calls from InCallServices.
Ensure self managed connection creation doesn't use emergency call CS.
Add ability to set audio route from self-managed connection
Overhaul some of the CallsManager getCallsWithState methods to support
other use cases for self-managed calls (also use steams/filters.. Ooo aah)

Test: Manual
Bug: 34159263
Merged-In: I3131fd48ee5c5aa36c0e88992fa51879af07d495
Change-Id: I3131fd48ee5c5aa36c0e88992fa51879af07d495
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
afb17686fc097aae2e12d17bd8404aa43956b51e 18-Oct-2016 Tyler Gunn <tgunn@google.com> Fixes for IMS Conferences via the RemoteConnectionService API.

IMS Conferences are problematic to Telecom when a connection manager is
used. Both addExistingConnection and addConference will result in the
addition of duplicate conference participants and conferences to Telecom.
This is because Telecom does not have a means of de-duping the two, which
have new IDs created for them when they're added via a ConnectionService.

To fix this, added a workaround which packages the original existing
connection or conference id into the connection/conference extras which
are sent to the connection manager. This way, the connection mgr can use
the same connection/conference ID was was used by the original
ConnectionService, and also perform some de-duping.

Its not optimal, and this should be fixed better in the future.

Bug: 31464792
Change-Id: I7b63f145c741c29e1735f50a473585f26ef70fc7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
a90ba73e6ca2e7e3ef88e41477bf595e03f9359f 26-Jan-2017 Tyler Gunn <tgunn@google.com> Self Managed CS implementation.

Implementation for self-managed connection service APIs.

Add ability for self-managed CS to:
- register a phone account and have it be auto-enabled.
- add ability for self-managed calls, ensuring only self-manage calls
can be added.

Add implementations for new isXCallPermitted APIs.
Filter self-managed calls from InCallServices.
Ensure self managed connection creation doesn't use emergency call CS.
Add ability to set audio route from self-managed connection
Overhaul some of the CallsManager getCallsWithState methods to support
other use cases for self-managed calls (also use steams/filters.. Ooo aah)

Test: Manual
Bug: 34159263
Change-Id: I3131fd48ee5c5aa36c0e88992fa51879af07d495
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
96e726920f5080c94e867bd2702c5bbdc85a6fd3 19-Jan-2017 Tyler Gunn <tgunn@google.com> Merge "Add self-managed connection service API." am: 9f07a4ece2 am: b48c611c36 am: 8e118cc092
am: 1dda0ee0d7

Change-Id: Ic1188106c7fef22db58a244094766510a646a644
8e118cc092d6aabe55058e7bad661eaeaa1dd747 19-Jan-2017 Tyler Gunn <tgunn@google.com> Merge "Add self-managed connection service API." am: 9f07a4ece2
am: b48c611c36

Change-Id: Icf49d1e7f744be9854e024c4d1770af30b055325
acb3bc8474e7cdb9c6ef4f0b23c227f6ed55d356 09-Jan-2017 Tyler Gunn <tgunn@google.com> Add self-managed connection service API.

Beginning of required changes to support self-managed CS.
1. Ensure self-managed connections have PROPERTY_SELF_MANAGED set.
2. Plumb through setAudioRoute API from connection.
3. Ensure self-managed phone accounts are auto-enabled.
4. Stub out new TelecomManager APIs.

Test: Manual; cts and unit tests will come in future CLs.
Bug: 34159263
Change-Id: I8352b2e2e3f9424ac1b612280c1b0cdca006afdb
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
66f26d1745238d6c29b3e0b18fb80cdd57b84676 19-Dec-2016 mike dooley <mdooley@google.com> Add last emergency call time to ConnectionRequest and Call

This can be used to determine if a call is a potential emergency callback.
This cl also renames the EmergencyLocationHelper class to EmergencyCallHelper
since its not just used for location anymore.

This change greatly simplifies the emergency callback handling in the DialerConnectionService
since it will not be able to directly listen for emergency call broadcasts in O.

This cl is dependent on ag/30952524

Bug: 30952524
Test: Added unit test to BasicCallTests and manual testing with real device
Change-Id: I43513c56b92f978f0a70be878a9430aec74ea77f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
14e947bd6aacd8b7abd438a66a76841a33cb5cf7 05-Jan-2017 Hall Liu <hallliu@google.com> Replace BluetoothManager (multi-hfp part 3) am: 486cb197d4 am: d1b47792e1 am: ac935c47e1
am: b794cfc1f6

Change-Id: Ic9f9110f752a9ca240a94757220647b6762003ee
ac935c47e1be3757af32bbe900cb5886a1ae51bc 05-Jan-2017 Hall Liu <hallliu@google.com> Replace BluetoothManager (multi-hfp part 3) am: 486cb197d4
am: d1b47792e1

Change-Id: I6fda12d25190b09969e8d83140ad88668a19558a
486cb197d4426a0f740b1c73ba3acdc76b3d67d3 22-Oct-2016 Hall Liu <hallliu@google.com> Replace BluetoothManager (multi-hfp part 3)

Replace BluetoothManager in the rest of Telecom with the functionality
of BluetoothRouteManager. Currently, the Bluetooth stack still
supports only one connected HFP device, so the new multi-device handling
has not yet been tested/verified except through unit tests.

Test: Manual testing
Change-Id: I19f3ab36386a67f797790394a5b5297786af8e77
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
14da17ff513c05e45c7f6c73b75a961014bd863b 21-Dec-2016 yifan.bai <yifan.bai@spreadtrum.com> Fix headset media button long press cannot reject call. am: fbafd9034a
am: 6de5288f63

Change-Id: If76eae8c3e9b9e8449e464e5b77b61ff6b8749f4
fbafd9034a635e95d2bec94681e062a851e37a42 21-Apr-2016 yifan.bai <yifan.bai@spreadtrum.com> Fix headset media button long press cannot reject call.

When making phone call with headset, another call incoming, long press
headset media button to reject new incoming call, call cannot be
rejected and first call will be muted. This is because SHORT_PRESS
should not be judged by ACTION_UP event's repeatCount which will be
always 0. Actually, ACTION_DOWN event's repeatCount only increases when
LONG_PRESS is performed.

Also, swapping SHORT and LONG press actions between MUTE and HANGUP to
match more of the existing devices.

Test: manual
Change-Id: I7a1270925f7148dac81fa5e58b232a886c57236a
Merged-In: I6ec28a2676a86cfa06819e297136ff413c14f169
Fix: 30012668
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
21fb1afe2e6ba030581ae8c94e377adf7c62877d 05-Dec-2016 mike dooley <mdooley@google.com> Grant temporary location permission to default dialer during emergency calls
(if it doesn't already have it). And revoke the permission after the call ends
(if it was granted).

Test: manual testing with real device
Change-Id: I578e4408f29cad67d560da730f06da0f5522c763
BugId: 30952524
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b4b190704925898789467a94f041723976558c9b 07-Dec-2016 Hall Liu <hallliu@google.com> Use DefaultDialerCache in Telecom (part 2)

Use the DefaultDialerCache throughout Telecom whereever the value of the
default dialer for a particular user is accessed or modified. Also moves
the DefaultDialerManagerAdapter to DefaultDialerCache since
TelecomServiceImpl no longer directly uses it.

Test: Unit tests and manual tests as specified in design
Change-Id: I61ee37f382f4b29266ce254a0e1f7db183e7a0bb
Merged-In: I5d8f46b4a236e570528425b4010976ac837644ac
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
2b33df76a3b7b43ae9fde36f73da11cb22954656 07-Dec-2016 Hall Liu <hallliu@google.com> Use DefaultDialerCache in Telecom (part 2)

Use the DefaultDialerCache throughout Telecom whereever the value of the
default dialer for a particular user is accessed or modified. Also moves
the DefaultDialerManagerAdapter to DefaultDialerCache since
TelecomServiceImpl no longer directly uses it.

Test: Unit tests and manual tests as specified in design
Change-Id: I61ee37f382f4b29266ce254a0e1f7db183e7a0bb
Merged-In: I5d8f46b4a236e570528425b4010976ac837644ac
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7c9283261ad4fdbc5ebbb74257671388f9c758c7 07-Dec-2016 Hall Liu <hallliu@google.com> Use DefaultDialerCache in Telecom (part 2)

Use the DefaultDialerCache throughout Telecom whereever the value of the
default dialer for a particular user is accessed or modified. Also moves
the DefaultDialerManagerAdapter to DefaultDialerCache since
TelecomServiceImpl no longer directly uses it.

Test: Unit tests and manual tests as specified in design
Change-Id: I5d8f46b4a236e570528425b4010976ac837644ac
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1bf0e6be00af0ca5731a52f0727c6d9a2f8b6944 01-Dec-2016 Tyler Gunn <tgunn@google.com> When setting camera, ensure calling user is the same as logged in user.

When the VideoProvider API is used to change the camera, in addition to
performing permission checks on the caller, adding logic to ensure that
the calling UserHandle is the currently logged in User (this is to ensure
that a background app can't access the camera).

Test: Unit, manual
Bug: 32747443
Change-Id: I0856f991c520dd1f5fa0146919941c052cba8a01
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
09620827b85239d8ffbf9b245b6d1ba0e10a0414 21-Oct-2016 Brad Ebinger <breadley@google.com> resolve merge conflicts of 953e1af to stage-aosp-master
am: 8f98f10d53

Change-Id: I154dddb3fb418f8921c015370863fe593e979e5b
8f98f10d53f4f7aa1605a37313a6186f90dc6c0e 21-Oct-2016 Brad Ebinger <breadley@google.com> resolve merge conflicts of 953e1af to stage-aosp-master

Test: Manual Testing
Change-Id: I3c8cac2c8b3634db7a20cceda434e6db6cdb05ca
aea58d361f334529bc45834c7c03fb4fad915961 20-Oct-2016 Brad Ebinger <breadley@google.com> Merge changes from topics 'logging_analytics_hooks', 'logging_switch'

* changes:
Adds EventManager and SessionManager callbacks for Analytics
Switch to using android.telecom.Log in Telecom
3081d0a303d890892bc9bdb21c149c39ba6fe4f1 20-Oct-2016 Tyler Gunn <tgunn@google.com> Fixes for IMS Conferences via the RemoteConnectionService API. am: 9b618b8bd0 am: 7997cba917
am: e6d1762bad

Change-Id: Iaacd3691e0d7256bccf0e945ed4719ee3462c195
e6d1762bad2fff92870094a8dc4cd01269661215 20-Oct-2016 Tyler Gunn <tgunn@google.com> Fixes for IMS Conferences via the RemoteConnectionService API. am: 9b618b8bd0
am: 7997cba917

Change-Id: I495d2447799626c7881a7da2b5c33478cc17e034
7997cba9178669fef8131b231d31dbc87681f564 20-Oct-2016 Tyler Gunn <tgunn@google.com> Fixes for IMS Conferences via the RemoteConnectionService API.
am: 9b618b8bd0

Change-Id: I4dac3565bef465eb4cad3f59cefa5eb487a7f528
953e1af643b66df6f931d76c23bcc54147668cd4 06-Oct-2016 Brad Ebinger <breadley@google.com> Switch to using android.telecom.Log in Telecom

Sorry.

Test: All affected unit tests still pass.
Bug: 26571395
Change-Id: I890d68d935cd554ba89042e99c155757697e1a37
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
a3eccfee788c3ac3c831a443b085b141b39bb63d 06-Oct-2016 Brad Ebinger <breadley@google.com> Switch to using android.telecom.Log in Telecom

Sorry.
CP from: https://android-review.googlesource.com/#/c/287332/

Test: Added unit tests for Log Sessions and Events. All other affected
unit tests still pass.
Bug: 26571395
Change-Id: I890d68d935cd554ba89042e99c155757697e1a37
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9b618b8bd0e3e216ee9d9df96bec0e1f8841aa14 18-Oct-2016 Tyler Gunn <tgunn@google.com> Fixes for IMS Conferences via the RemoteConnectionService API.

IMS Conferences are problematic to Telecom when a connection manager is
used. Both addExistingConnection and addConference will result in the
addition of duplicate conference participants and conferences to Telecom.
This is because Telecom does not have a means of de-duping the two, which
have new IDs created for them when they're added via a ConnectionService.

To fix this, added a workaround which packages the original existing
connection or conference id into the connection/conference extras which
are sent to the connection manager. This way, the connection mgr can use
the same connection/conference ID was was used by the original
ConnectionService, and also perform some de-duping.

Its not optimal, and this should be fixed better in the future.

Bug: 31464792
Change-Id: I7b63f145c741c29e1735f50a473585f26ef70fc7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f4cf57384ad9c4f9bc60ae2e7450b7ba1502bd48 14-Oct-2016 Wei Liu <luciferleo@google.com> Allow (silence rather than reject) the incoming call if it has a different source (connection service) from the existing ringing call when reaching maximum ringing calls. am: 13791b9280
am: 44590f4615

Change-Id: Ia77de584fa9823ae153b6a406cdb4d0b1274214f
44590f4615554a50762cd48aaa3f744f9cf94fe9 14-Oct-2016 Wei Liu <luciferleo@google.com> Allow (silence rather than reject) the incoming call if it has a different source (connection service) from the existing ringing call when reaching maximum ringing calls.
am: 13791b9280

Change-Id: I40c72473937af3d9f6121a6bfe4be0bd70c0253d
13791b9280deb7ea80c699f4b5e45faf661f66c5 05-Oct-2016 Wei Liu <luciferleo@google.com> Allow (silence rather than reject) the incoming call if it has a
different source (connection service) from the existing ringing call
when reaching maximum ringing calls.

b/31911886

Change-Id: If01a31763c16d8835583c70cb9f297c0c189a80e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
14295772c3c055e4b9b25b8b8e9c39a2b78f9a18 11-Oct-2016 Hall Liu <hallliu@google.com> resolve merge conflicts of 253b129 to nyc-mr1-dev-plus-aosp

Change-Id: I9d37a418982377eb1b94596998e22467d6c86402
8755e29fd54403b404b4940d3dccebf83a8acbcf 22-Sep-2016 Hall Liu <hallliu@google.com> Refactor and fix MissedCallNotifier

This change affects the behavior of the MissedCallNotifier on system
startup. Previously, MissedCallNotifierImpl created a new Call object
and used it to pull in contacts-related data. This created excessive
dependencies for MissedCallNotifierImpl, so it has been changed to use
CallerInfoLookupHelper.

Additionally, the at-boot notification has been broken for some time,
and this was due to the calls/contacts db not being ready when
TelecomSystem was initialized. This change also deferrs the missed call
lookup to when we receive ACTION_BOOT_COMPLETE.

Test: Added unit tests, tested manually on device
Change-Id: I10fe1c78e24484ece6b87fa986e725b00c753d39
Merged-In: Ibf8ec41d8d18b5ed7943a9520242f15bf546bda7
Fix: 30796667
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
3037ac6f171b6a3627494bb10042ab7adb34366a 22-Sep-2016 Hall Liu <hallliu@google.com> Refactor and fix MissedCallNotifier

This change affects the behavior of the MissedCallNotifier on system
startup. Previously, MissedCallNotifierImpl created a new Call object
and used it to pull in contacts-related data. This created excessive
dependencies for MissedCallNotifierImpl, so it has been changed to use
CallerInfoLookupHelper.

Additionally, the at-boot notification has been broken for some time,
and this was due to the calls/contacts db not being ready when
TelecomSystem was initialized. This change also deferrs the missed call
lookup to when we receive ACTION_BOOT_COMPLETE.

Test: Added unit tests, tested manually on device
Change-Id: Ibf8ec41d8d18b5ed7943a9520242f15bf546bda7
Fix: 30796667
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
2c2cc31144121128beb4442ec830fe8c5a7a39e4 19-Sep-2016 Tyler Gunn <tgunn@google.com> Prevent re-adding call disconnected before block check completes. am: 2ecfd88012 am: 881730b679
am: be5604b2f1

Change-Id: Ie0dbf80c2444f5cce6589d28cd2d5e3afb74b329
881730b67998cba466672906c456c92172bc6220 19-Sep-2016 Tyler Gunn <tgunn@google.com> Prevent re-adding call disconnected before block check completes.
am: 2ecfd88012

Change-Id: Ib2fea25d6a1f6a0496a88817c964230fce12ea6a
efc56d998ee6b106a28eb679df92f97566f245c6 19-Sep-2016 Tyler Gunn <tgunn@google.com> Prevent notification vibration when the user is on the earpiece. am: eaaf074d6b am: d610bb315d
am: d35c95ac54

Change-Id: I87cacf45ef0877b639f64e7c4c042155f84ab3d4
66cd16e92f1268c4e7446c2bab76afd0a461d8ea 19-Sep-2016 Tyler Gunn <tgunn@google.com> Merge "Prevent re-adding call disconnected before block check completes." into nyc-mr1-dev
d610bb315dbb2cebde2a7bcc63b05732c9df1c26 19-Sep-2016 Tyler Gunn <tgunn@google.com> Prevent notification vibration when the user is on the earpiece.
am: eaaf074d6b

Change-Id: I5c2e60268ecdf717782fac271163207dc0c670ce
ae07c43779a82f7ebf9a02933dc959be96286d3b 19-Sep-2016 Tyler Gunn <tgunn@google.com> Merge "Prevent notification vibration when the user is on the earpiece." into nyc-mr1-dev
2ecfd88012c0ddb79dabff7fcbbb87e7a3dbdd0f 17-Sep-2016 Tyler Gunn <tgunn@google.com> Prevent re-adding call disconnected before block check completes.

If call filtering completes AFTER a call is disconnected, it is possible
for the call to be re-added to telecom, which is not correct.

Bug: 31083479
Change-Id: I2053d1c7ea17fa634028bf3e118139f3ca342815
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
eaaf074d6b8b0b16fb922d8d511d6e8b979bfe0d 16-Sep-2016 Tyler Gunn <tgunn@google.com> Prevent notification vibration when the user is on the earpiece.

When the earpiece route is activated, if the user has not already enabled
a notification interruption filter, we will set it to alarms-only. This
ensures that notifications don't cause the phone to vibrate while in
earpiece mode.

If the user changes the interruption filter during the call we will keep
their new chosen filter when the earpiece route is disabled.

This notification filtering only takes place for the earpiece route.

Bug: 29962221
Change-Id: Ia332a988f10427a2a0f8315af9f31d854836db9f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
785785e4f85816188c19bc835047921e7abed616 14-Sep-2016 Tyler Gunn <tgunn@google.com> Ensure null ConnectionService references don't crash phone. am: 165ee7501f am: c8bb2bc553
am: 40253fcaa0

Change-Id: I0fe0f7ad9c2d584dce9d7ea79e5ffebf2bf24311
165ee7501fb1a13b5dcde1a9986426cfa0c93f4d 06-Sep-2016 Tyler Gunn <tgunn@google.com> Ensure null ConnectionService references don't crash phone.

- Modified Call logic to remove precondition asserts for mConnectionService
in favor of null check and error logging.
- Modify rejectCallAndLog to skip calling reject on the incoming call if it
is already destroyed. This is due to a call which was ended before the
call filtering completes.

Bug: 31236443
Change-Id: I0f93c65697a1b8e697a49118d642ecffe3dea130
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7983626aedfdbaa4f6c085210ba8ebf7f58ba5cc 01-Sep-2016 Hall Liu <hallliu@google.com> Skip call filtering when in ECB mode am: ddf3f9c445 am: b8d5a347ea
am: 9ab86fb1a2

Change-Id: Ibe6378eacff0388984581762560245a2ba3943db
b8d5a347ea1390c972d3ef1fc43cc119a27fa1e6 31-Aug-2016 Hall Liu <hallliu@google.com> Skip call filtering when in ECB mode
am: ddf3f9c445

Change-Id: Ifffed50873f9fae183092a0d4d02c1c7447cd3a3
cb3a48d08340ab92586635f5db9326c62bf3c7d2 31-Aug-2016 Hall Liu <hallliu@google.com> Merge "Skip call filtering when in ECB mode" into nyc-mr1-dev
de04141e6b875df0067ed7b7332c12d42a47b6af 31-Aug-2016 Hall Liu <hallliu@google.com> Merge "Fix headset media button long press cannot reject call."
ddf3f9c445699db2034da580db02dcaaddcdd322 30-Aug-2016 Hall Liu <hallliu@google.com> Skip call filtering when in ECB mode

When an incoming call is received in emergency callback mode, do not
perform any call filtering and just let the call through.

Change-Id: Ib459d9c88fe4b7fcb3fe7ab5b1bd968f0f513d7e
Fix: 30005987
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
c73ca8dc745b567af6b0101af8c92dd2ec3a38b1 21-Apr-2016 yifan.bai <yifan.bai@spreadtrum.com> Fix headset media button long press cannot reject call.

When making phone call with headset, another call incoming, long press
headset media button to reject new incoming call, call cannot be
rejected and first call will be muted. This is because SHORT_PRESS
should not be judged by ACTION_UP event's repeatCount which will be
always 0. Actually, ACTION_DOWN event's repeatCount only increases when
LONG_PRESS is performed.

Also, swapping SHORT and LONG press actions between MUTE and HANGUP to
match more of the existing devices.

Fix: 30012668

Change-Id: I6ec28a2676a86cfa06819e297136ff413c14f169
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
65a9e93c17767934e455c3cde0265f2ca0cad07c 30-Aug-2016 Brad Ebinger <breadley@google.com> Don't remove elements while using foreach
am: e680e66295

Change-Id: I55da207c92542a2860098bd3f955d64c1c84f4eb
7a0afc825dfced7aef753deb597f2c755f66ae03 29-Aug-2016 Brad Ebinger <breadley@google.com> Use the Telecom lock in Telecom.Runnable
am: f5e066609d

Change-Id: Ifa5aa24dc30a155516efcf86cb048509558d0a50
d532ef0fdce6a54fde316c5adce10510c8954cb4 29-Aug-2016 Brad Ebinger <breadley@google.com> Merge "Use the Telecom lock in Telecom.Runnable" into nyc-mr1-dev
98a0a8d5e77076d98ae82323b3983a73fb83b5ef 29-Aug-2016 Hall Liu <hallliu@google.com> Fix broken test and in-call controller bug
am: 28b82f0fe9

Change-Id: Id3eb39c2883b2d10ce5ed67a2d3fc5eb42baef97
b7be9e20d3607600a6a599a9293371c76c19684b 29-Aug-2016 Hall Liu <hallliu@google.com> Merge "Fix broken test and in-call controller bug" into nyc-mr1-dev
e680e66295e03bc0ae8b419c4fad4af460298748 26-Aug-2016 Brad Ebinger <breadley@google.com> Don't remove elements while using foreach

We were using a foreach in reuseOutgoingCall and removing an element if
it meets a certain criteria. This is incorrect in Java. Switching to an
iterator.

Bug: 31102577
Change-Id: I086a53a732ee5ab8f6ccea60fec9745ce6821f24
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f5e066609d0acc7ff53752bd6b9e3f2634bd0746 26-Aug-2016 Brad Ebinger <breadley@google.com> Use the Telecom lock in Telecom.Runnable

To prevent deadlocks in Telecom when using Session Runnables, we will
now lock on the main Telecom Lock instead of an independent lock inside
of Telecom.

Bug: 31076766
Change-Id: I993d7f2e8b077f89daef72ce1ca7b7fad2ad8823
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
13e8a6938eb5db779ea41f82f00916363ad09aa6 04-Aug-2016 Tyler Gunn <tgunn@google.com> Auto reject video requests for secondary user.

- In Telecom, when the ConnectionService sends informs us of an upgrade
to video request, if the phone account for the call does not support video
calling, then we will automatically send a response back saying the user
wants to stick with audio-only.
- Also, it turns out the Call object already knew whether it supports video
or not, so I was able to clean up the change I made previously to prevent
video calling on the secondary user.

Bug: 30600205
Change-Id: I64a29933d9da3f443dbad5fbd058f4b5735cfc51
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
28b82f0fe9b55b3bd826ba3a4204329988447c57 27-Jul-2016 Hall Liu <hallliu@google.com> Fix broken test and in-call controller bug

1. testBindToService_DefaultDialer_FallBackToSystem was broken because
InCallController#onConnected returned false due to an empty list of
calls in the mock CallsManager. Added a return stub to prevent this.

2. If an incoming call disconnects remotely before onServiceConnected is
called, no services will be bound to InCallController, but
InCallController will also not attempt to bind to an InCallService for
future calls. This is because the failure case in
InCallServiceBindingConnection#onConnected calls disconnect() directly,
not setting mInCallServiceConnection to null. This means that
isBoundToServices will continue to return true, so bindToServices will
never be called again until something else calls unbindFromServices.
Fix was to not disconnect if no calls are found when onServiceConnected
is called.

3. A test was added to test the fix in #2.

Change-Id: I95caba2e3169be33d89424269a09b3ad292be3de
Fix: 28743971
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6152c97acd232f8fde1f2a1c1177db2e19104ebc 27-Jul-2016 Tyler Gunn <tgunn@google.com> Merge "Auto downgrade video calls when phone account doesn't support video." into nyc-mr1-dev
10274f7f86f15ea6643b861c0d21ebcb73e8d407 27-Jul-2016 Tyler Gunn <tgunn@google.com> Auto downgrade video calls when phone account doesn't support video.

When adding calls to Telecom, ensure that incoming and outgoing video
calls are auto-downgraded to audio-only when the phone account does not
support video.

Bug: 27616192
Change-Id: I7fd15718af414903ab312f9aa9f20f8102a38f11
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6832bc65aff0c7974f4a6bb7cb576887d9138d17 26-Jul-2016 Hall Liu <hallliu@google.com> Merge "Answer video calls as audio-only through wired headset" into nyc-mr1-dev
7d58ba53c05e0449992a28ddcb0cba11de96361a 26-Jul-2016 Tyler Gunn <tgunn@google.com> When bg call does not support hold, auto-unhold on disconnect of fg call.

When disconnecting a call and the new foreground call is a held call
that does not support hold, auto-unhold that call. This handles the
scenario where a carrier (for example) does not support hold, and a call
disconnect causes a background call to be on hold. Since the carrier does
not support hold/unhold, the UX will provide no means to unhold the call.

Bug: 28813047
Change-Id: I4fe7410e5ef49297bdfb968d2e03a1594fa0d897
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
3777a7e39aaa4d89c3ed0a28b23f8b596cb765ec 25-Jul-2016 Hall Liu <hallliu@google.com> Answer video calls as audio-only through wired headset

Change-Id: I1602a422763bd825f3a1e34d910bf8c238a982df
Fix: 30371265
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
4b9e5566861568cf032db663b487c627d9a53772 15-Jul-2016 Hall Liu <hallliu@google.com> Check for PROPERTY_IS_DOWNGRADED_CONFERENCE in addExistingConnection

If the property is set, create the new Call object as a conference.

Change-Id: I1e28fea1801a7ef6f3b7445f2f3ae4bb08c54c98
Fix: 29806833
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b489d6c2a1aa80f19394bd61b6bbfad78624d2ca 11-Jul-2016 Tyler Gunn <tgunn@google.com> Merge "Finalize multiendpoint functionality." into nyc-mr1-dev
d1e6d8e643da472f8920781fd0ab285bb8ea970b 11-Jul-2016 Brad Ebinger <breadley@google.com> Merge "Rename Telecom Call Ids to include attempt" into nyc-mr1-dev
1e37be5dd86a51b90e461f09dc8a89effe4aee21 11-Jul-2016 Tyler Gunn <tgunn@google.com> Finalize multiendpoint functionality.

1) Handle the PULLING state throughout telecom.
2) When parcelling calls to send to InCallServices, remap PULLING state
to DIALING if an InCallService doesn't support external calls. This
ensures compatibility for things like Android Wear/Auto.
3) Ensure add call isn't disabled because of external calls.
4) Modify InCallController to handle changes to whether a call is external
or not. For IncallServices that do not support external calls, we will
add the call when an external call becomes a regular call, and we will
remove it when a regular call becomes external.

Change-Id: I1bf6c1f7e182834c3ab1ed34cd119467a4698993
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
11cbb8ac504de60ed5faf0399325809d7558348c 11-Jul-2016 Hall Liu <hallliu@google.com> Merge "Switch to speakerphone when upgrading to video" into nyc-mr1-dev
8c961ac8459fdb74d790834d86f348d09e742e99 09-Jul-2016 Hall Liu <hallliu@google.com> Merge "Check for the disable add call extra in canAddCall" into nyc-mr1-dev
6e8f3d70ac7397afb4cb5ab276d1cd385c92dd21 20-Jun-2016 Brad Ebinger <breadley@google.com> Rename Telecom Call Ids to include attempt

Telecom Call Ids will now append an attempt id (in the form of an
integer) that will be used by the CreateConnetionProcessor to name the
Telecom Call Ids that are used during the creation of a Connection to
the ConnectionService. This allows us to better identify which
Connection is calling back to Telecom to update status, disconnect,
etc. Previously, all of the attempted Connections in
CreateConnectionProcessor would be given the same name, which could lead
to multiple Connections trying to manage the same Call object in
Telecom.

Also, a supporting tests were added and a few Unit Tests were fixed.

Bug: 28799824
Change-Id: I7e23497ab671712bc8d3cc9542537ae1c4829afc
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9696c2187bb8c2fc77e72377df79e080578605b3 25-Jun-2016 Hall Liu <hallliu@google.com> Switch to speakerphone when upgrading to video

When an audio-only call gets upgraded to a video call, switch to
speakerphone if the call would have been started in speakerphone had it
been a video call from the beginning (i.e. if there's no headset or
bluetooth connected and config options support it)

Change-Id: I4b8eb1c0f21753a8878f72d9279335a946c9f5a9
Fixes: 29563103
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
140c8403b3d2a6ea30dc76898c3173cdd24d0e58 07-Jul-2016 Hall Liu <hallliu@google.com> Check for the disable add call extra in canAddCall

Instead of looking for the disable add call during video call extra and
checking to see if the call is a video call, just look for an extra from
Telephony that says whether to disable adding calls.

Bug: 29047863
Change-Id: Id6e85c0779ab7bfa4accd05e8cf264b3d0983cc9
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
eeeb2a10b4fde7d3cdee8ad9f0f5d7ca5e957b7e 06-Jul-2016 Hall Liu <hallliu@google.com> Merge "Add lock to NewOutgoingCallBroadcastIntentReceiver" into nyc-mr1-dev
c9cf54407720d32fdb1b69e0254657a6061b9f56 29-Jun-2016 Hall Liu <hallliu@google.com> Add lock to NewOutgoingCallBroadcastIntentReceiver

Synchronize on main Telecom lock when processing the returning ordered
broadcast.

Change-Id: Ic63efc9fb6d2e17bf1ca40c118594531054db985
Fixes: 29424036
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
634860041acec3497038ed93273024d18a499433 20-Nov-2015 John Eckerdal <john.eckerdal@sonymobile.com> Do not route audio to speaker if Bluetooth audio is connected

In some devices a magnetic charging port doubles as a dock connector
and if user is charging phone and the charge port is identified as a
dock the voice audio will be routed through the phone speaker even if
Bluetooth audio is connected.

Priorities Bluetooth over dock and route audio to Bluetooth if
connected.

Bug: 28914501
Author: Mathias Jeppsson <mathias.jeppsson@sonymobile.com>
Change-Id: Ib09fa96f8d78a8a8f202fca69c92ee88cb181f7a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
fc130b274e49a658bdb3026fec2e89f86957a6ae 16-Jun-2016 Hall Liu <hallliu@google.com> Disable adding a call during video call

Disable adding call during video call if the proper extra is set.

Bug: 29047863

Change-Id: Idf15bfd3d2ef3ec9c8e4d22b476ae1315437b08d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5ce8343b7920c4f5855da99a86a508121e667d14 15-Jun-2016 Hall Liu <hallliu@google.com> Merge "Add call events to analytics" into nyc-mr1-dev
874c0f8fa95a5da5a82e67c1fe39697883d753eb 30-Apr-2016 Hall Liu <hallliu@google.com> Add call events to analytics

Adds a record of events and timing information to analytics for each
call. Also add session timing information independent of calls.

Bug: 28623064
Change-Id: Iea6d4a7482365534a3a0c6c672a969dae8141932
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f15dc33f87f88e21ef745952a68af65c86e1bf1e 08-Jun-2016 Tyler Gunn <tgunn@google.com> Filter external calls when InCallService doesn't support them.

Use TelecomManager#METADATA_INCLUDE_EXTERNAL_CALLS metadata to check
whether an InCallService supports external calls. Will only send
external calls to an InCallService which has correct Metadata to indicate
that it wants to be informed of external calls.

This required some changes to how InCallController keeps track of the
incallservices. I have added an InCallServiceInfo class which tracks
the component name of an ICS as well as whether it supports external calls.

The change to CallsManager#getFirstCallWithState and getNumCallsWithSate
ensures that when TelecomServiceImpl checks to see if there are ongoing
calls it doesn't consider external calls when checking if there is an
ongoing call, and also when determining if room needs to be made for a
call.

Bug: 27458894
Change-Id: I69652877332be8527fb16a38c692b6f51a92e469
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e6c481acfcad381e3973e3250a366e1893259b84 12-May-2016 Brad Ebinger <breadley@google.com> Account for User's Voice SIM preference for E911

Currently, we do not take into account a user's Voice SIM preference
when making an emergency call. The CreateConnectionProcessor now first
trys to use the Voice SIM preference of the user and backs up to other
SIM accounts if that account fails.

Bug: 27059146
Change-Id: Ic64ecdd23fe081f9660820e5659d314f2c9b9902
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6d4b66df3d918e3f17263ff40ca3ba0ec5a46719 02-Apr-2016 Hall Liu <hallliu@google.com> Incorporate parallel call blocking checks

Modify CallsManager to use the IncomingCallFilter class introduced in a
previous CL.
Modifies AsyncBlockCheckTask and CallScreening to implement CallFilter
and removes the logic in those classes that used to execute the filters
in series.
Added tests for block-check and call screening.
Added logging events to track how long each of the call filters take.

Change-Id: Iecd60463fe9ac6dbbd85d57ef6ae2bfccb94d967
Fix: 26883888
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8179a7b06f01dc676db49dd187079d89311c92d2 19-Apr-2016 Sailesh Nepal <sail@google.com> Merge "[Call Timing] Set telecom routing times" into nyc-dev
703a1af8ffaca0cc73c5a73b37e546122171fefe 15-Apr-2016 Sailesh Nepal <sail@google.com> [Call Timing] Set telecom routing times

This CL sets the following times in the call's intent extras:
- the time that telecom started processing the call
- the time that telecom finished processing things like call blocking
and was ready to connect to the UI

The time values are sent to the dialer using call's intent extras.

Bug: 28202119
Change-Id: Ic7f43c2d6defca38ff0491b5b470b2684ab868af
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
09c900ef10510038772e172f5c3e553a3f0d9366 15-Apr-2016 Hall Liu <hallliu@google.com> Merge "Fix unit tests" into nyc-dev
9ecbb1cbae4dbb62a892c1347d8cb8691550ad1b 14-Apr-2016 Hall Liu <hallliu@google.com> Fix unit tests

Unit tests were failing because:

1. The fake context's bindServiceAsUser asynchronously calls
onServiceConnected, but the InCallController assumes that its connect()
method would finish before onServiceConnected gets called.

2. Video call tests depended on counting the number of audio state
transitions. This number is not a guaranteed (or even consistent) value,
so the mechanism for determining the final audio state has been replaced
by a latch posted to the CARSM handler.

3. IncomingCallFilter tests were experiencing a strange problem where
setting the timeouts value only worked when the tests were run in
isolation. This was fixed by putting in an adapter for the static
Timeouts class.

Fix: 28200736
Change-Id: If5fbd60e1a3c5d478d4555d8794a49855997f1d3
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
bca0f0c64248fb1c686624a3cd93b865a29528e8 15-Apr-2016 Ta-wei Yen <twyen@google.com> Merge "Persist missed call to call log before sending missed call notification" into nyc-dev
1a40c4f4daf2cdfba3f67383c726f93b85a98b00 14-Apr-2016 Tyler Gunn <tgunn@google.com> Improvements to external call handling.

Add onExternalCallChanged listener in Call to report when a call switches
between being external and not.
In CallAudioManager, BluetoothPhoneServiceImpl, HeadsetMediaButton, and
PhoneStateBroadcaster, listen to changes in the external call state.

This ensures that when a call becomes external or a call becomes
non-external that the various modules updates themselves appropriately.

Bug: 28179159
Change-Id: I44bc0b94f185c66aeddb68549223533249bb0b62
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
982c0bd962bc7ed208d0e73380e90b0fdcdf01dc 14-Apr-2016 Ta-wei Yen <twyen@google.com> Persist missed call to call log before sending missed call notification

For dialer to show detailed information the call should exist in the call
log when the intent is received.

+ CallLogManager#logCall() now take a callback to be executed after the
log is written. The default callback for a missed call is to show
the missed call notification.
- MissedCallNotifierImpl no longer listen to onCallStateChanged().

Change-Id: I94080a4a95f214a10d8e479b40ca7c407d06e0f2
Fixes:27276201
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
3da57646c4f2803eb482fcea46c76203717d5715 05-Apr-2016 Brad Ebinger <breadley@google.com> Modify outgoing Call logic to support multiple PhoneAccounts

When a Phone call is active, Telecom will use the same
PhoneAccount for any subsequent outgoing call made during the life of
the active foreground call. This change constructs a list of possible
PhoneAccounts that a user may want, depending on if any of the active
calls are on a SIM PhoneAccount and uses that list to determine if the
chosen PhoneAccount is available.

Change-Id: Ib8a2c90c6c6631524200dda040515f7f5b4e7f0f
Fix: 18836240
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
92b576ac4677107fc50fb2a11eac0dc93b47fe8e 07-Apr-2016 Brad Ebinger <breadley@google.com> Merge "Mock out AsyncRingtonePlayer during Testing" into nyc-dev
7ade5e2c3f7a849e41de3b81051c12a8fcd6ea83 06-Apr-2016 Brad Ebinger <breadley@google.com> Mock out AsyncRingtonePlayer during Testing

AsyncRingtonePlayer wasn't being correctly Mocked in the
TelecomSystemTests. Since the Async threads to continue to
run after the tests were completed, The AsyncRingtonePlayer log messages
were interfering with LogTest's Log capturing.

Fix: 28044674
Change-Id: Ic58a0091a969f8eb36b777b859ba08202810221a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
465982730ff480ff3037cbc22c9dcae005346971 05-Apr-2016 Hall Liu <hallliu@google.com> Use global telecom lock for CallerInfoLookupHelper

Previous implementation of a separate lock in CallerInfoLookupHelper
caused deadlocks because completed queries re-entering Telecom would
grab the CILH lock before the telecom lock, while outgoing queries would
grab the telecom lock before the CILH lock.

Change-Id: I50d94e7025d8b4b865edc5cbd73960c3703b2944
Fixes: 28007333
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1e0340bd2b11c735ca8e6db3e74b27c24ba1dfa8 01-Apr-2016 Hall Liu <hallliu@google.com> Merge "Move CallerInfo lookup into a utility class" into nyc-dev
17cc3d09c3fc849fbd80e853a5ef124fd5ffba69 01-Apr-2016 Tyler Gunn <tgunn@google.com> Merge "Auto downgrade emergency video call to audio-only if not supported." into nyc-dev
b2ad4f95fe1a2698ae15a37a03c8387e89cc50eb 01-Apr-2016 Hall Liu <hallliu@google.com> Merge "Change priority of call states in determining audio focus state." into nyc-dev
5b70c1c2ef08f06bacd4156b266e8ce5b3ccdc07 04-Mar-2016 Hall Liu <hallliu@google.com> Move CallerInfo lookup into a utility class

In preparation for parallelizing the three call-blocking lookup
operations, move the caller info/contact photo lookup out of the call
class.

Bug: 26883888

Change-Id: I9e00b21a3c5ce5c725fa91ec229f104e7c65c81e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
14fd8f3d5a86b0b1d56f27d7a638d8d4b29e766d 31-Mar-2016 Santos Cordon <santoscordon@google.com> Merge "Dynamic InCallService switching." into nyc-dev
6a11ed71899f87970ea04f9a915524be68c9680e 31-Mar-2016 Hall Liu <hallliu@google.com> Change priority of call states in determining audio focus state.

In some cases, if an incoming call is answered over an already-active
call, the active call will go into the hold state before the incoming
call exits the ringing state. This causes the CAMSM to rapidly go in and
immediately out of the RINGING state, which ends up disabling call audio
for the newly answered incoming call. The fix is to disable
transitioning to a ringing state when there are holding calls.

There was a previous change made that prioritized ringing calls over
holding/tone-playing calls. This was so that if the active call were
remotely disconnected while an incoming call was on call-waiting, the
ringtone would start playing. This behavior is preserved by setting the
priority as follows:
holding calls > ringing calls > tone playing

Change-Id: I617e7733b47f244f8d668b9e86166143383a29b6
Fixes: 27804164
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
501b9b3775232bb3033afd9f1fd608dd07d0b91e 07-Mar-2016 Santos Cordon <santoscordon@google.com> Dynamic InCallService switching.

Be able to switch between in-call services UIs.

Created a tree data structure to handle switching between InCallServices
depending on the state of the system. Tree looks like this:

CarModeSwitchingConnection
| |
+------+ +-------+
| |
CarModeConnection EmergencyConnection
|
|
DefaultDialerConnection

Bug: 24571147
Change-Id: I0999fad4185321d5211172aed2f1d60fe8f5fe3a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f815638bd401b5cd16ccd7c6f86f552d84814e29 30-Mar-2016 Tyler Gunn <tgunn@google.com> Auto downgrade emergency video call to audio-only if not supported.

Based on the new CAPABILITY_EMERGENCY_VIDEO_CALLING PhoneAccount
capability, auto-downgrade to audio if emergency video calling is
not supported. We do this early so that when the call is added to the
Incall UI, it does not waste time setting up video surfaces that will never
be used.

Bug: 27484017
Change-Id: I302070d885575e5ea0384803fdade39056f57c3a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f36f5149b8de765b9ba1dfff3226d8e00f7272eb 28-Mar-2016 Brad Ebinger <breadley@google.com> Merge "Record Call's Via Number in Call Extras to CallLog" into nyc-dev
571d5e66b8cbee023702b4b0a2a1c28663c5a7f8 15-Mar-2016 Tyler Gunn <tgunn@google.com> Add connection properties to Connections.

- Per suggestion of API council, moving properties of a Connection from
CAPABILITIES_* to PROPERTIES_*.

Bug: 27458894
Change-Id: I484783727c840a56882bca79c35280a4a338256d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
baf52ba1520ef528b65329c813389b8183150f3d 22-Mar-2016 Brad Ebinger <breadley@google.com> Record Call's Via Number in Call Extras to CallLog

Add a column to the CallLog Backup that records the secondary line
number that an incoming call has been received on. More specifically, a
call is assumed to be considered a "VIA number" if the call's incoming
line number does not match the number registered with the SIM card.

BUG: 25594198

Change-Id: I1bdc949fcee836945eec905b6a0afeec52b4ca29
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
961694a9750626c067be960170bc95f10b5efcc2 22-Mar-2016 Tyler Gunn <tgunn@google.com> Support for enhanced call/connection extras.

Plumbing in support for InCall UIs to update the extras of a connection.
Adding in unit tests for connection and call extra set/get methods.

Bug: 27458894
Change-Id: I9ce526bf293c9f5dd03642391d459fcfa03c31ef
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
c9286f49d12769d775d8ad7a66f9117c49c71162 11-Mar-2016 Brad Ebinger <breadley@google.com> Update the Ringer to ring based on User/profile

The Telecom Ringer used to ignore the default ringer of secondary
users. We will now use the default ringer of the secondary users as well
as support custom contact ringtones for secondary users.

Bug: 18206079
Bug: 27568161
Change-Id: I31b8b226f852a84b11939ab77f6a8cb0e35e88b6
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
228f95ee66c1770dd92f4f957ea6a9133ece2dd6 04-Mar-2016 Tyler Gunn <tgunn@google.com> Merge commit '005612a0af1fc475f422a1b0a4fb51fc5416ac90' into tgunn-merge1

Change-Id: Ibf955c5361978fadda363af97e975672d8a5f197
005612a0af1fc475f422a1b0a4fb51fc5416ac90 25-Aug-2015 Omkar Kolangade <omkark@codeaurora.org> IMS-VT: Set VideoState in Call Connecting State

Set VideoState in Call Connecting State
This will ensure that proper video state is sent at InCallService
start i.e. when binding to InCallService itself thereby giving us
sufficient time for surface creation.

Bug: 27477792
Change-Id: Ia7b76b558c1226359dd24e6d07b8e9d1c692ab93
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
cf27f68591c26b7420b27f620d9c927a321add39 02-Mar-2016 Abhijith Shastry <ashastry@google.com> Notify blocked number provider after an emergency call.

BUG: 26989170
Change-Id: I07d90d7994448e7a247e97d45b8dd1f1bc65e434
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
cf80e1fbec61a343b403827cb1d21e267ec9dda7 01-Mar-2016 Santos Cordon <santoscordon@google.com> Merge "Add *AsUser() calls where appropriate for multi-user support." into nyc-dev
f0f99f34fc993dc72c335133c6b04720c826c891 19-Feb-2016 Santos Cordon <santoscordon@google.com> Add *AsUser() calls where appropriate for multi-user support.

Although telecom always runs as system user, it binds to apps in the
user space and so needs to interact with apps with the current user
explicitly. This change fixes areas that neglected to do that.

Bug: 27161171
Change-Id: I55a4f612c9b38d4e448c346173845a79a926c695
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f9313da97e6f17bb8e8c62146a483ac528b9d44c 25-Feb-2016 Santos Cordon <santoscordon@google.com> Merge "Add call should always be present in CDMA calls." into nyc-dev
16fea3f6bedac2b4397f44553868c303fda59170 24-Feb-2016 Tyler Gunn <tgunn@google.com> Merge "Listen for ConnectionEvent and use the InCallToneMonitor to play the tone" into nyc-dev
2a3455b9ff2a308722b8f0ee21c64a62a06e9bda 23-Feb-2016 Hall Liu <hallliu@google.com> Unhold other call after local disconnect of active call

Bug: 26646508
Change-Id: Ic78c54f0aba935c4d42ce952bfb34d7333ca0c4c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
c0e8e9d48ea04f406a6f586dacc407f5ba0c31a4 06-Mar-2015 Xueren Zhang <xueren.x.zhang@sonymobile.com> DO NOT MERGE Fix for no response when send USSD during airplane mode.

When Airplane mode is on and call is placed, create
connection will fail. "To place a call, first
turn off Airplane mode" will be shown by InCallUI.
However, when it's a USSD number, the call won't
be added to InCallService. InCallUI won't track
this kind of call. So when creating connection
fails, InCallUI won't be notified, and won't pop
the error dialog up.

Change-Id: I8be7e709fd88f3bc9262077262ffd27f4f1a7a75
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8ff99f3751fcdd662932317ca45f886f6883e196 13-Feb-2016 Santos Cordon <santoscordon@google.com> Add call should always be present in CDMA calls.

This is reverting Change I2e4b396f5665b5517275766daa722866cf92d68c

Initially, the idea was that CDMA could not place additional calls while
a conference was happening. This is not always the case. CDMA
conferences exist in two states: merged and unmerged. Also, a call can
disconnect from the conference and the conference will continue as a 1:1
call.

In the case where the conference is "merged" or a party has
disconnected, the "add-call" option will function fine. This is why we
are adding the add-call back.

Bug: 22850789

Change-Id: Ib6bafed528cb84d46b46b11313db902d9aba4292
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
db82191d1ef7dd4155478071815a56947b31fc11 16-Feb-2016 Tyler Gunn <tgunn@google.com> Listen for ConnectionEvent and use the InCallToneMonitor to play the tone

BUG=25357778

Change-Id: Iad4f36f9b01670a2f188e726895a8349aeeb1502
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e62e9e83a17824b8e2057be35c2adcca20af9e35 02-Feb-2016 Brad Ebinger <breadley@google.com> Introduce LoggingRunnable for Session logging

Introduces a Session.LoggingRunnable class to reduce code duplication
when implementing Runnables in Telecom.

Bug: 26807413
Change-Id: I40c709fd09260c6a40b63fd2c401e5a582035a5c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
4b1759dcf2b8fe89fa0dc407152e5a8fcb829dbb 03-Feb-2016 Hall Liu <hallliu@google.com> Remove race condition between NOCIB and account selection

Place an outgoing call once both account-selection and the new outgoing
call broadcast are done instead of assuming that account selection will
take longer than the broadcast.

Bug: 26110078

Change-Id: I6b035e929e9dc01a7330c8756f8afd2d3c69ba7c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f5a32e4708729276b49226b2fdb819a46b7d2ce5 02-Feb-2016 Tony Mak <tonymak@google.com> Fix call is disconnected immediately after selecting a phone account

The problem is introduced after the getForegroundCall logic is moved
to CallAudioManager. Previously a call is
foreground call if it is not in NEW, DISCONNECTED, and ABORTED state.
However, now a call is a foreground call only if it is in active,
dialing, ringing and holding state.

Here is how does the bug happen:
0. Have multiple phone accounts
1. Place an outgoing call
2. Select the phone account (and so the call is in SELECT_PHONE_ACCOUNT
state).
3. CallsManager.phoneAccountSelected -> makeRoomForOutgoingCall return
there is no room for the call. It is wrong as the foreground call
should be the same as the call that just selected phone account!

So there are two solutions:
1. Do we intend to have the new definition of a foreground call? I believe
there are more things are broken if we have a new definition. I will
fix it as well once I confirm about it.
2. What's this CL fixed is removing the callToSkip argument in
getFirstCallWithState. As we are trying to find whether the call is
foreground call, I think it is unnecessary to skip finding the call.

BUG=26907829

BUG=26907829

Change-Id: Idda92b7685c12ec4c7440f775f1aebb834566de8
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
fbed016fbd4cdc744f306b13fb3a2d9042d6bd5a 15-Jan-2016 Hall Liu <hallliu@google.com> Add tests for CallAudioModeStateMachine

Adds tests and fixes a few bugs that were discovered in the course of
testing. Also add annotations for call audio tests.

Change-Id: I512afcd84fac54afd8fdddabbf732aebdf62df02
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
547a65a502544048a8394270a14ff0b8a4b05ac3 30-Jan-2016 Abhijith Shastry <ashastry@google.com> Merge "Block calls from numbers blocked by the user."
8cb83ea9b12793863638a1834278d4957e51bedd 28-Jan-2016 Abhijith Shastry <ashastry@google.com> Block calls from numbers blocked by the user.

Block check is performed after send to voicemail, and before CallScreening.

BUG:26682702
Change-Id: Ifa63a88d5815e4efb7b4fc9a18f38bc667e1ffa3
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b77e5999d5f7eb22012e717c7c0e8794ff553236 29-Jan-2016 Hall Liu <hallliu@google.com> Merge "Restrict ability to add call based on device provision status"
ae92595c2f0f88a5bef8d2601f026b9d3ae2d7dd 25-Jan-2016 Sailesh Nepal <sail@google.com> Use CallScreningService to screen calls

This CL uses the new CallScreeningService to allow or disallow calls.
Similar to InCallService, the call screening service holds a wake lock.

We also implement a timeout on the telecom side. The timeout is a very
large value (5 seconds). The logic is that a flaky in-call can mess up
calls in many ways so there's no point in trying to be strict here.

Currently the service is invoked after the send to voicemail logic. We
should consider depreciating the old logic and insisting that the dialer
handle all call screening.

BUG: 22857261
Change-Id: I52b97be8e20c0f404839790e69a5f33588093daa
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f1422e76239b1a86b9400f0ade388699982ee814 27-Jan-2016 Hall Liu <hallliu@google.com> Restrict ability to add call based on device provision status

Always return false for canAddCall if device is not yet provisioned.

Bug: 26303187
Change-Id: I9c4ebc8b954a79562b2ec83d59314a3fb621ddfb
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e091ab90e37845cf4771051a6d2ce0ebadee4fe7 19-Dec-2015 Hall Liu <hallliu@google.com> CallAudioManager refactoring

Separates the handling of audio mode and audio focus into a state
machine and brings ringing, tone generation, and ringbacks under the
control of CallAudioManager.

(cherry picked from commit fc2270137059e855756769752899d613e27d12a8)

Change-Id: Idd765550c907150117b8b66f76e88868ae3785c2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f78a72f8a1054726aa6f85a21372d917576906dd 21-Jan-2016 Santos Cordon <santoscordon@google.com> Revert "Revert "Support car-mode UI in telecom.""

This reverts commit 88cda8452124d43c145d54a97477dc5cf8a32a58.

Change-Id: Icfd1ab3ed3af39f62bd828dceb5ff2d4d517cb91
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
88cda8452124d43c145d54a97477dc5cf8a32a58 21-Jan-2016 Brad Ebinger <breadley@google.com> Revert "Support car-mode UI in telecom."

This reverts commit d3182912911d167e4a5a8d379cef11c619d18d36.

Change-Id: I48da1122846b18c03bec486ee2bf977f721723a2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d3182912911d167e4a5a8d379cef11c619d18d36 11-Dec-2015 Santos Cordon <santoscordon@google.com> Support car-mode UI in telecom.

Add additional step to look for and bind to a car-mode UI if the device
is currently in car-mode. Add a system state component to listen for
car-mode changes.

Change-Id: I5124b46f43b47bda39cf3d0f882378cf69b0505b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0f55f047d0c862e825a2f14e52bfc343eaf2d39a 15-Jan-2016 Hall Liu <hallliu@google.com> Merge "Add support for earpiece-less devices in audio routing"
a993094840386163e9c2aa65a05e14b49d122318 15-Jan-2016 Tony Mak <tonymak@google.com> Updated missed call notification behaviour

Change-Id: Id32110413fbb5fa4ae4c3478e70f54d211b78389

Missed call notification

1. If the phone account has multi user capability, the notification
is shown in current user.

2. If the phone account has no multi user capability, the notification
is shown in the user that owns the phone account of the call

3. Whenever user is switched, reload missed call from database and post
notifications if necessary.

Change-Id: Id32110413fbb5fa4ae4c3478e70f54d211b78389
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
a3e9ddacab074828d8b1867db77e7c96b712ac0c 16-Dec-2015 Hall Liu <hallliu@google.com> Add support for earpiece-less devices in audio routing

Allow devices without earpieces (Wear devices) to route call audio
correctly by falling back to speakerphone. Added tests to verify correct
behavior in this instance.

Bug: 26195788
Change-Id: If73db0cc4c3fcb00b3068276a10d44417d2ddd5c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9ec222c7ad86f19cedda49b712cea8ee1ac1d6d8 17-Dec-2015 Brad Ebinger <breadley@google.com> Merge "Increase Logging to debug Accept/Reject"
3165d50d3fc688d632faecfae9c2f987e537941f 16-Dec-2015 Brad Ebinger <breadley@google.com> Increase Logging to debug Accept/Reject

Currently, it can be difficult to identify where Telecom events
originate from. Logging messages have been added that better describe
the conditions that occured to cause these Telecom events to occur.

Bug: 25838961
Change-Id: I846a3125d000bef1d0e8796a7baadcfa8cd73d4f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
96a68839b9cd5051a94db1def4d28b922bb87ee2 17-Dec-2015 Tyler Gunn <tgunn@google.com> Merge "Add Video API unit tests, fix auto speakerphone logic."
0a6dd30f0f7acab586db9933bd4836148cd91c89 17-Dec-2015 Hall Liu <hallliu@google.com> Add more tests for TelecomServiceImpl

Change-Id: Ieef40369762736c01a331fe4a3cc72bed8928103
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
4a6e961365dc97f9798c794fa755a99554c3be8c 14-Dec-2015 Amit Mahajan <amitmahajan@google.com> Code cleanup including removing direct references to IMS classes.

Bug: 25793157
Change-Id: Ifb550cdd4aa6c7765a070e2725f2bbb7dcd3a69e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f3209bb339815b3fc79117bd3fc896d551246683 16-Dec-2015 Amit Mahajan <amitmahajan@google.com> Merge "Code cleanup including removing direct references to IMS classes."
29855705f44029e8578b8c4df9b571748724a03a 12-Dec-2015 Hall Liu <hallliu@google.com> Improve test stability for CallAudioRouteStateMachine

Explicitly run verifications only after all state machine commands have
been completed, by attaching a Runnable to a message to be processed
after all other messages by the call audio route state machine.

Change-Id: I7678eea5148fd08d72aac26183273c8d0d66d295
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b492f4c845e61fac17c0e523363607d2dd6ba987 15-Dec-2015 Tyler Gunn <tgunn@google.com> Add Video API unit tests, fix auto speakerphone logic.

- Move some of the single call Telecom system tests to a new BasicCallTests
class.
- Change visibility of some methods in TelecomSystemTest to faciliate the
creation of other system test classes.
- Added VideoProviderTest which exercises the Video APIs.
- Created Mock Video Provider.

Change-Id: Id314c18b77e8c635fbde0232a1ccfae851a3071c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8c4e22ae46a0dae635438353402937bf5d496ea8 14-Dec-2015 Amit Mahajan <amitmahajan@google.com> Code cleanup including removing direct references to IMS classes.

Bug: 25793157
Change-Id: Ifb550cdd4aa6c7765a070e2725f2bbb7dcd3a69e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
220b419bb5d1b4d1df08415c8e52cb7f0decbf7c 11-Dec-2015 Hall Liu <hallliu@google.com> Add tests for NewOutgoingCallIntentBroadcaster

Change-Id: I5dd8ee49e0afc3ab714439ae1ca7f4ce54a26072
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5702337672a74c7ab55f02f8b3d492581dc3c668 12-Dec-2015 Tyler Gunn <tgunn@google.com> Merge "Fix issue where CEP participants cannot be disconnected."
65123635b873ee422a33d3f0fb273129ac06c640 11-Dec-2015 Tyler Gunn <tgunn@google.com> Enable auto speakerphone for outgoing video calls.

Extended existing logic for auto-enabling speakerphone for incoming video
calls to also apply when making an outgoing call.

Bug: 20090407
Change-Id: I69d943f49d84aea7559a78b92bbadd858084da66
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
234d54219ba98eb3a38ee01252d725d61760b8b1 08-Dec-2015 Tyler Gunn <tgunn@google.com> Fix issue where CEP participants cannot be disconnected.

Existing connections are added in Telephony for the CEP participants.
In that connection service, a unique id generated using the package name
of the connection service and a sequential number. This is passed here
into callid. HOWEVER, I mistakenly did not use it when making the new
call in Telecom. Hence Telecom would be referring to a call by one ID
and the connection service by another.

Bug: 25779129
Change-Id: I72b3aea3d49f6852a2c4d7a66e2c22494f651d7a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b2cadb6851ef78ab62c328bf23e327c14aeda536 08-Dec-2015 Hall Liu <hallliu@google.com> Merge "Add analytics recording to Telecom"
3258720f5526f766aa26c19cf01b32ac20d19d1d 18-Nov-2015 Hall Liu <hallliu@google.com> Add analytics recording to Telecom

Adds a way to record interesting information about calls that can then
be uploaded for later analysis.

Change-Id: I029688cbb28ba75c00df64b7c1aa9eda382fde99
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
23a1974afd37a2ce4210281c7d2921e69cc2747f 07-Dec-2015 Tony Mak <tonymak@google.com> Merge "Allow setting default phone account handle per user"
30cdf12de680cb9ec3cf932706f065a48feade40 07-Dec-2015 Tony Mak <tonymak@google.com> Merge "Methods in PhoneAccountRegistrar should ask for userhandle explicitly"
b360f0d6de2977a4aa097075ce106a4fd201b43c 01-Dec-2015 Tyler Gunn <tgunn@google.com> Enable auto speakerphone for outgoing video calls.

Extended existing logic for auto-enabling speakerphone for incoming video
calls to also apply when making an outgoing call.

Bug: 20090407
Change-Id: Ia3553dbe1d3966998b369724ce78a458f3ab8938
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
4a3e2fd2b783c9f667a719237ef527ebe686fe32 04-Dec-2015 Tony Mak <tonymak@google.com> Allow setting default phone account handle per user

The problem we cannot have every users has their own user handle is becoz
we did not store user handle.
Store default phone account handle with user handle, so that every user
can has it owns default phone account handle.

Bug: 25941865

Change-Id: Iad8a920e9ceeb9caa8a7d8bc6a1d2f2dfc8dcd58
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
240656f19c078b4f703d0502ce29114de0d45a50 04-Dec-2015 Tony Mak <tonymak@google.com> Methods in PhoneAccountRegistrar should ask for userhandle explicitly

1. Get calling user handle before calling clearCallingIdentity
2. Methods in PhoneAccountRegistrar asked for the user handle explicitly
instead of trying both current user and calling user
3. Modify isVisibleForUser in PhoneAccountRegistrar,
- PA with CAPABILITY_MULTI_USER is visible to all users including
managed profile (We are still discussing this, but let's assume it
works in this way and change it later if necessary)
- For other PAs, they are only visible within the user they are
registered to.
- TelecomManager.getPhoneAccount is an exception case. The visibility
checking of getPhoneAccount allowing a PhoneAccountHandle from other
profiles in the same user.
Reason:
Telecom passes PhoneAccountHandle to incall UI and incall UI
retrieves PhoneAccount from the handle.
It is because we never bind to managed profile's incall UI, and bind
to its parent user provided one instead. So phone account handle in
managed profile is passed to it's parent user incall UI. And we need
to allow parent user incall UI to retrieve the PhoneAccount from
the handle.

4. Please notice that the default PA account related APIs does not really
support multi-users. The backend (xml storage) does not include user
as a key and it should be able to store one default only and is shared
among all users. This problem is not fixed in this commit.

Bug: 25936882

Change-Id: Ia371723d68247a208a0c1185f6d02f1b5897946a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
ae694b10e9156cfe0c8c57d73989fed13c887f69 12-Nov-2015 Tyler Gunn <tgunn@google.com> Make TelecomSystemTest compatible with code coverage

Creates a few implementations of interfaces to spy on to avoid
mysterious exceptions resulting from interactions between Mockito and
Emma.

Change-Id: Ie32b1bb101811471722f6e48aa4c5a75f364575c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
98e6bdc795585b0d332a7eb86245926c8d80609a 25-Nov-2015 Tony Mak <tonymak@google.com> Update calllog insertion logic

Here are behaviors defined by Lilian, we may revisit the behavior later.

1. Calls using multi user PhoneAccount are inserted to all users
except managed profile.

2. Outgoing call placed through work dialer is inserted into managed profile
only.

3. Calls using non-multi user PhoneAccount should be only inserted to
that particular user.

Change-Id: I84f54afb3af38b931b71063608f38d265aa0417c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b0998818637b87adf9c7528a15030e4b65fcf0d7 25-Nov-2015 Tony Mak <tonymak@google.com> Merge "Add field to store who is initiating the call"
578a4e6661fc1be20d164458acb335356d742f72 23-Nov-2015 Tony Mak <tonymak@google.com> Add field to store who is initiating the call

Insert userhandle of user that initiate the call before forwarding
the intent to primary user.

Previous ACTION_CALL flow:
Fire ACTION_SEND (managed user) ->
UserCallActivity in Telecom (parent user) ->
PrimaryCallReceiver (parent user)

Current ACTION_CALL flow:
Fire ACTION_SEND (managed user) ->
UserCallActivity in Telecom (managed user) ->
PrimaryCallReceiver (parent user)

The field can be used for:
1. Filter phone accounts for outgoing call
2. Insert call log based on who initiates the call
3. Pass the field to in-call UI which may uses it to indicate it is a work
call.


Change-Id: I78611a4394f00ce0655c37d52b7b456f213ec802
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
755d6fb62aaf42b1e9c06a3ff04dfc78943a16a8 12-Nov-2015 Amit Mahajan <amitmahajan@google.com> Phone refactor (merging Gsm and Cdma phones)

Bug: 25793157
Change-Id: Idba85b49f91b1607ab83be16b9aff80d61f4149f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6377b9423b6638ceed0e4461b302d8bf9db93de4 17-Nov-2015 Hall Liu <hallliu@google.com> Merge "Refactor CallAudioManager's audio routing"
f62630a57de0d52be2bdbc92a9bf8f305cc0892d 27-Oct-2015 Hall Liu <hallliu@google.com> Refactor CallAudioManager's audio routing

This change separates the audio routing functionality of
CallAudioManager into a separate component, implemented as a formal
state machine.

Change-Id: I4ca66abe72609d67dc8bde8ed8ff1538b7d0cf57
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5385513ae43b4d5896245bf076a83b27dbf32a25 30-Oct-2015 Brad Ebinger <breadley@google.com> Add BluetoothPhoneServiceImpl testing

Adds unit tests for BluetoothPhoneServiceImpl.java, which manages
telecom's interfacing with a headset, including headset events
and connect/disconnect during a call.

Change-Id: Ia692b02f8e4d3fc52b0e266409a4c5ed1ca2e7b8
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b1e3d751c156221cd9a42dc12d43fc5fbe4bf137 10-Nov-2015 Brad Ebinger <breadley@google.com> If reusing call, don't check makeRoomForCall

Currently, if a call is reused in startOutgoingCall (in GV, for example)
during the making of a conference call, makeRoomForCall will return false
mistakenly because the call has already transitioned from
NEW -> CONNECTING state.

During the making of the new Call, makeRoomForCall was already called
once to be sure that the new call is valid. We can safely avoid making
this call to makeRoomForCall again and returning an incorrect "false."

Bug: 22980265
Change-Id: Id6fbad299f75a92d6c5b1be06e38611f8113c822
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
abf3ab0dbbcfe5b5f46e1856b487e8476fde8b54 10-Nov-2015 Tyler Gunn <tgunn@google.com> Merge "Fix issue where incorrect call state disables "Home" button."
38cd86e5f63c75a82befd39445166a9bbcfb1aa2 09-Nov-2015 Bryce Lee <brycelee@google.com> Make rerouting audio to speaker when docked configurable. am: 88f900a518 am: 5395e29c1d
am: ff8faeefa2

* commit 'ff8faeefa23bd10fc8d66f46dbbd8b7af9584e28':
Make rerouting audio to speaker when docked configurable.
88f900a518e2e5a21d39958793d2123962923172 06-Nov-2015 Bryce Lee <brycelee@google.com> Make rerouting audio to speaker when docked configurable.

Bug: 25485578
Change-Id: Ie2a04e9d96b9c1e3d8167679a1137b65bdad3379
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e6276e1d012ea3f93e4dc2a0c8567664dcfd31b3 23-Oct-2015 Tyler Gunn <tgunn@google.com> Fix issue where incorrect call state disables "Home" button.

There is a potential, due to multithreading, for a call to enter a
ringing state, become disconnected, and then finally be added to Telecom
where it will again be set to ringing. The PhoneWindowManager code
uses the TelecomManager API to check if there is a ringing call and to
determine if the home button should be disabled. The aforementioned
circumstances result in the PhoneStateBroadcaster not properly tracking
the current call state. It happens that the Telecom API isRinging method
simply checks the current state in the PhoneStateBroadcaster. In the
scenario for this but, the phone state is stuck in ringing, and as a
result the home button remains disabled.

This CL fixes this on 2 fronts:
1. Correct CallsManager onSuccessfulIncomingCall so that it will not
automatically set the state of a new incoming call to ringing if it has
already been disconnected (this will prevent PhoneStateBroadcaster from
getting the wrong state).
2. Change the Teleco isRinging API to check CallsManager#hasRingingCall(),
which will look at the list of currently tracked calls to determine whether
there is a ringing call (regardless if the PhoneStateBroadcaster has a
potentially inconsistent state).

Bug: 25146970
Change-Id: I6273c72bac5fc7d91e16a8ff8aa12a7081089824
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8f52ead844a54fa1b6a4e394289dd5805fbe707b 26-Oct-2015 Bryce Lee <brycelee@google.com> Account for scheme when checking if we can handle a call. am: 6afefa40e1 am: a4370801fb
am: 00e46655a0

* commit '00e46655a06a877f32e5d6224dccf6c3340267e1':
Account for scheme when checking if we can handle a call.
6afefa40e1e0e3310c4be0642ffdbb86347a74df 26-Oct-2015 Bryce Lee <brycelee@google.com> Account for scheme when checking if we can handle a call.

Previously we were only accounting for if there was a call capable account.
This leaves the possibility that we have a call capable account for only
one scheme, but are asked to handle another.

Bug: 25202039
Change-Id: Iaf7173886faf8024f6a101e2e912cd1f77e18390
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9d07adf6a85aaf04b5e36dcbeae1b7ebcc2817e4 24-Oct-2015 Bryce Lee <brycelee@google.com> Disconnect calls when there is no call capable account available. am: de0ac37db0 am: d447830054
am: 416870d697

* commit '416870d697293135138e5665adb91bbc2460ffc1':
Disconnect calls when there is no call capable account available.
de0ac37db05aaa15edbbf98a83bc87a54bb56384 24-Oct-2015 Bryce Lee <brycelee@google.com> Disconnect calls when there is no call capable account available.

Bug: 25194479
Change-Id: I9e9c7d6d63e91b2979a4ebdd5e50674aa55d4fc7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d931a017a0abea32ad4485a91402b5f62b9ddb0e 21-Oct-2015 Brad Ebinger <breadley@google.com> Ringer unit tests added and minor refactoring to accommodate testing.

Change-Id: Ia176dff453e1876494e14d8403eb5a9ed3dd3865
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8fb1fb72b084a0497a3c3c3037ce5667bde14482 23-Oct-2015 Hall Liu <hallliu@google.com> Fix TelecomSystemTest#testAudioManagerOperations

testAudioManagerOperations was setting the microphone to mute
and attempting to verify that the setMicrophoneMute methond on
the AudioManager was invoked. However, CallAudioManager bypasses
AudioManager and calls AudioService directly.

This change modifies CallAudioManager so that a mock AudioService
can be injected. The test was modified so that it checks that the
appropriate mute method was called on the mock AudioService instead
of checking the mock AudioManager.

Bug: 25158760
Change-Id: I0d5946ae6b4cd31c9067e818f20dcc37a2e15c86
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d15d693be6b7cad7ef8b0a7dd2665b8904eb0697 18-Sep-2015 Roshan Pius <rpius@google.com> Log "Direct to Voicemail" calls in Calllog.

Merging call reject/missed call notification handling in
processDirectToVoicemail calls, so that all calls are logged in
call log.

BUG: 24174927
Change-Id: Icb8804e7c72880c56a190ca077e8f17833fb9b0c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8a048bf8150ac2335c3d511f4583e839d5235619 17-Sep-2015 Tyler Gunn <tgunn@google.com> Merge "Modify Telecom to have "one call ID to rule them all"."
8452be0e1e82e0d12cfb884bbf683ec5f95c9781 17-Sep-2015 Tyler Gunn <tgunn@google.com> Modify Telecom to have "one call ID to rule them all".

- Add call ID to the Telecom call class.
- Modify CallIdMapper to use Telecom call ID instead of a new sequentially
generated one.
- Remove isValidCallId and isValidConferenceId from CallIdMapper as they
are no longer required.
- Modify event logger to use telecom call ID instead of a sequential ID.

Bug: 23357902
Change-Id: I485f751d1668e96b7787c4be97aa76c1e5ec0798
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
834ca26d753e2e1466f6f0ecacc7d98c0895950b 10-Sep-2015 Roshan Pius <rpius@google.com> Update CallsManager state before invoking callback

We should update CallsManager internal state before informing the Calls
Manager event listeners for any call addition/removal/state-change. This
will ensure that we have the correct state when one of the listeners
query CallsManager after being informed about an event.
This will ensure for example that the background call is brought to
foreground when a call is disconnected and so call audio manager will
not relinquish the audio focus when an IMS conference is created
(b/23759265).

BUG: 23786790
Change-Id: Iccb74ac61166f1218f36b7b98df5d35a015e0c43
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
669f90b7544d0f8ec42336ea6757e133b499c145 03-Sep-2015 Roshan Pius <rpius@google.com> Abandon audioFocus only when all the calls are disconnected.

Due to the change in ag/757925 to abandonAudioFocus when the foreground
call is in disconnected state, we end up prematurely abandoning audio
focus for IMS conference scenarios. When IMS conference is created
first, we disconnect the foreground call before creating the new IMS
conference call. This results in us abandoning audio focus and
reinitializing it when the conference call is created. In this scenario,
there should be a background call which is not in DISCONNECTED state.
So, redo the if check to see if there is any non-DISCONNECTED call in
CallsManager before we abandon audio focus.

BUG: 23759265
Change-Id: I97dc614c6b805a0dff19b063806d8d036f3d894f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1631929bc33861c941b674a7e5fe91509dee0471 29-Aug-2015 Roshan Pius <rpius@google.com> am 7d7cf27d: Ensure BT headset state updation before connect.

* commit '7d7cf27dd519c8910d98e942adc5a95675eba0c8':
Ensure BT headset state updation before connect.
7d7cf27dd519c8910d98e942adc5a95675eba0c8 28-Aug-2015 Roshan Pius <rpius@google.com> Ensure BT headset state updation before connect.

Two BT fixes here:
1. Correct the force updation of BT headset.
Looks like one of the partner CL: ag/703545 inadvertently overrode the
|force| flag that was added in ag/565413 to update the BT headset with
correct phone state on query. Correcting the logic to update the BT
headset with phone state to honor the |force| flag regardless of the
other flags.
2. For outgoing calls, update the BT headset that there is an outgoing
call being placed even before the call reaches the DIALING state.
This helps in ensuring that the connect_audio invoked reaches after
BT headset knows that there is an outgoing call being placed.

BUG: 23324160
Bug: 22996930
Bug: 23595828
Change-Id: Ib19712fbf357b8355de2132be643585e24d9a59c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
4de4a89b1d07646d51b1a7feda3c4329a09b5234 24-Aug-2015 Roshan Pius <rpius@google.com> Reject incoming calls when dialing a outgoing call

When an outgoing call is still being dialled, we cannot hold that call
if a new incoming call is received at the same moment. Hence reject any
incoming calls if we're still dialing an outgoing call. These incoming
calls will be logged as missed to the user in call logger.

BUG: 23428950
Change-Id: I97693afd443073ea9642d69aa67542ee1aa3eff7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
05f9e8d01064d63b08b5f888dc0cb4ee03c7f024 12-Aug-2015 Tyler Gunn <tgunn@google.com> Merge "Minimize the number of calls to PhoneNumberUtils.isLocalEmergencyNumber." into mnc-dr-dev
6ffe531cc43849b5ca22a23647f5e729fae01c25 12-Aug-2015 Tyler Gunn <tgunn@google.com> Minimize the number of calls to PhoneNumberUtils.isLocalEmergencyNumber.

On a standard outgoing call, isLocalEmergencyNumber was being called
from 30-40 times. Each of these calls requires a system service
invocation.

The Telecom Call object already has an isEmergencyCall() property which
is set any time the handle on the call changes.
When ever possible in Telecom, I have used this already calculated value.

These changes reduce the number of calls to isLocalEmergencyNumber
by about 5-10.

Also removed a duplicate call to setHandle() in the Call constructor.

Bug: 22985202
Change-Id: Ic8662d4ab506486858caf4fbff61c32bae2b7c8c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
595787d05bc84212c075c0c5f9a84af642880398 12-Aug-2015 Tyler Gunn <tgunn@google.com> Merge "Fix issue where GSM conference is held in makeRoomForOutgoingCall." into mnc-dev
e4cd9162be58042a99c6f5eadfa9b77d5686a8ea 12-Aug-2015 Tyler Gunn <tgunn@google.com> Fix issue where GSM conference is held in makeRoomForOutgoingCall.

- See code comments. The extra hold in makeRoomForOutgoingCall was being
caused by the fact conferences do not have a target phoneaccount set.
This is causing makeRoomForOutgoingCall to hold the conference, when
the connection service is already doing that.

Bug: 22609387
Change-Id: Ieb4817bd35204c48cc5b7bf24384062afd5b7075
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1a373830332493b610f98c3d00afe0713af7050a 07-Aug-2015 Roshan Pius <rpius@google.com> Fetch phoneaccount from child for live conf calls.

Some conference calls don't seem to have a targetPhoneAccount set on
them. So, fetch the targetPhoneAccount from the child calls if it is not
set on the conference call for any new calls placed.

BUG: 22954116
Change-Id: Id97cf70954593b863bebce0903717cc806b0e3fe
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d9544092457d3a6f584a24bb0542ee42bf99878d 31-Jul-2015 Roshan Pius <rpius@google.com> Disallow new call addition for live CDMA calls.

Disallow call addition when the foreground call does not support HOLD.
This is for CDMA calls which do not support HOLD capability and hence we
cannot place a simultaneous call.

BUG: 22850789
Change-Id: I2e4b396f5665b5517275766daa722866cf92d68c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
084ab0835ea9879185d3e6aa7f9be48ae4067bed 15-Jul-2015 Roshan Pius <rpius@google.com> Maintain call time across SRVCC (1/3).

When an IMS conference call encounters an SRVCC event requiring a
fallback to GSM/CDMA, we need to maintain the call time for the
conference host across this fallback. So, adding a connectTime attribute
in the underlying conference host's connection object which can be used
to account for the call time from the now inactive conference call into
the new call created.

BUG: 21918593
Change-Id: I2d31761bd4af4a3ec199b998a0ce511001dcf632
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8d3f269fcc8853b2d5ce467cdce6ef27b0122bf8 08-May-2015 Yorke Lee <yorkelee@google.com> Fix for pending calls not being reused

The if check to potentially reuse a call based on its original number
would fail if the second number had been rewritten or formatted
differently.

Compare normalized versions of the two addresses to determine
equality instead.

Also increase the timeout slightly for reusing a
pending disconnect call.

Bug: 20820155

Change-Id: Ifc3ae0a1a1b66132a500665cd7f8bca75a4981b3
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
781d02590daf095aa1ca70f947d18a925bda4549 25-Jun-2015 Roshan Pius <rpius@google.com> Fix NPE in startOutoingCall with no phoneAccount.

When a SIP account is added but not enabled, startOutgoingCall cannot
determine a valid phoneAccount to use for initiating the call. This
results in a NPE when trying to change the state of the call to
CONNECTING. So, sending a "no-handle" tag when phoneAccount is null when
invoking setState.

BUG: 21887733
Change-Id: I84b54b48c7e937e5766ae58e52489b708898025b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
38c066e0b475c7e36901203fc11b528a0a34610d 12-Jun-2015 Tyler Gunn <tgunn@google.com> Merge "Play tone when video upgrade request is received." into mnc-dev
86014fcf9ec86e198a1ebac7c46e0e5c630735d7 12-Jun-2015 Tyler Gunn <tgunn@google.com> Play tone when video upgrade request is received.

Added a VideoProviderProxy which intermediates between the VideoProvider
in the ConnectionService and the InCallService.

Changed CallsManager to listen for session modification requests via the
VideoProviderProxy and report these to its listeners via the
CallsManagerListeberBase.

Changed InCallToneMonitor to listen for session modification requests and
to play a tone when a request to upgrade is received.

Also, added an intent in the TestInCallService which I neglected to commit
in a previous CL.

Bug: 20232310
Change-Id: I1b105968f519ff6b166bbd02cb57b1cf68d2cea9
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5fa4e4f1eb98f052cc0ee4b3ad0f6acb8e92c719 10-Jun-2015 Santos Cordon <santoscordon@google.com> Add more logging.

1) Call state logging was lost in a merge conflict, adding that back.
2) Adding better ringing state logging. Fixes problems:
- No more superfluous "STOP_RINGER" logging
- Adding call-waiting logging
- More accurate call attribution for start and stop ringing

Change-Id: Ie41340ab6790a6c5f87f5592836b29bf6799708d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
750b6dfc46b73f03a2e261860878549deb6357ac 10-Jun-2015 Yorke Lee <yorkelee@google.com> Merge "Use Telecom constant for providing incoming call handle" into mnc-dev
467b64fb79f8720958bba6dff84d4827458d33e2 09-Jun-2015 Tyler Gunn <tgunn@google.com> Remove use of STATE_AUDIO_ONLY in a comparison.

- Use VideoProfile.isAudioOnly() instead of doing == comparison.

Bug: 21645094
Change-Id: Iee12001e2a56dfdf8239ad04f844593a21da896d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
69fa89790a67c497f091c86a9b1ed5a00aace7ae 08-Jun-2015 Yorke Lee <yorkelee@google.com> Use Telecom constant for providing incoming call handle

Bug: 19696065
Change-Id: Idf5385d80c828f28f3078acae9670ace9daab61e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
31c56fdef34436ca7ab82af13a905be13497c746 04-Jun-2015 Yorke Lee <yorkelee@google.com> Merge "Disconnect SELECT_PHONE_ACCOUNT call to make room for outgoing call" into mnc-dev
867907d6b04e63c29fce74baad724ed96871221e 03-Jun-2015 Yorke Lee <yorkelee@google.com> Disconnect SELECT_PHONE_ACCOUNT call to make room for outgoing call

If there is a call still in the SELECT_PHONE_ACCOUNT state while
a new outgoing call is made, disconnect it to make room.

Also fix some logging in InCallController

Bug: 19187111
Change-Id: Ia161325480692ead7a1633f47604ced01604883f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5b8824979e929250a46791c785b8459512236585 03-Jun-2015 Tyler Gunn <tgunn@google.com> API Cleanup: Remove references to VideoState class.

- Replace use of VideoState static methods with VideoProfile equivalent.
- Replace use of VideoState consts with VideoProfile equivalent.

Bug: 21573551
Change-Id: I567abaf4b6c0de51656869d1c7367a7ff3e51cd1
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1b9066506b70c0c1a65ce676175f9a137facf846 01-Jun-2015 Andrew Lee <anwlee@google.com> Use setIntentExtras instead of setExtras.

There was a recent change to distinguish between extras provided by
Connections, and extras intended for use on Intents.

Bug: 21555553
Change-Id: I42c09427c4c36e7e441091807beac66b7e6f5f21
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0d5b6ee93d90a70f9b8fd0fa5ce0c407ae84cc68 29-May-2015 Santos Cordon <santoscordon@google.com> Merge "Add extras to Connections/Calls. (2/3)" into mnc-dev
b3907b3e79864a3a42d5e7105e5051f7e364fdba 28-May-2015 Santos Cordon <santoscordon@google.com> Add extras to Connections/Calls. (2/3)

Two major changes:
1) Add the notion of extras to a Connection. These extras will be
parceled through to InCallService as Call.getExtras()
2) The previously existing Call.getExtras() has been renamed to
getIntentExtras(). This name better describes the fact that these
particular extras are from the original CALL or INCOMING_CALL intents.

Change-Id: I4eed1e1bb47e83f8ba5c843cab7e7e492a297c71
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b60f00673149da9a96d9369f4e1c4458e9a9cf53 27-May-2015 Ihab Awad <ihab@google.com> Sync for AudioManager

Fixes sync problems where the system calls back into Telecom while
Telecom is synchronously processing a message.

Bug: 21289255
Change-Id: I4ea319113be2e4651c82c6e9712eb4d97ea9e9bb
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
afb408d738ec4583a02dc7ec6bb3c5a74479fb09 19-May-2015 Ihab Awad <ihab@google.com> Merge "Sync for HeadsetMediaButton" into mnc-dev
ea5cb93d81099f17654e0fdf9b8eda3bfa89f081 08-May-2015 Santos Cordon <santoscordon@google.com> Provide enable property on phone accounts.

Bug: 20303449
Change-Id: I4b9cb0e29377233ed4fc01757570351ee6e5856e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
731369c3983628e700f161138fe2ea3230033a1a 19-May-2015 Ihab Awad <ihab@google.com> Sync for HeadsetMediaButton

Add synchronization and deferred execution to our interactions with
MediaSession, since MediaSession sometimes calls back via an RPC into
Telecom and can cause us to deadlock.

Bug: 21028885
Change-Id: I8fc0574269a81e817e1c139aa0fe56258c96bd64
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
2a66f7b906b225413ae33f72e70a75e4f9c883c0 13-May-2015 Yorke Lee <yorkelee@google.com> Rename AudioState to CallAudioState

Deprecate AudioState class and make methods @SystemApi where
necessary to minimize impact to SystemApi
Replace usages of AudioState inside Telecom sub-systems
Fire both onCallAudioStateChanged and onAudioStateChanged callbacks
for backward compatibility
Support both setAudioState and setCallAudioState for all classes

Bug: 21040387
Bug: 21088300
Change-Id: I3ec7b3afdaa344c6d639d1c421f1842d67f7d0f7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6a2126477ce3f527ecaec807fe4f40cd13ff02b0 09-May-2015 Santos Cordon <santoscordon@google.com> Clean up PhoneAccountRegistrar.

Cleanup lots of duplicate code and consolidate all phone account
retrievals into a single method: getPhoneAccounts(...).

Consolidate checks for capabilities, package-name, uri, and
isVisibleForUser(...). This will be very helpful when
implementing enable/disable for phone accounts.

Bug: 20303449
Change-Id: I24d63cd313876f5d9390f2eb31c0ce79d7cb0ab2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5b2c59e20e1fafeafa8f50cc8b9dc0df15cdd812 24-Apr-2015 Etan Cohen <etancohen@google.com> Merge commit '0751e61' into merge2
92694519535c54f542b4ef3973e9c1934f2feeff 23-Apr-2015 Santos Cordon <santoscordon@google.com> Move CallState and rename PRE_DIAL_WAIT.

CallState was a public API only being used by Telecom so I've moved it
into to Telecom and removed it from the public API. The translation
from CallState to Call.STATE_* was happening on the public Call object
which wasn't ideal (Call.java shouldn't have to know that other
representations of state exist). So I moved the translation into
InCallController.java and what we pass into ParcelableCall is now
Call.STATE_* constants.

Bug: 20532827
Bug: 20532435
Change-Id: I79ce36c7e971c1a49b857506c9a56cfe316069cf
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f136b2714c5dd4e85d0a875abfa7baa77b29be38 20-Apr-2015 Santos Cordon <santoscordon@google.com> Merge "Add call event logging to telecom."
2685dabdb656f72dfe851215f2e99f82896f052f 18-Apr-2015 Santos Cordon <santoscordon@google.com> Add call event logging to telecom.

This code saves the last 5 calls and prints out all the call-related
events when doing a "dumpsys telecom". This includes dumping all
information about the last 5 calls so that bug reports always contain
information about the calls.

Bug: 18923652

Change-Id: I4dbdea32ba4eea3b3a4158fbae99649dc045cd62
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7cc486c725e2ae9b8051b4f36fd0c41ff3a8aca3 16-Apr-2015 Jay Shrauner <shrauner@google.com> Remove connection substate

Bug:20300433
Change-Id: I4148ac2677598d4db60950712fda2a3be726d791
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0751e61ed2fd4fd828a4ca170a696fce369b31ea 16-Apr-2015 Andrew Lee <anwlee@google.com> resolve merge conflicts of 57412d3 to m-wireless-dev.

Change-Id: I3c3dece8a0efebb82969b521a5fef37fe2283774
d6782cdb82bf1d235dfb164cce6db3c8a5629720 16-Apr-2015 Santos Cordon <santoscordon@google.com> Turn speakerphone on at DIALING state.

When start-with-speakerphone is on, call used to go to speakerphone on
ACTIVE, but should go on DIALING.
Also, bug existed where it would go to speakerphone every time the call
went through HOLD-UNHOLD sequence.

Bug: 20265686
Change-Id: I6d281054b691efe62cde1e02987b498c5ec1dd13
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
57412d3a3079b2108d61747f4909bf02da29759f 14-Apr-2015 Andrew Lee <anwlee@google.com> Add StatusHints for Conferences.

Bug: 20160799
Change-Id: I88d3068a2c2d2d785e92bcb8b22143764f0a6207
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
73ff372fda987a9e797d1c4ecf363a16b7d2abda 15-Apr-2015 Vinit Deshpande <vinitd@google.com> am 959afe0..abcbce4 from mirror-m-wireless-internal-release

abcbce4 Fix deadlock around locking in AudioManager
5a1b1fd Merge "Add more capabilities to TestVideoProvider" into m-wireless-dev
e09b47b Add more capabilities to TestVideoProvider

Change-Id: I00a8a3bebd56a5f78b6b3fa3958d6cf3929b1834
58813ab3b4ff0fb1cf8a0964a5a740c313a0df47 13-Apr-2015 Yorke Lee <yorkelee@google.com> am cebbeced: am 161f1a7e: Merge "CallsManager: fix starting call from Contacts app with MSim"

* commit 'cebbeced660ffb5a128bf246ef8bc92ee9719210':
CallsManager: fix starting call from Contacts app with MSim
d240fe8e16205623eb6cb73c3d42448554690033 02-Apr-2015 Rekha Kumar <rekhak@codeaurora.org> IMS-VT: Change parameter type of data usage
Change Data Usage methods to take parameters of type long
instead of int.

Change-Id: I6a277dedb5976261035084955ed8a90da256061a

IMS-VT: When TTY is ON, do not allow MO VT call
When TTY mode is ON, the user SHOULD NOT be allowed to make
a Mobile Originating (MO) VT call and an UI alert message will
be displayed explaining MO VT call cannot be initiated.

Propagate the call substate changed message to the UI

IMS-VT : Set the flag to start call with speaker on for incoming VT calls
- There seems to be a race condition between when InCallUI
enters the video mode and sets the speaker phone on and
when call state changes to active.
- As a result, the audio route gets reset to earpiece as we
are not setting speaker phone on flag for the incoming
case. This change fixes that issue.

IMS-VT: Set speaker phone to true only if bluetooth or headset is not connected

IMS-VT: Convert emergency video call to voice call.
Convert emergency video call to voice call.

Change-Id: I09b82dcb6308a1177716b77e87da68161000518b

IMS-VT: Enable Video conferencing.
Enable Video conferencing.

Change-Id: Ief145e0592e58de46c7a75d858effdd72fa8b476

IMS-VT: Check for property before enabling speaker for MT VT calls
Check persist.radio.ims.audio.output before enabling speaker
if property is set to disable speaker then MT VT calls should not
use the speaker.

Change-Id: I0c6288a8fd672c9b7a13edac11e29875d0df4eb7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
aa383cca668afd8578a6e007c3ea360768dc52f6 23-Mar-2015 Ihab Awad <ihab@google.com> Further cleanup, and move functionality into TestFixture objects

Change-Id: I62b514ae8fe10f720a60c681968efd2340616eba
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
abcbce4441720c52a443d292d5adc2d95f446494 07-Apr-2015 Ihab Awad <ihab@google.com> Fix deadlock around locking in AudioManager

Includes proof of concept tests, but the tests are not yet
highlighting the problem, due to its nondeterminism.

Bug: 20103143
Bug: 20108354
Change-Id: I8323a660c6cc4093888f4e608070709a828624e6
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
032f8e415661339bd1e9a2da5e295062a996a7f5 02-Apr-2015 Rekha Kumar <rekhak@codeaurora.org> IMS-VT: Change parameter type of data usage
Change Data Usage methods to take parameters of type long
instead of int.

Change-Id: I6a277dedb5976261035084955ed8a90da256061a

IMS-VT: When TTY is ON, do not allow MO VT call
When TTY mode is ON, the user SHOULD NOT be allowed to make
a Mobile Originating (MO) VT call and an UI alert message will
be displayed explaining MO VT call cannot be initiated.

Propagate the call substate changed message to the UI

IMS-VT : Set the flag to start call with speaker on for incoming VT calls
- There seems to be a race condition between when InCallUI
enters the video mode and sets the speaker phone on and
when call state changes to active.
- As a result, the audio route gets reset to earpiece as we
are not setting speaker phone on flag for the incoming
case. This change fixes that issue.

IMS-VT: Set speaker phone to true only if bluetooth or headset is not connected

IMS-VT: Convert emergency video call to voice call.
Convert emergency video call to voice call.

Change-Id: I09b82dcb6308a1177716b77e87da68161000518b

IMS-VT: Enable Video conferencing.
Enable Video conferencing.

Change-Id: Ief145e0592e58de46c7a75d858effdd72fa8b476

IMS-VT: Check for property before enabling speaker for MT VT calls
Check persist.radio.ims.audio.output before enabling speaker
if property is set to disable speaker then MT VT calls should not
use the speaker.

Change-Id: I0c6288a8fd672c9b7a13edac11e29875d0df4eb7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b63b57e2c35c4769e756f47131c7ebbc0af42c59 23-Mar-2015 Ihab Awad <ihab@google.com> Further cleanup, and move functionality into TestFixture objects

Change-Id: I62b514ae8fe10f720a60c681968efd2340616eba
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e6dbc9d8448211f10b245ededf25d740cb561b40 26-Mar-2015 Ihab Awad <ihab@google.com> Fix problem where incoming calls would hang and never complete

Bug: 19941246
Change-Id: I50f50f2ab81a79069a5a7a0884eaa75daa43a909
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d1d63e149fb9b820b4004c745c86d13b5334e780 26-Mar-2015 Ihab Awad <ihab@google.com> Fix problem where incoming calls would hang and never complete

Bug: 19941246
Change-Id: I50f50f2ab81a79069a5a7a0884eaa75daa43a909
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
2d4deb580ae7ded601c1d5f05498cb16252ed39e 25-Mar-2015 Prerepa Viswanadham <dham@google.com> Fix merge conflicts in CallAudioManager and CallsManager.
Update a call to a hidden platform ctor in SimpleTelecomTest.

Change-Id: I76f6d0b9c49862b9412196ce2ea4d3e3ed960357
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
3d05da65a8e488be546b9cef2f44e1a5567132ad 24-Mar-2015 Prerepa Viswanadham <dham@google.com> Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release' into master_merge

Change-Id: I5d9ab761a1060a24680e69d1610ade206660e139
8d5d9ddc66b55b6906364ab3c0e244dab4d58f13 12-Mar-2015 Ihab Awad <ihab@google.com> Make Telecom synchronous

Remove main-thread handlers and add a systemwide lock object.

Change-Id: I6334fdfa6c244836f6375bea302404f61c81301b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
8de76915ea2772faeb41705aaaeb65f5b3478ac4 17-Feb-2015 Ihab Awad <ihab@google.com> Further refactor Telecom and add tests

Complete refactoring Telecom to remove singletons from the core code.

Introduce a unit test that simulates a full outgoing phone call from
start to hangup.

Change-Id: I8b09cac6eb9b6aeeb0aeba5d8ae032b4c303c08d
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
2a61edaf7945ca15366040d29010c0a6e151a238 16-Mar-2015 Vinit Deshpande <vinitd@google.com> Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release'

Change-Id: I5bde841b9c5766ab33077ae4fd25c546b10117c7
1b2fd28fb06327359644b2787c668d6ebbc6a68f 15-Mar-2015 Pawit Pornkitprasan <p.pawit@gmail.com> CallsManager: fix starting call from Contacts app with MSim

The extras bundle may be Bundle.EMPTY, which immutable. Create our
own copy to modify.

Change-Id: If875eddc6afe9c5ca4b0d59a51902529cf115487
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
712991aaea7ceba5c98cb1f7185ca8a7808f3dac 07-Mar-2015 Santos Cordon <santoscordon@google.com> Merge "Toggle speakerphone when user un/docks from car/desk dock."
a04bdcaf9f0d9dbb5b03080b74a7c562421d183f 05-Mar-2015 Santos Cordon <santoscordon@google.com> Toggle speakerphone when user un/docks from car/desk dock.

Bug: 18301017
Bug: 14996126

Change-Id: I82a4ee3114bbdd08d5d83bc7a3518c6856973072
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d35be75e088fd4f9073678d89186c959f79001f3 06-Mar-2015 P.Y. Laligand <pylaligand@google.com> Made package name and directory structure match for a Telecomm unit test.

This makes Eclipse happier, and helps make new projects error-free.

Change-Id: Ic91823155c280a3808c246f66325e5e9b77fea9a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
78a5e6b9c1595c81f72d7a822617cb78db224e48 06-Feb-2015 Ihab Awad <ihab@google.com> Refactoring for testability

Refactor to a single app singleton, TelecomSystem, which owns the
intialization of the rest of the app.

Change-Id: I3036f200b56f710e7f830b469260a67145c327e7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
a365390b0d157fbe1655cdc41ea5d13fa13fdbdf 23-Jan-2015 Ihab Awad <ihab@google.com> Minor visibility changes to make tests work again.

Change-Id: I023974f9f145ec9b39b6d8a1c3b1679638dd59f7
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
d92e73772327537fe65edda43ca0ceb6fc781e51 10-Jan-2015 Tyler Gunn <tgunn@google.com> Fix for call timer resetting when starting IMS conference call. 4/4

- Added support in Conference for specifying the connect time when the
conference is created.

Bug: 18959443
Change-Id: I7a0b9e65b955c53314f6b23a5543e0e161998da5
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
3e59d689d08b921244c0a8c2e7761a242c59a3d0 06-Jan-2015 Tyler Gunn <tgunn@google.com> Merge "Fixing unhold in CallsManager so it does not hold child calls." into lmp-mr1-dev
811ad27dabf38d305ff94cc41fc266d774821ddb 05-Jan-2015 Andrew Lee <anwlee@google.com> Merge "Disconnect held call when answering third call." into lmp-mr1-dev
e94a8f1e28be35d538e1e485753b122ce7908e98 20-Dec-2014 Andrew Lee <anwlee@google.com> Disconnect held call when answering third call.

When accepting a call when there was already both an active
and held call, the CallsManager tried to hold the active call, and
then answer the new incoming call. But since there were still two
calls tracked by the calls manager, the answer failed.

To fix, if we are attempting to hold the active call before accepting
a new call, if there is a pre-existing held call disconnect that held
call before holding the active call.

Bug: 17318947
Change-Id: I78e5899c5f0344af0245b77827df75f9dde683b4
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e44adb45088cc8fa199731a7f8cb0a5359028961 02-Jan-2015 Tyler Gunn <tgunn@google.com> Fixing unhold in CallsManager so it does not hold child calls.

There was an issue (see bug) where a conference could not be held in order
to swap with a held single party call.
Looking at how the CallsManager code works, we hold all calls including
the child calls of a conference. In Telephony, the TelephonyConference
code invokes hold on the first child-connection in the conference.
Changed the code so that the child calls are not held in Telecom.

Bug: 18793259
Change-Id: I83cde7be1e006fbd05ba79c13ee1a1138b1ae593
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
c88574c74d48ec6d660cbe2563c826521d95e92b 16-Dec-2014 Anju Mathapati <anjucm@quicinc.com> IMS: Add phoneaccount to ims conference call.

Retrieve phoneaccount from ParcelableConference coming from
TeleService and set that account to Telecom Conference call.
This prevents hold and dial request from getting invoked from
Telecom during adding a call on top of an existing ims 3 way
conference call.

Bug: 18690773
Change-Id: Ie02e12c77272c2c889b1c7377e0bf461e67a1abd
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
a469f76c1710a945933910840f11f9fda0445d82 10-Dec-2014 Nancy Chen <nancychen@google.com> Play DTMF tones when sending DTMF tones during post dial wait.

Regression from KK -- when adding additional digits to a number limited
with a wait character (";"), the local DTMF player should make those
sounds audible to the caller.

Bug: 18644688
Change-Id: Ib04658316f725146a65b399d3f477791260c3f5a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e6a33f2e9ec77f900260a50242d657668706c0ae 02-Dec-2014 Santos Cordon <santoscordon@google.com> (Telecom-system part 4) Move telecom to the system server process.

Also remove TelecomApp since it is no longer run/necessary after this
change.

Bug: 18112269
Change-Id: I901023a2333b5c664cd2dc314d2df638355e9d41
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0d79b684bc7fe913d4b1a0a5ac3aec77dbf2364a 03-Dec-2014 Anthony Lee <anthonylee@google.com> Merge "Maintain Full Wake Lock while an incoming call is ringing." into lmp-mr1-dev
1bf97f5278c2a1d635e82ce41dfb3d223c9bfee7 03-Dec-2014 Andrew Lee <anwlee@google.com> Merge "Don't show add if there is an outgoing call." into lmp-mr1-dev
61e6f352c9c1fe8dc346ccf8d3560f7060ec663a 03-Dec-2014 Santos Cordon <santoscordon@google.com> Maintain Full Wake Lock while an incoming call is ringing.

Bug: 18474158
Change-Id: Ia9190a4ee34e138ccd91515db080a98754a0dd27
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
113ad62c43fa0cc8329c19cafa8dd8e2731b9b3c 02-Dec-2014 Andrew Lee <anwlee@google.com> Don't show add if there is an outgoing call.

We only support one outgoing call, so don't enable ADD when the call
is in an outgoing state (eg. dialing).

Bug: 18504905
Change-Id: Ie65beff2f1d7f4644d6b653902ce9fe4b3236e4f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
59979513fd16c03bc2b901177b679eb5af39504a 02-Dec-2014 Yorke Lee <yorkelee@google.com> Disconnect all calls that are not reused when placing new call

This fixes a bug with Google voice calls where a call that was not
reused was causing future calls to be rejected.

Also log an error when there is no more room for an outgoing call
to make it easier to debug.

Bug: 18481759
Change-Id: I20da180211d81fdf23e50479619a1f6a8a303c9b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
07bc5ee853bc9a0b4cd46e0c702888b2c7989392 12-Nov-2014 Ihab Awad <ihab@google.com> Telecom API updates (4/6)

Bug: 18292176

Change-Id: I28e6aa4fec20aadd77f9a861b0bb8e1e9828cffb
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
82430ce4a9211bcdf70a582519c979b4ef4506ff 26-Nov-2014 Nancy Chen <nancychen@google.com> Merge "When adding a new call, use same phone account for call." into lmp-mr1-dev
bc95db90d9f463fe475c53c8ce15ea99bb716cdb 24-Nov-2014 Nancy Chen <nancychen@google.com> When adding a new call, use same phone account for call.

Because MSIM does not support having two active calls with different
SIMs, use the SIM of the currently active call to place additional
calls.

Bug: 18461539
Change-Id: I38411a5f9f330d2064830068629651653a0871d3
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
77804e7345660156b3c8421132be90ce00b70635 24-Nov-2014 Santos Cordon <santoscordon@google.com> Merge "Remove Guava references from Telecom." into lmp-mr1-dev
4bc0245eb5c09ab48dcbb673eefdf7175ae8ac9c 20-Nov-2014 Santos Cordon <santoscordon@google.com> Remove Guava references from Telecom.

Prepping telecom to run in system-server process by removing references
to guava.

Bug: 18112269
Change-Id: I994be480284462240da46c9cf0e47aa83f5f1fe9
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
98c4e2a1f98dcf27ee57151811814e2e0fbb76c3 20-Nov-2014 Santos Cordon <santoscordon@google.com> Merge "Fix call duration for unanswered/missed calls." into lmp-mr1-dev
40f9b179e6aaa0d906d38a48040425f82727aab4 17-Nov-2014 Santos Cordon <santoscordon@google.com> Fix call duration for unanswered/missed calls.

Made call times be equivalent to Jellybean/Kitkat.
Missed calls, rejected calls, unanswered outgoing calls all show 0:00.
Missed calls in particular dont show a time at all.

Tested with Conference calls, Active/Hold, Rejected, Missed,
Outgoing->Rejected, Outgoing->End Call.

Bug: 18403859
Change-Id: I60bedc425681808d48d768a435f86f2545916de1
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e4a9c412f5c6f76f006659f0b4e171ef4547dc45 15-Nov-2014 Yorke Lee <yorkelee@google.com> Add Systrace logging to Telecom

More granular per-listener logging is protected by a
static boolean flag which is currently turned on for
dogfooding.

Bug: 18373617

Change-Id: Id37c75f2e2475923dcd66aa7325b3d8767f29a97
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
36e3ada72c816a3802f43bc6116cbf1b7c24f18e 12-Nov-2014 Yorke Lee <yorkelee@google.com> Merge "Cleanup and remove call if ConnectionService crashes" into lmp-mr1-dev
2af16b65f88fcb84d15b701f8f112f7f5a443eaf 12-Nov-2014 Yorke Lee <yorkelee@google.com> Cleanup and remove call if ConnectionService crashes

Make sure that call is removed from CallsManager if its
ConnectionService crashes.

Verified fix with TestConnectionManager.

Bug: 18262469
Change-Id: Idae71186b6547cb5a4c89e273c779eef030a2952
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7e2c7f34dde14afd18c13d39777331ec2ef3a46a 03-Nov-2014 Ihab Awad <ihab@google.com> Update PhoneAccount icon API (5/6)

Bug: 18291787

Change-Id: I0b83c0d36c67e12c27355d0893a0fa78a4f3aaa6
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
91bd74cbe13428643a73acb5c7fd5d7dd136b6d9 08-Nov-2014 Santos Cordon <santoscordon@google.com> Make add-call a global property of telecom. (2/4)

ADD_CALL didn't make sense as a property of Connection or Call.
This changes it to be a global property instead.

Bug: 18285352
Change-Id: I5189e114e74dba2d81d74c6d24cf5b17f1e0922a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
cf5b2918ca58b155911a66222ae5b4d21cb5b8ec 06-Nov-2014 Santos Cordon <santoscordon@google.com> Reuse calls canceled through NEW_OUTGOING_CALL broadcast.

When a call is canceled because of NEW_OUTGOING_CALL broadcast,
we no longer remove it immediately. This code adds a 200ms delay.
The 200ms delay is long enough that if an app reposts another call
to the same number (with a gateway number, for example), instead of
destroying and recreating the call, we attempt to reuse the existing
one. This eliminates the jank in the UI caused by the call being
destroyed and a new one recreated.

Bug: 17692408
Change-Id: I225a4fcc6f00d764cf76595f15f6d2d0785b9fe2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
6e2b94eae72c72b11358fdb99f87471b5ab11e4f 30-Oct-2014 Tyler Gunn <tgunn@google.com> Creating connections for conference event package participants.

- Add "addExistingCall" method to Connection service wrapper to handle
the creation of new calls for connections which already exist in telephony.
- Fixed but in setIsConference message where an isValidCallId check made
outside of the handler would result in a newly added call NOT being
marked as conferenced due to a race condition. The MSG_SET_IS_CONFERENCED
handler already checks if the call exists before performing its operation.

Bug: 18057361
Change-Id: I2348c8e6985cd831f2cae56b37dfcb33bae014a8
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
4550623ca162ccb3291ec3f020b7ad3346784ebd 23-Oct-2014 Andrew Lee <anwlee@google.com> Don't start video call if already in a video call.

+ Check enforced if the intent has an extra for bidirectional
videocalling and the calls manager already has a call with
video state bidirectional.
+ Show an error toast message if that's the case.

Bug: 17009418
Change-Id: I72d4c3660c19f163eadd88abed7677892ce6b1cc
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
0bde0c54da301d30e1bfcf40603cb2a6e4141883 23-Oct-2014 Nancy Chen <nancychen@google.com> am 1e01a160: Merge "Add an option to set the selected phone account as the default. (2/3)" into lmp-sprout-dev

* commit '1e01a1603ff2a99fdf4fcf8b73c72eb867f0dd97':
Add an option to set the selected phone account as the default. (2/3)
1e01a1603ff2a99fdf4fcf8b73c72eb867f0dd97 23-Oct-2014 Nancy Chen <nancychen@google.com> Merge "Add an option to set the selected phone account as the default. (2/3)" into lmp-sprout-dev
9aedea3224a45242786d352f5454ffcfa44b8eba 22-Oct-2014 Santos Cordon <santoscordon@google.com> am e5cbf7d6: am 27d9e273: Merge "Send BTPhoneService update when active/background calls switch." into lmp-dev

* commit 'e5cbf7d6066fa68ffc2a7ba9042c888593355574':
Send BTPhoneService update when active/background calls switch.
89e060ee6762f34b16a3d90e3295d707800b313d 22-Oct-2014 Yorke Lee <yorkelee@google.com> am 76a123e9: am efba60b2: Merge "Fix typo when forcing recalculation of call capabilities" into lmp-dev

* commit '76a123e96a3cf4c68f5d4c0d80db10729f479ffb':
Fix typo when forcing recalculation of call capabilities
163f670d5524c58c810cd4f1f60122baa5adc83e 22-Oct-2014 Andrew Lee <anwlee@google.com> Merge "Remove ADD_CALL if not only top-level call." into lmp-mr1-dev
e5cbf7d6066fa68ffc2a7ba9042c888593355574 22-Oct-2014 Santos Cordon <santoscordon@google.com> am 27d9e273: Merge "Send BTPhoneService update when active/background calls switch." into lmp-dev

* commit '27d9e2734a7f6f3c413c91a4501c2e95f503f747':
Send BTPhoneService update when active/background calls switch.
27d9e2734a7f6f3c413c91a4501c2e95f503f747 22-Oct-2014 Santos Cordon <santoscordon@google.com> Merge "Send BTPhoneService update when active/background calls switch." into lmp-dev
8d44b907e9fe1b15b922ff188c199319cf0c89a0 22-Oct-2014 Nancy Chen <nancychen@google.com> am 94586cdd: Merge "Enable account selection for MMI codes that involve "dialing"." into lmp-sprout-dev

* commit '94586cdd5f29066e041d4c95f43a8e8e539ee1a0':
Enable account selection for MMI codes that involve "dialing".
f5e5d3ccf108c41e06983a582742b00d221b78b7 22-Oct-2014 Nancy Chen <nancychen@google.com> Add an option to set the selected phone account as the default. (2/3)

Modify the phoneAccountSelected method to support the option to set the
selected phone account as the default for outgoing phone calls.

Bug: 18078232
Change-Id: I1c0e1ba9ef7d886d890d86825eb53bc0ba8483d1
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
235a52fae2ce75a38311569c4a22fcbeed8c5c94 21-Oct-2014 Andrew Lee <anwlee@google.com> Remove ADD_CALL if not only top-level call.

ADD_CALL now depends on the state of the underlying connections, and
the mix of GSM/CDMA/IMS connections.

I propose to address this by setting those capabilities as true on
the GSM/CDMA connections, then further filtering in Telecom depending
on the call state (ie. whether it is the only top level call, and
whether or not we're dialing). I think this logic should be simpler,
and also allows us to more directly control this capability depending
on the connection type.

Bug: 18062269
Change-Id: Ie5be502545a580719e65595e495ff30cbc3fc22f
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
c0ca76ee6dc2d21cf1e9f310f2d16662c8ceb25e 22-Oct-2014 Santos Cordon <santoscordon@google.com> Send BTPhoneService update when active/background calls switch.

This sends an update if the call-on-hold changes (when active and
background calls swap) as well as using a proper held-call count instead
of hardcoded 1 when there are multiple calls on hold.

This is needed to pass BT PTS test TC_AG_TWC_BV_03_I.

Bug: 17962996
Change-Id: Ia6d5f649020837a1ca37d0895f8844fcdec04446
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
76a123e96a3cf4c68f5d4c0d80db10729f479ffb 21-Oct-2014 Yorke Lee <yorkelee@google.com> am efba60b2: Merge "Fix typo when forcing recalculation of call capabilities" into lmp-dev

* commit 'efba60b21218cc41251b04c71fa0ec5edc44d798':
Fix typo when forcing recalculation of call capabilities
7ae9eed7b50b423a7351c0de292e1ef4d3861344 21-Oct-2014 Yorke Lee <yorkelee@google.com> Fix typo when forcing recalculation of call capabilities

Bug: 18071704
Change-Id: Ib389ce72bc43e2fc073af5afc6383f3250046b27
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
94586cdd5f29066e041d4c95f43a8e8e539ee1a0 21-Oct-2014 Nancy Chen <nancychen@google.com> Merge "Enable account selection for MMI codes that involve "dialing"." into lmp-sprout-dev
8d92f45672193c2b1179113b6cf5aedb19d2dc39 21-Oct-2014 Nancy Chen <nancychen@google.com> Enable account selection for MMI codes that involve "dialing".

Some MMI codes (specifically a small set of GSM codes) involve pressing
"dial" to send the code. The connection service identifies that this is
an MMI code and responds accordingly, including canceling the call. In
the multi-SIM case, we want to bring up a dialog to select a SIM
"connect" through. We can use the current PRE_DIAL_WAIT state and select
account dialog to do this.

Bug: 17573147
Change-Id: Id765e595f3149c088ae5de72a97cc2034338b6ee
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
686f453920381348ec162828269e751aca535580 20-Oct-2014 Yorke Lee <yorkelee@google.com> am eae93b4c: am c9fe671f: Merge "Update call capabilities when call is removed" into lmp-dev

* commit 'eae93b4c741e70d8f0780ca92c747f6950173d8d':
Update call capabilities when call is removed
c9fe671fe1e780cf6d6e2bb59ddb47c51ea038a3 20-Oct-2014 Yorke Lee <yorkelee@google.com> Merge "Update call capabilities when call is removed" into lmp-dev
604a90f596deb41998e021151b3ddc8019e28eac 20-Oct-2014 Yorke Lee <yorkelee@google.com> Update call capabilities when call is removed

Bug: 18018700
Bug: 17586196
Change-Id: I4bb733fea421e4c18378f0ff96b571e6b2f66a14
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
bd33024d5e1d2069896821d95c9888368597a157 16-Oct-2014 Yorke Lee <yorkelee@google.com> am b38c54f8: am aa6ea25b: Merge "Partial revert of Ic0055a53ac85980fa22136a5c8b6cb59be347da9" into lmp-dev

* commit 'b38c54f8348ee11677ef689c56c987113e008aa1':
Partial revert of Ic0055a53ac85980fa22136a5c8b6cb59be347da9
a348438f79205afd3a0ca564f18d75e1505372de 16-Oct-2014 Yorke Lee <yorkelee@google.com> Partial revert of Ic0055a53ac85980fa22136a5c8b6cb59be347da9

The original fix for Google Voice caused the account selection
dialog to not show up.

Bug: 18014056
Change-Id: I6d5ed0a60e4bad2d7a023006b794e0cbc21eab5a
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9f040550d16599113df65b6ec8c412f699298a76 15-Oct-2014 Tyler Gunn <tgunn@google.com> Merge "Adding more Telecom state dumping." into lmp-mr1-dev
9787e0e80d8960cf8b0ca74c7cdc4c4aac97187a 14-Oct-2014 Tyler Gunn <tgunn@google.com> Adding more Telecom state dumping.

Bug: 17730966
Change-Id: I47c83591417784c9484002213230065514b43f63
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
504eb83ea06f4c737a4f4fdbd65aa2450505420c 13-Oct-2014 Tyler Gunn <tgunn@google.com> Fixing issue where Google Voice calls are logged twice to call log.

1. Changed disconnect cause for aborted calls to "CANCELED" which ensures
they are not logged.
2. Also, added a check in Telecom to avoid bringing up the InCall UI
immediately when a new call is made, if Google Voice is installed. This
is to ensure that the user does not see two reveal animations. This was
due to the fact that when the call was initially added and subsequently
aborted, the InCall ui would be shown. With this change, if GVoice is
installed, adding the call is delayed.

Bug: 17961478
Change-Id: Ic0055a53ac85980fa22136a5c8b6cb59be347da9
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
66fe882a6437de1010af0dc8cd7350f81f2e028a 11-Oct-2014 Santos Cordon <santoscordon@google.com> Update foreground calls with child-parent call changes.

Bug: 17699262
Change-Id: I4de8bd876b142e2762a369a36ea2e7dcc7b84e65
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
9250e5fa9987c3ab80e11e1955657055f5866539 01-Oct-2014 Yorke Lee <yorkelee@google.com> Add ability to add sim-initiated MO call to UI (3/4)

Pipe an unknown call through CallsManager via various new APIs like
onSuccessfulUnknownCall, onFailedUnknownCall, etc. These are the unknown call's
equivalent of onSuccessfulOutgoingCall and onFailedOutgoingCall.

Only the TelephonyConnectionService is allowed to call this hidden new API
in Telecom.

Also add the ability for TestConnectionService to test this API (although the
check for TelephonyConnectionService must be disabled at build time first).

Bug: 16852844
Change-Id: I5dfdfc1bd4675f6b300a4a55a3098582f9d715a2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7984e0a7909d18ec4b16741fa28d9126f49018d4 02-Oct-2014 Andrew Lee <anwlee@google.com> Merge "Removed failed outgoing calls." into lmp-dev
5b452df44f5bbd1b8984611d5e6de6ebf14aa0f2 02-Oct-2014 Tyler Gunn <tgunn@google.com> Allow sending of in-call MMI codes through to telephony.

1. Fixing bug where having multiple calls in progress it would not be
possible to send the ECT MMI code due to code that checks for the number
of current calls.
2. Fixed issue where InCall MMI codes would be dialed as a regular call,
showing the InCall UI. In KitKat, dialing an incall MMI code would
bypass the InCall UI, dialing the MMI code directly.

Bug: 17700763
Change-Id: I41b9b329609e100540c4d60e1243dc08354bb481
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
e6288a7a6765006f155d259bea8bfd26ce8c6205 01-Oct-2014 Andrew Lee <anwlee@google.com> Removed failed outgoing calls.

The user is unable to add a call in this bug, because the call is not
add capable. It fails the isAddCallCapable check because there are
multiple calls; one of which is not the same call and does not have
a parent.

This appears to be because of some interaction with Google Voice (at
least in the specific case I was observing), where the initial call
is disconnected and then the call is rerouted. When this initial call
is disconnected, it was not removed, leading to this (erroneous) two
call state.

Fixing this by explicitly calling remove call for failed outgoing
calls. Formerly, they were only marked as disconnected.

Bug: 17731082
Change-Id: I0d6401cbc593a128483072c5faa189949e73d71e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b63254cfa6a9c404fab98f51b2b2f4acf34b59b6 27-Sep-2014 Qiwen Zhao <zhao@google.com> Merge "Don't stop outgoing calls if we are the foreground call." into lmp-dev
d176650e14205f34fff93b14341f6313437b703c 27-Sep-2014 Santos Cordon <santoscordon@google.com> Don't stop outgoing calls if we are the foreground call.

When attempting outgoing calls we do checks to make sure there is room
for another outgoing call (we only support 1 at a time). But that code
needs to check to see if the new call is already the foreground call and
if so, let it continue.

Without this change, we never make an outgoing call in the "Ask
First" case

Bug: 17672699
Change-Id: I9bf37b08e54e2fc2ace1295ce269775cb14d08f1
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
bb907d4878612ffc45464afeb70e06b91b6d91f6 27-Sep-2014 Ihab Awad <ihab@google.com> Merge "Attempt to unhold remaining holding call on disconnect (1/2)" into lmp-dev
05a9e40ba1edc7b4597163f73503e2e92b746208 26-Sep-2014 Nancy Chen <nancychen@google.com> Ensure bluetooth does not get hangup sound when calling through gvoice

Because Google Voice works by canceling an outgoing call and starting up
its own outgoing call, telecom registers the first call as a
disconnecting call and sends a signal to the bluetooth device that the
call was disconnected. This causes a hangup sound from the bluetooth
device. This fix works by having bluetooth ignore a call until it gets
into the dialing state, which only happens after the google voice call
has connected.

Bug: 17662993
Change-Id: I52c504f615534c59ede8c0de520f755484922730
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
5b28132e9e05b33ed08421f9c0fe85523da1f064 26-Sep-2014 Ihab Awad <ihab@google.com> Attempt to unhold remaining holding call on disconnect (1/2)

Bug: 17480900
Change-Id: I9d16419a969f833aa830de7f9ab5df8772a935c4
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
68d1a6b0bd8840b74c61a94928610312c09b0486 19-Sep-2014 Santos Cordon <santoscordon@google.com> Move BluetoothPhoneService to telecom.

BluetoothPhoneService needs to be in telecom to be aware of all types of
calls. While in telephony, there's no way for it to know about
third-party sourced calls.

Additionally, conference calls for CDMA are no longer functional in the
telephony layer and needs to move to telecom to support BT commands on
CDMA calls.

Bug: 17475562
Change-Id: I443431291a3b0120d92b52dba2acca17a4c0c983
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
ad3355a3eac640e14a2da77a11bf2fcc96286984 24-Sep-2014 Andrew Lee <anwlee@google.com> Merge "Refuse outgoing call if max outgoing exceeded." into lmp-dev
e659518bac4b3551446e813751abc8d1c70b2d5b 24-Sep-2014 Andrew Lee <anwlee@google.com> Refuse outgoing call if max outgoing exceeded.

This bug was happening because multiple calls in the CONNECTING state
were being added. Now, if there's an attempt to place multiple calls,
ignore when the maximum number of outgoing calls is exceeded.

Exception: if the outgoing call is an emergency call, cancel the
current outgoing call if the current outgoing call is not an
emergency call itself.

Bug: 17610917
Change-Id: I0ae041fa3a09a2fb9508f2342894e77b87001b43
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
add3c272faf44a46e94b25eca78d831c49bec375 23-Sep-2014 Andrew Lee <anwlee@google.com> Merge "Don't enable "add call" if CDMA and in conference." into lmp-dev
c11fcd97994f469d24b58a2d9dc5cddaa5a1081f 20-Sep-2014 Andrew Lee <anwlee@google.com> Don't enable "add call" if CDMA and in conference.

Bug: 17581379
Change-Id: Id64dd7b2c780f2de7fcc637a68ba2e6bd1483889
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1ccab206c39d0fafde7475bd1ff23fd346a17339 19-Sep-2014 Nancy Chen <nancychen@google.com> Skip "PRE_DIAL_WAIT" when no accounts are available to chose from.

Go straight into "CONNECTING" state when no account is preset and there
are no available accounts to select from (for example if it is a SIP
call and no SIP accounts are registered). The InCallUi will handle
disconnecting the call and displaying an error message.

Bug: 17486242

Change-Id: Ieaa89c908caab15811d4708f76fe674bd96900b8
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
1c5926fc5f3c828c5b16c25a5154e5a0306ea3e7 17-Sep-2014 Nancy Chen <nancychen@google.com> Replace get*PhoneAccounts* public API methods with new method (2/3)

Hide getCallCapablePhoneAccounts and getPhoneAccountsSupportingScheme
because a third party app should not be able to see all phone accounts
registered. Replace instead with getPhoneAccountsForPackage(Context)
which will only return the phone accounts registered by a particular package.
Also pass available phone accounts for the user to select from through
Telecom to InCallUI so InCallUI will not be calling the Telecom API
directly to get these accounts.

Bug: 17510811

Change-Id: Ia91972bc4cfa938b743f6b3b165a81d4acd58c45
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
ce1a21ef6e0221107383b228c2219b3f0586eb67 17-Sep-2014 Tyler Gunn <tgunn@google.com> Merge "Preparatory work to move Telecom to system service." into lmp-dev
c9433c3804369d72474883242ca38a7ef76f03cf 17-Sep-2014 Ihab Awad <ihab@google.com> Merge "Automatically un-hold calls brought to the foreground" into lmp-dev
91d43cf9c985cc5a83795f256ef5c46ebb8fbdc1 17-Sep-2014 Tyler Gunn <tgunn@google.com> Preparatory work to move Telecom to system service.

- Removed use of TelecomApp.getInstance() as context.
- Refactored singleton logic and initialization to support being
performed from a SystemService.
- Note: You will see some commented out references to
"import com.android.internal.R"; these must uncommented when the code
is moved to a system service.
- You will also notice in PhoneAccountRegistrar.java a comment block with:
"UNCOMMENT_FOR_MOVE_TO_SYSTEM_SERVICE"
The code in that comment block will replace the existing file path
code.
These were added as a convenience so that I can run a simple sed script
to make the required changes to the code in an automated manner once it
is moved to its new location.

Bug: 17364651
Change-Id: I8e80e9cffc481b688c10a2bca0b59f5ccf8e0fb2
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
b3c4b285b747c58bfa58e2c58e09cdfb2c2b03b8 17-Sep-2014 Nancy Chen <nancychen@google.com> Merge "Remove ability to enable/disable phoneaccounts (3/6)" into lmp-dev
309198ec4d8b2738cf955316ea7a2f9418929fd1 16-Sep-2014 Nancy Chen <nancychen@google.com> Remove ability to enable/disable phoneaccounts (3/6)

Enabling/disabling of phone accounts was only used for SIP accounts and
is no longer necessary for the purpose it was put in.
- Remove all references to enabling/disabling phone accounts
+ Rename getEnabledPhoneAccounts to getCallCapablePhoneAccounts

Bug: 17510811
Change-Id: I5e8a59fe2aaac2563fe4bf97138975e30b45aa3c
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
701dc006ac11625b55d872f1639107b028933895 12-Sep-2014 Andrew Lee <anwlee@google.com> Use telecomm DiconnectCause in services/Telecomm.

+ Some of this is straightforward replacing the old disconnect cause
code/message with the new DisconnectCause object.
+ Replace codes in some instances; most maps straightforwardly to the
newer generic set of disconnect causes.
+ InCallToneMonitor can no longer rely on the specific telephony
DisconnectCauses. Now, instead, they map from a tone (which is
specified on the new telecomm DisconnectCauses) to the type of tone
which should be played in InCall. Most of these are just taking
unique matches from InCallTonePlayer. It is a little redundant, as
the conversion just flips, but it seemed like the easiest way to
accomplish this given current constraints.

+ Behavior is unchanged, but now DisconnectCause.OUT_OF_SERVICE
will invoke InCallTonePlayer.TONE_CDMA_DROP.
+ Now play TONE_PROP_PROMPT regardless of whether there is precisely
one remaining call; this is because we can't distinguish between
telephony DisconnectCause.ERROR_UNSPECIFIED/NORMAL/LOCAL. I figured
this would be a relatively minor change in scenario, and it wouldn't
hurt for a tone to be played even in a disconnect in that scenario.

Bug: 17329632
Change-Id: I85767d424bcfd59b3929819c9c6de46fc4a8629e
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
a1ce6671ab8b48b422ec20954ac9dd7690b95aac 16-Sep-2014 Ihab Awad <ihab@google.com> Automatically un-hold calls brought to the foreground

Bug: 17480900
Change-Id: I2018759d05fdb75794983e276c1c5c1d5a5724a6
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f193ba45fae5bc87e6a57779e4f5b56be59d08b0 12-Sep-2014 Santos Cordon <santoscordon@google.com> Guard against simultaneous calls.

1. If you get an incoming call we auto reject it if any calls exist which
are in any state of dialing out. (Tested with SIP/PSTN combination).
2. If you answer an incoming call, we automatically disconnect the
foreground call if it does not support being put on hold. (Tested with
SIP/Cdma combination).

- Also fix bug where we were allowing a child call to be set as the
foreground call.

Bug: 17323602
Change-Id: Idf448299a17c6e6d9a6ed2c148af8e4cc9c16594
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
f86db2e63ec71781ac8214ed6d2603d02266143d 13-Sep-2014 Yorke Lee <yorkelee@google.com> Add getCallState to Telecomm

Use getCallState in TelecommManager.isInCall and isRinging

Bug: 17378767
Change-Id: Id356c03f7fa21297d0376d56e09ce3f45399435b
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java
7cc70b4f0ad1064a4a0dce6056ad82b205887160 13-Sep-2014 Tyler Gunn <tgunn@google.com> Renaming Telecomm to Telecom.

- Changing package from android.telecomm to android.telecom
- Changing package from com.android.telecomm to
com.android.server.telecomm.
- Renaming TelecommManager to TelecomManager.

Bug: 17364651
Change-Id: Ib7b20ba6348948afb391450b4eef8919261f3272
/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java