64 Commits

Author SHA1 Message Date
Tyler Gunn
f50354363c Adding self-managed connection service APIs.
1. Adding new APIs for self-managed connection services.
2. Adding Telecom package-level documentation.

Test: Manual (unit, cts pending; this is just scaffolding for now)
Bug: 34159263
Change-Id: Ic226ec8bfcb2fbcc02fe802b47499e47aab17d0a
2017-01-18 14:44:43 -08:00
Brad Ebinger
4d75bee99b Modify ConnectionServiceAdapter to include Session
Modifies the ConnectionServiceAdapter to include Session Information in
the AIDL interface so that external Sessions can be started in Telecom
from Telephony.

Test: Manual testing and Unit Tests pass
Bug: 26571395
Change-Id: I31bbfe433dd062a50bd05083e1a639dd4cd03403
2016-11-02 09:20:22 -07:00
Brad Ebinger
b32d4f8b5c Modify AIDLs to include Session.Info
Modifies the IConnectionService.aidl file to include Session.Info
information to pass from Telecom to Telephony, which is used to start
external Sessions in Telephony from Telecom.

Test: Manual testing and Unit Tests pass
Bug: 26571395
Change-Id: Ia09a0abfa13d5167542d4c67465ea9aa1930b58b
2016-10-28 12:14:24 -07:00
Tyler Gunn
c96b5e0873 Finalize MEP functionality.
1) Finish plumbing of PULLING_CALL state.
2) Add new disconnect cause used when maximum number of calls across
all devices has been reached.
3) Add PII mask for toString of ImsExternalCallState.

Bug: 29522023
Change-Id: I78a0a9f3c3d846cfc58a1c5bcc6f105027602cbc
2016-07-11 10:33:37 -07:00
Hall Liu
057def534c Add support for Telecom analytics extensions
Add classes for call events and a field for them in
ParcelableCallAnalytics.
Add classes for timing information on user-visible operations.
Add the TelecomAnalytics class as the top-level object for analytics.
Add log session timing information to the TelecomAnalytics class,
independent of individual calls.

Bug: 28623064
Change-Id: Ifee5fdf6b6b341869ff0ff26c4388d357e3d9922
2016-06-14 16:37:10 -07:00
Abhijith Shastry
9bacdabf3e Remove deprecated API launchManageBlockedNumbersActivity
BUG: 27364137
Change-Id: Ie608c3f75d5fe353a1ba127b0da763c421401eb8
2016-04-04 10:46:11 -07:00
Tyler Gunn
720c664401 Add connection properties to Connections.
- Per suggestion of API council, moving properties of a Connection from
CAPABILITIES_* to PROPERTIES_*.

Bug: 27458894
Change-Id: Icce921b03cda514a991646ed39a26559c7e91230
2016-03-24 20:20:11 -07:00
Tyler Gunn
dee56a8a79 Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle.  This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.

Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.

This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.

Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
Tyler Gunn
876dbfb476 Add API support for multi-endpoint.
This CL includes changes required to support multi-endpoint (see the
design doc linked off the bug).

Main changes include:
- support for indicating if a call/connection is "external" to the device.
- support for indicating if an external call can be pulled from the
remote device to the local device.
- API used to initiate a pull of a call external to the current device to
the current device.
- Made the "connection event" API public (was previously @hide); this will
be used to support passing some error events involving pulling calls to
the incall ui.
- Added new InCallService metadata which will be used to determine if an
InCallService wants to be informed of external calls.
- New disconnect causes which will be used to expose the fact that a
multi-endpoint call was answered elsewhere and that a call ended because
it was pulled to another device.
- New call log call types to indicate if calls were answered elsewhere
or pulled to another device.

Bug: 27458894
Change-Id: I423f64ff965b5e50194635a51868c327782db2a1
2016-03-14 23:26:34 +00:00
Abhijith Shastry
1e6f8343b5 Add new API for creating intent to manage blocked numbers.
The launchManageBlockedNumbersActivity API will be removed.

BUG: 27364137
Change-Id: I440aaab521f5320bbc79b79f212ed1b418ce2d14
2016-02-29 11:47:10 -08:00
Tyler Gunn
bd1eb1f105 Add new ConnectionEvent API (hide) to send a notification to Telecom
Connection event used to inform Telecom that it should play or stop
the on hold tone. This is used to play or stop a tone when the peer
puts the current call on hold.

