Commit Graph

206 Commits

Author SHA1 Message Date
Hai Zhang
f5e8ccd88f Use a boolean Consumer instead of RoleManagerCallback.
And use RemoteCallback for it under the hood. This removes one AIDL
interface and allows using lambda, while aligning with what
PermissionControllerService does.

Bug: 127691087
Test: manual
Change-Id: Ia94e5bac59773380b2a4764d766bf6ff1dd5b7ff
2019-03-08 15:51:02 -08:00
Slava Shklyaev
e65e401305 Revert "Revert "Revert "Revert "Correct nullability and final constraints on new APIs.""""
This reverts commit 2fac9dd3d4.

Reason for revert: the change being reverted was not supposed to be
merged into git_master.

Change-Id: Ieb9169fdd242edb72774e5c3d5824bc54b55cc05
2019-03-04 16:14:29 +00:00
Slava Shklyaev
ae68d85fc3 Merge "Revert "Revert "Revert "Correct nullability and final constraints on new APIs."""" am: 0bbf61f024 am: 08bc717117
am: 5317912537

Change-Id: Idab2d4174aa3d6a19f9573edf0d5ee3ecfa33201
2019-03-04 07:17:43 -08:00
Slava Shklyaev
0bbf61f024 Merge "Revert "Revert "Revert "Correct nullability and final constraints on new APIs."""" 2019-03-04 14:42:17 +00:00
Slava Shklyaev
2fac9dd3d4 Revert "Revert "Revert "Correct nullability and final constraints on new APIs."""
This reverts commit b255be1307.

Reason for revert: the commit being reverted fixed git_master but broke aosp-master. This revert is aimed to fix aosp-master while not touching git_master.

DO NOT MERGE: This change is aimed at aosp-master only and should not be merged into git_master.

Change-Id: Ie5aaabb211affe2d21daaf87809641276d9d4707
2019-03-04 14:39:56 +00:00
Slava Shklyaev
fc291d1ed1 Merge "Revert "Revert "Correct nullability and final constraints on new APIs.""" am: 86e2035208 am: 6ced2f195d
am: 8e6b20f4f3

Change-Id: I0aa41b4fc5d08201deffccdaa25c50ae7942fe78
2019-03-04 04:40:09 -08:00
Slava Shklyaev
86e2035208 Merge "Revert "Revert "Correct nullability and final constraints on new APIs.""" 2019-03-04 11:49:34 +00:00
Slava Shklyaev
b255be1307 Revert "Revert "Correct nullability and final constraints on new APIs.""
This reverts commit 8462c66bd5.

Reason for revert: Looks like this change broke the build.

Change-Id: I4cff1ec1211e278d5e5734f1594c096722293662
2019-03-04 11:47:11 +00:00
Tyler Gunn
55ae1a1bd2 Merge "Revert "Correct nullability and final constraints on new APIs."" am: 049867e364 am: 80379f24ec
am: 7b0b6677c2

Change-Id: I5c38019d99e6258002fb5017fdf88733b7d1ffe7
2019-03-03 22:06:40 -08:00
Tyler Gunn
049867e364 Merge "Revert "Correct nullability and final constraints on new APIs."" 2019-03-04 05:37:44 +00:00
Tyler Gunn
8462c66bd5 Revert "Correct nullability and final constraints on new APIs."
This reverts commit b6940c3ea6.

Reason for revert: There appears to be a downstream issue with how the test API definitions are created; until I can figure out how to account for this I'll revert in AOSP (this is in internal master and its fine there).

Change-Id: I840c3ed82afa18323408e161913a84858f7a1539
2019-03-04 05:19:42 +00:00
Tyler Gunn
cdbfa9d087 Merge "Correct nullability and final constraints on new APIs." 2019-03-04 04:13:38 +00:00
Tyler Gunn
124f1f6dd5 Expose some APIs as test APIs to facilitate CTS
Test: added new cts tests
Bug: 123896388
Merged-In: I742f23be57e731307338591d816f7888e198b333
Change-Id: I742f23be57e731307338591d816f7888e198b333
2019-03-01 14:26:50 -08:00
Tyler Gunn
b6940c3ea6 Correct nullability and final constraints on new APIs.
Per API review, correct nullability and final constraints on new Telecom
APIs.

Test: Build API.
Fixes: 126700293
Fixes: 126699447
Fixes: 126700465
Fixes: 126702895
Fixes: 126702527
Change-Id: Icec15403493de596194a61b27bb3e1031fdc1099
Merged-In: Icec15403493de596194a61b27bb3e1031fdc1099
2019-03-01 20:56:56 +00:00
Tyler Gunn
5c1a4e0bf3 Correct nullability and final constraints on new APIs.
Per API review, correct nullability and final constraints on new Telecom
APIs.

