1085 Commits

Author SHA1 Message Date
Mengjun Leng
2570774338 Telecom: Reset the duration after the CDMA call is accepted
In android original design, the duration of CDMA MO call is started from
the dial command sent, so it is not the real duration of the active time.

In this patch, a new message is registered to listen the event of the call
accepted, and then reset the duration when the event happens.

Change-Id: Icc447012030ae243f200ec2c83b7d5210af9b31c
2018-07-31 14:14:22 +08:00
Treehugger Robot
ac47c63b36 Merge "Update InCallService API docs to explain how to show incoming call UI." 2018-07-13 18:52:52 +00:00
Tyler Gunn
06f0616f6d Make Connection#onSilence a public API.
Connection#onSilence is generally applicable to apps implementing the
self-managed ConnectionService API.
Also updated the docs to make it more clear where that API is to be used
and how the developer can silence the ringtone.

Test: CTS test, manual test.
Bug: 110348674
Change-Id: I1c1791c101827780949fd633c531ed83037e7b4e
2018-07-11 09:04:43 -07:00
Tyler Gunn
dc6e6c43bb Update InCallService API docs to explain how to show incoming call UI.
Updating InCallService API docs to give an example of how an InCallService
should display a new incoming call notification.

Test: make docs ; proof generated HTML
Bug: 110916900
Change-Id: I6f3c8d0d9f14a916336d5a84897772ed4aba3105
2018-07-10 10:53:12 -07:00
Tyler Gunn
b62aa315d1 Merge "Ensure self-managed calls use voip audio mode." 2018-06-06 21:19:04 +00:00
Hall Liu
378f1f4972 Add CallAudioState ctor as TestApi
Needed for CTS testing

Bug: 79528185
Test: CTS
Change-Id: Iad154257a93cc776d5800527e46e777fd6c88220
Merged-In: Iad154257a93cc776d5800527e46e777fd6c88220
2018-05-25 15:22:16 -07:00
Tyler Gunn
f2e08b4c2c Ensure self-managed calls use voip audio mode.
Although Telecom ensures that new calls use voip audio mode, the default
value from a Connection would override the Telecom default.

Bug: 76362663
Test: Modify test app to ensure it does not set voip audio mode, ensure
Telecom uses voip audio mode for new calls.

Change-Id: Ie6477659cf6dabd08f371d4958ece1d258cd3106
2018-05-24 10:44:44 -07:00
Tyler Gunn
f858a0e8d2 Make TelecomManager#endCall a public API.
A broad category of apps such as wearable companion apps and call blocking
apps rely on the ability to reject a ringing call.
Previously this was achieved using a broken TelephonyManager API which
lacked permission checks.
To support these applications, removing the @hide attribute on the existing
TelecomManager#endCall API so that apps with the existing
ANSWER_PHONE_CALLS permission can reject ringing calls and end ongoing
calls.  Logically if an app has permission to answer a call, it should be
able to end it.

Test: Created test app to verify API permission checks.
Test: Added new CTS tests to cover this API.
Bug: 78290258
Merged-In: Ic6527969793ebe05eb9c5fa8205558ae788ea572
Change-Id: Ic6527969793ebe05eb9c5fa8205558ae788ea572
2018-05-08 11:19:18 -07:00
Tyler Gunn
9bc35116e3 Add ability to log last 2 digits of dialed numbers in userdebug builds.
Filers of bugs often refer to specific phone numbers.  Bug reports by
default obscure dialed phone numbers from the Telecom logs.  This makes it
difficult to relate events in the bug report to what the bug filer refers
to.

To ease this, in userdebug builds we will now leave the last 2 digits of
dialed phone numbers un-obfuscated.  User builds will remain obfuscated.

Test: Added unit tests to cover this case.
Bug: 78457192
Change-Id: I52704cf57ed11b1fa53a55bc883d7d090af661f4
2018-04-23 09:52:25 -07:00
Hall Liu
1539283965 Change signature of requestBluetoothAudio
requestBluetoothAudio now takes a BluetoothDevice instead of a string.

Bug: 74408978
Test: unable to CTS -- can't emulate bluetooth devices
Change-Id: Id21e32b911da234f69a248e9937f9df0cf12a9a9
2018-04-02 13:52:57 -07:00
Tyler Gunn
5c60d71efb Rename handover failure constant per API review comments.
Expanding EMERG to EMERGENCY.

Test: Build code
Bug: 74831393
Change-Id: Ib7e6bea84e25b1e1a2ddb154c7ed62f1084a7596
2018-03-16 12:38:43 -07:00
Tyler Gunn
5f7265ec9c Update API docs for Telephony call state reporting.
Update TelephonyManager#getCallState,
PhoneStateListener#onCallStateChanged to make it clear which calls each
method considers in determining call state.
Added intdef for call state (allows auto doc generation of valid
values for parameters).