BUG=25357778
Change-Id: I2669f8f5062449784a712b9dd28e576326fcc679
2016-02-16 14:36:20 -08:00
Abhijith Shastry
5fe341320a Add API in TelecomService to manage blocked numbers.
BUG: 26917087
Change-Id: I0c13665849994eca28009ed35ba8b13c3585a5ff
2016-02-01 21:42:59 -08:00
Sailesh Nepal
1bef339b88 Add new public API to allow call screening
This CL adds a new service that the default dialer can implement to
screen incoming calls.

If the service is implemented then Telecom uses it to decide if a call
should be shown to the user or rejected.

Note, I initially tried to simply extend InCallService instead of
creating a whole new service. The problem with this approach is that:
  - this breaks some in call services which show UI as soon as they are
    bound to
  - the in call service lifecycle is tightly coupled to adding and
    removing calls. Call screening happens before a call is added which
    makes it a bad fit to in call service
  - call screening is a function of only the default dialer's in call
    service but the existing code also binds to "controller" call
    services

For these reasons it seemed simpler to just create a new optional
service.

BUG: 22857261
Change-Id: I53f2ef93360e0af19b6ce45af21026be6cf3a7f3
2016-01-27 13:54:12 -08:00
Sailesh Nepal
9c2618b17f Expose a meta-data value to allow dialer ringing
This CL exposes a new meta-data, IN_CALL_SERVICE_RINGING. If this is set
to true then ringing is played by the dialer instead of Telecom.

This CL also adds a new silenceRinger() API to InCallService. This is
needed to implement ringer silence on volume key down.

BUG: 22857261
Change-Id: I498538282eddbb727104f5b879f25adbef4e6cf6
2016-01-26 17:06:06 -08:00
Hall Liu
0464b9ba16 Add method to dump Telecom analytics
Add dumpAnalytics in TelecomManager to allow the connectivity stats
service to access Telecom analytics for uploading.

Change-Id: I197d6af340fac7f38b28bb44a476b5e694db4dba
2016-01-15 12:43:27 -08:00
Bryce Lee
842ec9c407 Merge "Add callback for connections to be notified when the ringer is silenced." into cw-e-dev am: 52bdf11583 am: b241487c16 am: 64e41590d2
am: 0ca7de9031

* commit '0ca7de90310034d118f21343a69a38ebc02dd0bc':
  Add callback for connections to be notified when the ringer is silenced.
2015-11-30 19:17:53 +00:00
Tyler Gunn
6676bb5da5 Add "acceptRingingCall()" API which accepts a videoState.
- Added acceptRingingCall API which accepts a videostate to complement the
existing API.

Bug: 20159300
Change-Id: I2a9d53fd4dbbb0be49d95416f7e26d3ec61774cd
2015-11-24 15:43:20 -08:00
Bryce Lee
cac50775b2 Add callback for connections to be notified when the ringer is silenced.
Bug: 25644529
Change-Id: Ie7dc9028cf6243d98b2d87ca4c8b3ffcd31e3676
2015-11-17 15:13:29 -08:00
Bryce Lee
8190168077 Add capability for a connection hand rejection text response.
Change-Id: Id90417736bed7ab8750144ccaf3c7b449ec832b8
2015-08-28 16:38:02 -07:00
Sailesh Nepal
cf85562bc9 Default permissions for sim call manager
This CL adds the following permissions by default to the
SIM call manager:
 - microphone
 - phone

BUG: 22790160
Change-Id: Icaf1db6c6943b3ddbd16a946a81d1bfb734d761f
2015-07-28 22:16:25 -07:00
Santos Cordon
2c27b9a9fa Clean up SIM CallManager APIs.
Bug: 21499476
Change-Id: Iaded74c6b885b0745dfa85d0b7733bdad75d615a
2015-06-18 16:13:54 -07:00
Yorke Lee
db6da48621 Allow default dialer changes and phone account enable/disable via ADB
Add commands accessible via adb shell that can be used for CTS tests
without the need for adb root
*set-phone-account-enabled
*set-phone-account-disabled
*set-default-dialer
*get-default-dialer

Modify enablePhoneAccount/setDefaultDialer to indicate success.