Test: Build API.
Fixes: 126700293
Fixes: 126699447
Fixes: 126700465
Fixes: 126702895
Fixes: 126702527
Change-Id: Icec15403493de596194a61b27bb3e1031fdc1099
2019-03-01 12:53:14 -08:00
sqian
5e5d303982 Populate 'hasKnownUserIntentEmergency'
This is only used to specify when the dialed number is ambiguous,
identified as both emergency number and any other non-emergency number;
e.g. in some situation, 611 could be both an emergency number in a
country and a non-emergency number of a carrier's customer service hotline.

Test: Manual
Bug: 123999640
Change-Id: I7b1a8832ab86b3e7d8f9af24eb4f7bde7d566612
Merged-In: I7b1a8832ab86b3e7d8f9af24eb4f7bde7d566612
(cherry picked from commit 6d9e7457da)
2019-02-13 19:30:40 -08:00
Shuo Qian
ce1826b2ed Merge "Populate 'hasKnownUserIntentEmergency'" 2019-02-14 01:44:36 +00:00
sqian
6d9e7457da Populate 'hasKnownUserIntentEmergency'
This is only used to specify when the dialed number is ambiguous,
identified as both emergency number and any other non-emergency number;
e.g. in some situation, 611 could be both an emergency number in a
country and a non-emergency number of a carrier's customer service hotline.

Test: Manual
Bug: 123999640
Change-Id: I7b1a8832ab86b3e7d8f9af24eb4f7bde7d566612
2019-02-13 12:19:27 -08:00
Tyler Gunn
4614e4f22c Merge "Expose some APIs as test APIs to facilitate CTS" 2019-02-11 03:24:48 +00:00
Tyler Gunn
c30ce782c0 Add nuisance call reporting API to Telecom.
Adding new nuisance call reporting API to Telecom. Dialer will use this
to report to Telecom when the user marks a call as nuisance or not
nuisance.  We relay this to the CallScreeningService the user has chosen
to fill the call screening role, along with some basic information about
the call type (missed, rejected, incoming) and a the coarse call duration
bucket.  These values can be used by the CallScreeningService to train
the nuisance detection model it employs.

Test: Manual tested using test app.
Test: Added new CTS test coverage.
Test: Added unit tests to Telecom
Bug: 63966743
Merged-In: I389617491f640afd9ca28ec3f247912365e6cc53
Change-Id: I389617491f640afd9ca28ec3f247912365e6cc53
2019-02-05 08:42:15 -08:00
Tyler Gunn
6c14a699e9 Expose some APIs as test APIs to facilitate CTS
Test: added new cts tests
Bug: 123896388
Change-Id: I742f23be57e731307338591d816f7888e198b333
2019-02-04 15:12:24 -08:00
Tyler Gunn
8303572af5 Merge "Deprecate acceptRingingCall and endCall." am: 6e3a88a3e2 am: 280019629c
am: 994c17768a

Change-Id: I10fee83408de8a1af75555eedf2403dfdbc4b857
2019-02-01 13:06:23 -08:00
Tyler Gunn
9bd8db4af7 Deprecate acceptRingingCall and endCall.
These APIs are replaced by CallScreeningService and the new
companion app roles in InCallService.

Test: Update Apis and verify deprecated.
Bug: 63966743
Change-Id: Ib4c4ac6b723ccd46d3052fb2b9c9f58b3151cc29
2019-01-31 10:54:03 -08:00
Tyler Gunn
e2a693b746 Merge "Add nuisance call reporting API to Telecom." 2019-01-23 21:50:49 +00:00
Tyler Gunn
d109d4bb58 Merge "Add get/set user selected outgoing phone account APIs." am: bf10036306 am: 6e7caec9ae
am: 5797bc598b

Change-Id: Ic1fa374c80d478586bf61956c28eedef2ba5185d
2019-01-22 20:54:33 -08:00
Tyler Gunn
1965bb1cc2 Add nuisance call reporting API to Telecom.
Adding new nuisance call reporting API to Telecom. Dialer will use this
to report to Telecom when the user marks a call as nuisance or not
nuisance.  We relay this to the CallScreeningService the user has chosen
to fill the call screening role, along with some basic information about
the call type (missed, rejected, incoming) and a the coarse call duration
bucket.  These values can be used by the CallScreeningService to train
the nuisance detection model it employs.