Test: make docs
Bug: 73245376
Change-Id: I70ebd0f00ae3f0e1370ae275be8f8ef6f008523d
2018-03-13 15:56:37 -07:00
Treehugger Robot
8882c55b21 Merge "API Documentation and Constant cleanup." 2018-03-07 19:33:52 +00:00
Tyler Gunn
ecb46b610c Merge "Ensure start of call properties are propagated to RemoteConnection." 2018-03-07 15:22:58 +00:00
Hall Liu
8c8d7babf1 Fix Telecom dumpsys timestamps
Change the dumpsys timestamps to use java.time for processing and always
log events with local timezone that was in effect at the time the event
happened.

Bug: 74250969
Test: manual, run dumpsys
Change-Id: Ie53cff4400be1528b3224bd556536a689ef22c8c
2018-03-06 14:20:37 -08:00
Tyler Gunn
9d12773b51 API Documentation and Constant cleanup.
1. Update handover API docs for clarity.
2. Added an unknown value per API review comments.
3. Renamed HANDOVER_FAILURE_DEST_USER_REJECTED to
HANDOVER_FAILURE_USER_REJECTED
3. Removed the HANDOVER_FAILURE_DEST_INVALID_PERM constant since it isn't
used (methods which deal with permissions throw security exceptions).

Test: Make doc and verify documentation.
Change-Id: Id21d6b4c83d5c773ab38d78eb6b1886a1ac4dadf
Fixes: 73751004
Fixes: 73750515
Fixes: 73750817
2018-03-02 15:45:51 -08:00
Hall Liu
e9041241de RTT bugfixes, part 5
* Add a new API to allow Telecom to inform ConnectionServices when the
RTT text stream changes
* No longer set the RTT property from ConnectionService. Client apps
should be setting properties themselves.
* Add Dialer-side RTT property in order to remove the dependence on
checking the RTT streams, which have a complex lifecycle

Bug: 72951201
Bug: 72648661
Test: manual, with real RTT calls and Dialer's SimulatorConnection, also
cts
Change-Id: Ic4c7d883d2dc6baf8e8c0eaa4df58d7de8762b9e
Merged-In: Ic4c7d883d2dc6baf8e8c0eaa4df58d7de8762b9e
2018-02-22 03:19:19 +00:00
Treehugger Robot
d35e81d615 Merge "Un-hide Connection-side RTT APIs for Dialer" 2018-02-15 23:56:55 +00:00
Hall Liu
13ee5767e1 Un-hide Connection-side RTT APIs for Dialer
Bug: 63934808
Test: builds
Change-Id: I59a892fb0e314810e92dd9ad7d0c2f4610055045
Merged-In: I59a892fb0e314810e92dd9ad7d0c2f461005504
2018-02-15 21:34:55 +00:00
Hall Liu
ee57508851 Add setting and logging for RTT
Add a system setting to store preferred RTT mode for calls. Add logging
for RTT in Telecom base classes.

Bug: 63934808
Test: manual
Change-Id: Ie26fac800931604379bbe7b8abfed7caa8c0236d
Merged-In: Ie26fac800931604379bbe7b8abfed7caa8c0236d
2018-02-15 18:55:35 +00:00
Treehugger Robot
d1134525fc Merge "Rename Conference#setConnectionElapsedTime to clarity." 2018-02-13 23:27:33 +00:00
Tyler Gunn
31f0e0bd25 Ensure start of call properties are propagated to RemoteConnection.
Some properties were not being propagated to a RemoteConnection when
a Connection is first created.  This can cause problems where the
Connection Manager is not aware of these property changes, especially if
they never change again during the lifetime of a call.

The extras set when a Connection is first created using the
RemoteConnectionService API would not be propagated to the
RemoteConnection.  This means that Telephony RAT reporting would never
happen if the radio technology never changes during a call.

Bug: 72811636
Test: Manual
Change-Id: I658aab10b1fb89ca29c39338febcc76e9f50d8f4
2018-02-13 08:39:45 -08:00
Treehugger Robot
e845bddb40 Merge "Updates to Telecom API docs for clarity." 2018-02-13 07:09:36 +00:00
Tyler Gunn
7c3ddcf0a1 Updates to Telecom API docs for clarity.
- Update Connection onAnswer/onReject docs to make it more clear for
a self-managed connectionservice that these methods could be called by
the framework or by a car mode in call service.
- Update the Connection onShowIncomingCallUI method to take into account
the new concurrent calling capabilities in P.