Remove now unused functionality in ProtectedEnableAccountPreferenceActivity
and ProtectedChangeDefaultDialerActivity.

Bug: 21583012
Change-Id: I542d145cc969334c004b8344fbbb01f278256f9d
2015-06-02 14:23:21 -07:00
Santos Cordon
6b7f955c2d Add extras to Connections/Calls. (1/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: I08c1baf4f08d54757f98012f0c08b423a707c53d
2015-05-28 09:43:00 -07:00
Santos Cordon
91371dc036 Add enable/disable properties to phone accounts.
Bug: 20303449
Change-Id: Ie6203a284454d43f4dd20917f0f1fda0b36484f8
2015-05-19 13:06:21 -07:00
Yorke Lee
4af5935c71 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
2015-05-13 14:58:15 -07:00
Yorke Lee
32f2473160 More video related API fixes
android.telecom.Connection.VideoProvider
* onSetPauseImage takes Uri instead of String
* changeCallDataUsage -> setCallDataUsage
* add quality constants to changeVideoQuality() docs

android.telecom.InCallService.VideoCall
* setPauseImage takes Uri instea dof String

android.telecom.VideoProfile.VideoState
* Move constants to VideoProfile, prefix with STATE_

Bug: 21040387
Bug: 21066505
Change-Id: I764e72aced9d1e2d30d6d0cf0862100860d47c79
2015-05-12 16:45:14 -07:00
Yorke Lee
400470fab9 Fixes for APi review
Move CameraCapabilities into VideoProfile
Make PhoneAccount and PhoneAccountHandle final

Bug: 21040387
Bug: 21066505
Change-Id: I72453c89ae3765f9b9cf263938fce96d5978d2e0
2015-05-12 13:31:25 -07:00
Tyler Gunn
4538216a31 Change sendSessionModifyRequest VideoProvider API signature.
Including a fromProfile in addition to the requestedProfile.

- Changed VideoCallImpl to generate the fromVideoProfile based on the
call's current videoState.  This ensures the InCall UI only needs to
pass in the new video profile; the VideoCall Impl already has enough
knowledge to generate the fromProfile.
  - Changed VideoCallImpl to track the current videoQuality, which forms
a part of the fromVideoProfile.

Bug: 20704229
Change-Id: I89f293f03a2b13fc8c1dcfd8a07ab8640d3950e0
2015-05-06 08:52:27 -07:00
Prerepa Viswanadham
b6f9da0b7f Merge commit '17455a3' into master_merge 2015-05-01 10:12:11 -07:00
Yorke Lee
f1a349bda3 Add default dialer checks to Telecom/Telephony
Check for the default dialer or the modify phone state permission
for various TelecomManager/TelephonyManager methods.

Make sure to check the user-selected default rather than the
hardcoded package name.

Exercise this code in TestDialerActivity.

Bug: 20304458
Change-Id: Ic04cd8f2ba98e1d54c39549ae89d3e11cd5cdafb
2015-04-29 16:21:00 -07:00
Anthony Lee
17455a3d39 Add plumbing for merge failures and renable button. (3/4)
The merge failure is not plumbed up through any layer that
can trap the callback and act on it.  The first part of this
fix is to create that plumbing.  Then we need to reenable the
merge button. At this point in time, we leverage the fact
that forcing the call to reassess its capabilities will poke
the InCallUI to reenable the merge button. In the future, we
should plumb the merge failure all the way to InCallUI and
not only handle the button but display UI to the user. The UI
is currently being displayed by CallNotifier which is the wrong
place. See b/20530631 for more details.

Bug: 20229905
Change-Id: I0355ada46b484c6db4bee656c77386dd61be5e1f
2015-04-28 07:13:34 -07:00
Etan Cohen
cd895cdf4d Merge changes from topic 'mwd-merge-042415'
* changes:
  Rename removeVideoCallListener to unregisterCallback
  Bluetooth document fix: remove reference from open API to hidden entities
  Fix build due to merge of 7595842 and renaming due to 8eb87f0
  Merge commit '052a0da' into merge2
  Merge commit 'db1dbb8' into merge2
  Merge commit '7e5e791' into merge2
  Merge commit '170102d' into merge2
  Merge commit '4cb5d80' into merge2
  Merge commit '83cda00' into merge2
  Merge commit 'c91bc62' into merge2
  Merge commit 'cffc360' into merge2
  Merge commit '7f61051' into merge2
  Merge commit '167c3a7' into merge2
  Merge commit '4467b98' into merge2
  Merge commit '25a217c' into merge2
  Merge commit '04b18ec' into merge2
  Merge commit '7595842' into merge2
  Merge commit '2bbd2b6' into merge2
  Merge commit '4890351' into merge2
  Merge commit 'cd405fe' into merge2
  Merge commit '6ddbb5e' into merge2
  Merge commit 'de93575' into merge2
  Merge commit '9561e74' into merge2
2015-04-25 00:51:47 +00:00
Etan Cohen
d7b4b81274 Merge commit '7595842' into merge2
Change-Id: I7e11e98e6d59562374195a8761d64a79dc0268e8
2015-04-24 13:56:35 -07:00
Yorke Lee
1011f4870c Add APIs to getDefaultDialerPackage and getSystemDialerPackage
getDefaultDialerPackage is a public API and will be used by
apps to determine if they are the default dialer.

getSystemDialerPackage is a hidden API and is only used by
system components.

Also add new public string constants to allow apps to show
a dialog requesting that the user change the current default
dialer.

Bug: 20304458
Change-Id: I121d36741474c1fe171c372fb766a6c128228c9c
2015-04-24 11:12:34 -07:00
Yorke Lee
3e56ba14cc Add TelecomManager.placeCall
Places a new outgoing call using the system telecom service
with the specified parameters.

Making emergency calls using this method requires that the
method-caller is either the user-selected default dialer app
or preloaded system dialer app.

Requires that the caller have the
{@link android.Manifest.permission#CALL_PHONE} permission.

Bug: 20348183
Change-Id: Ieedb5628e8c6be25137944e7c3639dc1d9bc61df
2015-04-23 16:48:52 -07:00
Svet Ganov
16a1689950 Add OP_READ_PHONE_STATE app op - framework
The READ_PHONE_STATE permission protects PII information and
is in the Phone group. This change is adding the corrseponding
app op for gating access to the API guarded by READ_POHNE state
which will be used instead as an access control for legacy apps.

Change-Id: I2ff895a5a0e529f26ec0ad706266a30d829268ba
2015-04-17 20:43:56 +00:00
Jay Shrauner
6f20a6a2b4 DO NOT MERGE Remove connection substate
Bug:20300433
Change-Id: Ifefc08b5165de3e0b6ce92007e5f612879dcc4d9
2015-04-16 15:05:05 -07:00
Jay Shrauner
8f98843924 Remove connection substate
Bug:20300433
Change-Id: Ifefc08b5165de3e0b6ce92007e5f612879dcc4d9
2015-04-16 14:42:39 -07:00
Yorke Lee
167c3a717f DO NOT MERGE Change hasVoicemailNumber to getVoicemailNumber
Bug: 20223485
Change-Id: I293572bb6c32c5084fe684e7cfe7bd2bbfb5443b
2015-04-16 12:40:23 -07:00
Tyler Gunn
75958420f2 Support for multiple VideoCall.Listeners for a VideoCall.
The current code assumes that only a single instance of VideoCall will be
provided to the default system InCall UI.  Ideally multiple
InCallService implementations should be able to use the VideoCall APIs.
Note: it only really makes sense for a single InCallService to get/set
the video surfaces.

- Fixed bug in ParcelableCall which would cause a new instance of
VideoCallImpl to be created every time a call is updated from Telecom.
Added a flag to ParcelableCall to indicate whether the parcel includes a
change to the video provider information, which is used when unparceling
to determine whether to set/create the video call impl.
- Renamed "setVideoCallback" to "addVideocallback".
- Modified Connection.VideoProvider code to keep a list of Video callbacks
and fire off all of them when Video Provider changes occur.

Bug: 20092420
Change-Id: Ic16b6afe1b7532cc64d006c133adbae57946d97d
2015-04-16 16:37:25 +00:00
Yorke Lee
49e2d46812 Change hasVoicemailNumber to getVoicemailNumber
Bug: 20223485

Change-Id: I67eb12e2030ec8f73326ade4eb750b0c2f6e52ad
2015-04-16 09:30:57 -07:00
Rekha Kumar
07366813cd IMS-VT: Upgrade/Downgrade change
-Add isVideo API to VideoProfile.VideoState

IMS-VT: Fix propagation of device orientation.
Orientation received at VT Service is incorrect.
Fixed propagation of device orientation to VT service.

IMS-VT: Upgrade fix
-Add session modify call timed out constant

Notify listeners of video quality changed event
- Propagate the video quality changed message to the UI.

IMS: Add support for video quality
- Add Config interface to get/set video quality

IMS-VT: Multitasking feature
-Support for video multitasking

IMS-VT: Modification of data usage aidl
Change data usage aidl interface to take parameter type long
instead of int

Change-Id: I7cda2a689edb86d025dfe8efc8f573918c4bd6bc

Propagate the call substate changed message to the UI

IMS-VT: Add call modifiable capability

PhoneCapababilities call type modifiable constant added

IMS-VT: Add a bit mask CALL_SUBSTATE_ALL with all call substate bits set

IMS-VT: Enable Video conferencing.

Enable Video conferencing.

Change-Id: I4240aa6f32c75d6eea8a41da3c87bca651f0901b

IMS-VT: Add hide for setVideoProvider API
Observed compilation error for SDK generation due to setVideoProvider
API. Marking setVideoProvider as hide inorder to resolve the
compilation error.

IMS-VT: Add persist.radio.ims.audio.output for VT calls
-- Add persist.radio.ims.audio.output to set the default speaker
   for VT calls.
-- Add required constants

IMS-VT: Add additional error codes for upgrade downgrade
-Add support to send additional error codes to UI during
 upgrade downgrade.

Change-Id: Id452d225098fe3bccdcd37d242985c5c761144c1
2015-04-01 21:40:45 +00:00
Nancy Chen
5cf27847b0 Add method in TelecomManager to return line1Number for a PhoneAccount.
Since we do not want to expose SubIds in the app layer, we need a
wrapper to extra the subId from a PhoneAccount and return the
value of TelephonyManager#line1Number.
Also update error strings to be more consistent.

Bug: 19087382
Change-Id: Ie5a474d45336921d1007b36a4d26cd4da68f8b91
2015-01-24 23:32:02 -08:00
Nancy Chen
27d1c2d148 Pass onPostDialChar call back from Telephony to Telecom.
Add plumbing to alert Telecom every time a character is processed after
the post dial wait state (the processing happens in Telephony).

Bug: 18644688
Change-Id: I487d76aa9c959ca528c6377374aa35c2d0b4a803
2014-12-16 12:53:04 -08:00
Nancy Chen
8c066f7cc3 Use TelecomManager to call TelephonyManager#getVoicemailNumber (1/2)
Since we don't want the phone app to call TelephonyManager methods
directly, create a method in TelecomManager to mimic the behavior. The
reason we don't return the voicemail number directly is because once
TelecomManager becomes public, we don't want any old app to be able to
get the SIM's voicemail number.

Bug: 18233678

Change-Id: I620af409788aea7b58169b72a563baeed8115080
2014-12-04 14:28:21 -08:00
Ihab Awad
5c9c86ec0f Telecom API updates (1/6)
Bug: 18292176

Change-Id: I060366234a5a60510c385dc837f2b7e79596eaf5
2014-11-28 15:54:35 -08:00
Santos Cordon
6c912b7d05 Make add-call a global property of telecom. (1/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: I658e7a6977a848600272cde2914612c8691bb801
2014-11-10 19:19:35 +00:00
Nancy Chen
b2299c1303 Adn queries for multi-SIM. (2/3)
Define a method in Telecom to take in a subscription account and return
the URI for an ADN query for that account.

Bug: 17917937
Change-Id: Ic50a4add7fe44a5164271dc9c9e5a58e45e72336
2014-11-03 11:11:56 -08:00
Nancy Chen
e1678ddf7a Merge "Handle MMI for multi-SIM (1/3)" into lmp-mr1-dev 2014-10-31 22:06:28 +00:00
Nancy Chen
95e8a67933 Handle MMI for multi-SIM (1/3)
+ Add Telecomm and Telephony methods for handlePinMMIForSubscriber
+ Add Select Account dialog in Dialer for MMI

Bug: 17917937

Change-Id: I26fdc68a07ca0483bf7a052598fe31b1461fd486
2014-10-31 11:26:38 -07:00