Test: Manual tested using test app.
Test: Added new CTS test coverage.
Test: Added unit tests to Telecom
Bug: 63966743
Change-Id: I389617491f640afd9ca28ec3f247912365e6cc53
2019-01-22 19:15:24 -08:00
Tyler Gunn
36c50ed28c Add get/set user selected outgoing phone account APIs.
Promoting getUserSelectedOutgoingPhoneAccount to a public API accessible
to the default dialer app, as well as to system priv apps such as the
settings app.

Promoting setUserSelectedOutgoingPhoneAccount to a system API accessible
to apps such as the settings app.

Add telecom shell commands to support changing the outgoing phone account
in CTS tests.

Bug: 119227574
Test: Manual
Test: Added and ran new CTS test
Change-Id: I204b2f01a1b6746aa35faf8aaacd30ebf53b9a5d
2019-01-22 07:46:06 -08:00
Tyler Gunn
d081f04bbe Add CallerIdentification to CallScreeningService API.
Updating the CallScreeningService to support passing call identification
information for incoming/outgoing calls.
Updating call log to log call identification information.

Bug: 63966743
Test: Manual with test app.
Merged-In: Ie6c172c09007eb5f4853d36ae0a99b782bfb5ddb
Change-Id: Ie6c172c09007eb5f4853d36ae0a99b782bfb5ddb
2019-01-11 11:26:48 -08:00
Tyler Gunn
d1d6911207 Merge "Add CallerIdentification to CallScreeningService API." 2018-12-14 17:44:09 +00:00
Hector Dearman
923382cb10 Fix SDK build
See ag/5184749

Test: make
Exempt-From-Owner-Approval: Build Cop
Change-Id: I531364aeeb042b699b2cc2c4ff9b2139e1040cfc
2018-12-13 16:55:37 +00:00
Tyler Gunn
7e45b7241b Add CallerIdentification to CallScreeningService API.
Updating the CallScreeningService to support passing call identification
information for incoming/outgoing calls.
Updating call log to log call identification information.

Bug: 63966743
Test: Manual with test app.
Change-Id: Ie6c172c09007eb5f4853d36ae0a99b782bfb5ddb
2018-12-12 15:12:31 -08:00
Youming Ye
dcd62ad6c3 Merge "Enable Telecom to bind third party InCallServices." 2018-12-12 21:18:35 +00:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Adrian Roos
66f859135b API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-11 20:38:02 +01:00
Youming Ye
8ded93ac94 Enable Telecom to bind third party InCallServices.
Changes for Telecom to bind third party companion apps or
automotive ui installed from Play Store. Add new permissions and
settings for the third party InCallService APIs.

Bug: 78174835
Test: Manual
Change-Id: I1b4eff28b9dfd61f1c951d14b6c82395b51fe769
2018-12-11 18:25:38 +00:00
Tyler Gunn
6e3ecc40f8 Unsupported app usage API cleanup
This CL includes a number of cleanups related to unsupported app usage
tags.

TelecomManager#EXTRA_IS_HANDOVER - public APIS exist for this usecase;
updated docs and limit to P with maxtarget sdk.
TelecomManager#getSimCallManager(int userId) - marked as max target P;
there is a public API available which can be used to accomplish the same
thing.  Nobody should be calling this.
TelecomManager#getCallCapablePhoneAccounts(boolean) - marked as max
target P; callers should use the version without the boolean parameter.

Deprecate CAPABILITY_CAN_UPGRADE_TO_VIDEO; its redundant.

New public API:
Promote TelecomManager#getSystemDialerPackage() to public API; its a
benign API and doesn't expose anything which can't be inferred other ways.

New system APIs:
TelecomManager#getCurrentTtyMode() - used by settings app.
TelecomManager#setDefaultDialer() - used by useful for settings app.
TelecomManager#TTY_MODE* constants - used by getCurrentTtyMode API.

Test: Compile / run unit tests
Bug: 119305590
Change-Id: I67d6213e6c689fb545fc9ceae4a359831f97c32f
2018-11-12 11:30:56 -08:00
tonyzhu
ff60f5ec27 [Call Screening]Programmatically changing the default call screening app.
Increase three methods in TelecomManager.java, modify
ITelecomService.aidl to make sure framworks can comunicate with service.

Bug: 113302920
Test: atest TelecomServiceImplTest.
Test: simulate third party call screening application to use methods in
TelecomManager.java, and triggle the activity to show the dialog of
setting default call screeening application.