Test: Docs only change
Bug: 73112552
Change-Id: Icb47aa15d03d4bfc05380948e30686317124301e
2018-02-12 15:45:46 -08:00
Tyler Gunn
175413959a Rename Conference#setConnectionElapsedTime to clarity.
Change name of conference connection elapsed time method to make it more
clear what it is for.  Updated documentation of this method and its
companion to make it more clear what they are for.

Test: Compile - this is a docs and naming change only.
Bug: 70639525
Change-Id: I02662cb0331cba0d1fe2d4353438a68f334f9192
2018-02-12 14:35:15 -08:00
Tyler Gunn
6a3031713c Merge "Add InCallService docs to state prerequisites for be being a dialer app." 2018-02-10 00:00:04 +00:00
Tyler Gunn
fe39efa9b1 Add InCallService docs to state prerequisites for be being a dialer app.
The InCallService documentation does not clearly state that an app which
wants to become the default dialer app also needs to handle the DIAL
intent.  This change updates the documentation to make this clear.

Test: Built documentation and verified its contents.
Bug: 72857373
Change-Id: I738a8475df37035a0a7f4ad1639df76d967f81dc
2018-02-09 11:28:54 -08:00
Tyler Gunn
44289caa11 Merge "Pass calling package for invocations of endCall API." 2018-02-09 18:49:08 +00:00
Tyler Gunn
c865881999 Pass calling package for invocations of endCall API.
Pass the calling package for debugging purposes.

Test: Manual
Bug: 73006395
Change-Id: I5ea7f1f0033438de3cdc2c47fc8a03f05d9e4590
2018-02-07 16:08:27 -08:00
Pooja Jain
d34698def5 IMS: Add support in frameworks for call deflection feature
Call deflection feature is useful to deflect MT call to another
number.

Test: Manual

Bug: 62170348
Change-Id: Idfbcc175a856aa0bb9476f8c73d7a614a3af0700
2018-02-07 12:29:16 +05:30
Tyler Gunn
acdb686635 Add call recording tone support.
Adding carrier configuration option to specify whether the carrier requires
the incall recording tone be played.
Added phone account extra used in Telephony to communicate this to
Telecom.
Added permission pregrant for Telecom for MODIFY_AUDIO_ROUTING; this is
needed as Telecom listening to the AudioRecordingConfiguration callback
from the audio framework.  It needs the permission so that it can be
informed of the package names of recording apps.

Test: Manually enabled for local carrier and confirmed that recording
tone plays to remote party when a recording app is started on the device.
Bug: 64138141

Change-Id: I1ab521b79cbeeb4ff4dcbf83de7c17c539637bdc
2018-01-30 11:38:54 -08:00
Tyler Gunn
858bfaf79c Add handover permission, fill in some missing API gaps.
Adding the ACCEPT_HANDOVER runtime permission which an app must have in
order to accept handovers (this is per design).

Adding missing onHandoverComplete method in the android.telecom.Connection
API (per design).

Finishing plumbing for android.telecom.Call#onHandoverComplete API.

Fix issue where the new handover API methods would never get called; the
legacy handover extra was being used in this case when it should not have
been.

Bug: 65415068
Test: Verified using new CTS tests
Change-Id: If1558f6a23911862c02ac5b18fb62d86911ed7e2
Merged-In: If1558f6a23911862c02ac5b18fb62d86911ed7e2
2018-01-25 16:20:03 -08:00
Sanket Padawe
e8fc3d2399 Merge "Add permission check for old call handover apis." 2018-01-12 23:50:40 +00:00
Sanket Padawe
f6a9e5b6e0 Add permission check for old call handover apis.
Bug: 65415068
Test: manual
Change-Id: I4784debf1be255de24c341fe5474fc529bc1cebe
2018-01-12 10:17:42 -08:00
Joseph Pirozzo
d2a9fc7abe Bluetooth in band ring
Prevent the telecom service from generating a ringer if there is already
a ringer generated by a phone connected over bluetooth headset client
service.

Bug: 65673832
Test: runtest telecom-unit -c
com.android.server.telecom.tests.RingerTest

Change-Id: I40710787cab0215f0456153a3557aa8cf1a50cdf
(cherry picked from commit 40ea5eea4194f56f63e6aa3383772f462306c02a)
2018-01-11 14:07:25 -08:00
Treehugger Robot
2f37060ee0 Merge "Add connection serivce focus api interface" 2018-01-09 22:54:42 +00:00
Pengquan Meng
63d25a5411 Add connection serivce focus api interface
This add new api interface to ConnectionService to support the
connection service focus api.