Change-Id: I1e34061acd575813e92403c137731e618abb88d5
2018-10-30 15:50:49 +00:00
Chen Xu
4c0b06d1d1 Revert "Revert "Telephony light grey list clean up for Q""
This reverts commit bab59cb9db.

Reason for revert: Put maxTargetSdk=P now will move APIs onto light greylist
because per-SDK versioned dark greylist is not yet supported by ART. We can
keep doing annotation work without breaking existing apps targeting on P.

Bug:117934933
Bug:112477300

Change-Id: I5e0e693dde49fac3044cd73fd6360c4485f312ec
Merged-in: I5e0e693dde49fac3044cd73fd6360c4485f312ec
2018-10-26 23:31:40 +00:00
Chen Xu
bab59cb9db Revert "Telephony light grey list clean up for Q"
This reverts commit 253bdb7175.

Reason for revert: This CL caused MMS break because Bugle is using the
hidden API in Q's darkgrey list. The proper fix should either come from
Bugle team if their apk moved to Q, or compat team to explore why this
caused issue for app target on P.

Change-Id: Icc6c190cde79c10d9045183c0b80cdf008e95578

Bug: 117899984
2018-10-19 18:05:32 +00:00
chen xu
253bdb7175 Telephony light grey list clean up for Q
Bug: 112477300
Test: Telehony unit test
Change-Id: I5229224fe9a65b3647a42070f287e23f67084bda
Merged-in: I5229224fe9a65b3647a42070f287e23f67084bda
2018-10-15 10:19:43 -07:00
Tyler Gunn
c37445cb4e Add handleCallIntent method in TelecomManager.
This is an @hide method usable only from within Telecom itself in order to
trampoline an ACTION_CALL intent from the UserCallActivity to
Telecom's system service.

Bug: 116719392
Test: Verify that calls initiated via CALL intent no longer get rebroadcast
and are instead sent directly to Telecom.

Change-Id: Ie765631bef8329a8ed12723d9c037a44b4f80882
2018-09-28 16:16:20 -07:00
Tyler Gunn
108349f8d6 Merge "Add support for network identified emergency calls." 2018-09-24 22:50:50 +00:00
Tyler Gunn
5bd90853a5 Add support for network identified emergency calls.
Add support for the IMS call profile to indicate that a call is an
emergency call.
Add supporting connection and call properties so that this can be
propagated to Telecom and ultimately the Dialer app.
Add System API to determine if the device is in a network IDed or dialed
emergency call (used in Telephony).

Test: Manual test using test intents and ecclist property.
Test: Added new telecom unit tests.
Bug: 77565333
Change-Id: I769e7b5000b10662c08fe53c91ef99edc685d2b1
2018-09-21 09:37:07 -07:00
Wei Huang
7f7f72e451 Propagates voice call radio technology to connection
This patch mainly takes below changes:
 1) Add new extra to indicates the call network technology.
 2) Provides basic function to set/get call radio technology.

Bug: 67856372
Test: Manual
Change-Id: I1a12382fdb589ce823fe7af025832db4cdc152c2
2018-09-19 18:51:52 +09:00
Shaotang Li
8cec25c346 Add new telecom metrics for emergency dialer
These includes,
1. The source where user initiated the call.
2. The duration between START_CONNECTION and REQUEST_DISCONNECT.

Bug: 111818008
Test: manual and check the result of
'adb shell dumpsys telecom' for metrics data
Change-Id: Iddc7f256362abe9fe252bd12cead05a7d77d329e
2018-09-06 12:38:18 +08:00
Mathew Inwood
ec3f7c80ce Merge "Add @UnsupportedAppUsage annotations"
am: 44091cdb47

Change-Id: I1dfae6f3d8ba8d5ff63f378c71f9670199a3adc3
2018-08-06 09:47:13 -07:00
Mathew Inwood
42346d1dd2 Add @UnsupportedAppUsage annotations
For packages:
  android.telecom.Logging
  android.telecom

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I540cb034b933c0d1417a138747ed347fcf0748d7
Merged-In: I04a94d7555be608dc3958787554a3d33b72158ec
2018-08-01 11:33:05 +01: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
aae778c669 Merge "Make TelecomManager#endCall a public API." into pi-dev
am: 872a039ab3

Change-Id: Ic52e1705ce497b0a46bb4107ad854a8b939b38b0
2018-05-07 21:11:14 -07:00
Tyler Gunn
e1aa26c744 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
Change-Id: Ic6527969793ebe05eb9c5fa8205558ae788ea572
2018-05-02 13:23:48 -07:00