Bug: 69651192
Test: manually

Change-Id: Iea49d95b086d32a0ebaf8e9f34fe4556953a0fd5
Merged-In: Iea49d95b086d32a0ebaf8e9f34fe4556953a0fd5
2018-01-09 10:50:38 -08:00
Brad Ebinger
f784b29c9d Remove hashing for PII in Telecom Logging
Replaces the MD5 hash for logging PII in
Telecom with "***" instead.

Test: Manual
Bug: 67823981
Change-Id: Ieb089fe806663062a551ce7b9071e8b8f5fa9af7
2017-12-22 13:45:27 -08:00
Tyler Gunn
7661e81f85 Merge "Add logging and disconnect reason for null connections." 2017-12-21 19:39:32 +00:00
Sanket Padawe
02d8c276d9 Receiving side Call handover API implementation.
Bug: 65415068
Test: Manual

Design doc:
https://docs.google.com/document/d/1qY3oAzjff_4A1ttYb_CGrE_OwTRmXMG_KGsIuPT1ey8/edit#Bug:

Change-Id: Ic0c4af19098252389648007628affc19a44f89dd
Merged-in: Ic0c4af19098252389648007628affc19a44f89dd
2017-12-20 10:13:05 -08:00
Sanket Padawe
85291f63c9 Implement Call handover initiation side APIs.
Bug: 65415068
Test: Manual

Design doc:
https://docs.google.com/document/d/1qY3oAzjff_4A1ttYb_CGrE_OwTRmXMG_KGsIuPT1ey8/edit#

Change-Id: I692bb14fba66733154378c2dda525aa85c471a38
Merged-in: I692bb14fba66733154378c2dda525aa85c471a38
2017-12-19 16:32:24 -08:00
Tyler Gunn
fba1a8e61a Add logging and disconnect reason for null connections.
When a ConnectionService implementation returns a null connection, log this
and also set a unique disconnect reason to indicate in the telecom
dumpsys what happened.

Test: Manual
Bug: 70385625
Change-Id: Iff9846d434d400c4cf036e9ac46167cfb6f6b58c
2017-12-19 15:23:59 -08:00
Eric Erfanian
ec88187e62 Add assisted dialing properties to the framework.
These properties allow the feature to be propogated from
the outgoing call broadcast, to the connection, to the call,
and finally to the call log as a feature.

Test: no existing unit tests found. could use some pointers
Bug: 35963245
Change-Id: I3ed8ac5ad7300c44f87e2573d9409b3a92b98ab6
Merged-In: I84343fb0cda16514c01997fd71d1e819b5b7eebb
2017-12-12 09:45:01 -08:00
Hall Liu
47ed62080f Add CarrierConfig key for RTT support
Add the carrier config key.

Test: add fake support for some random carrier, look for the capability
Bug: 63934808
Change-Id: I8a0e33a7ac10fbdcad356059913e7ddcba26bb6c
2017-12-11 14:41:31 -08:00
Jeff Sharkey
983df8cc6c Massage APIs for upcoming doclava change.
These changes are needed to ensure that "checkapi" doesn't claim
that we're changing the API after an upcoming doclava change.

Test: manual inspection of API text files
Bug: 69505783
Change-Id: I8292ba80cc65b7dd78f0e9dba4fcc7ffcedfab9c
Merged-In: I8292ba80cc65b7dd78f0e9dba4fcc7ffcedfab9c
2017-12-06 21:55:57 -07:00
Tyler Gunn
80bfc216ca Merge "Add missing } on @link tag."
am: 31b0c6fb32

Change-Id: I2249cab4a50a9788cd8decb23fd8c60419ab6c21
2017-11-17 19:27:12 +00:00
Tyler Gunn
94ffde79b3 Add missing } on @link tag.
Test: Compiled code (this is a non-code change).
Bug: 69439905
Change-Id: I334ef7d74ac9802378b43a8f95979dcaf82c592f
2017-11-17 08:36:41 -08:00
Sanket Padawe
c376ca6bc1 Merge "API declarations for Call Handover."
am: d88abc7b60

Change-Id: I0be6f240073408bf9520766238ecf791c016a40b
2017-11-16 01:45:25 +00:00
Sanket Padawe
a8eddd48c4 API declarations for Call Handover.
Design doc:
https://docs.google.com/document/d/1qY3oAzjff_4A1ttYb_CGrE_OwTRmXMG_KGsIuPT1ey8/edit#

Bug: 65415068
Test: manual.
Change-Id: I0c2f561d92ad6504f858eadde09980fc1ce8727f
2017-11-15 13:41:05 -08:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00