Commit Graph

1914 Commits

Author SHA1 Message Date
Hongwei Wang
286c33a5c5 Merge "Revert "Add maxTargetSdk restriction to unused APIs."" 2020-10-28 23:58:21 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
ee5d369323 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-28 09:39:20 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Shuo Qian
4d0652699a Introduce hasCompanionInCallServiceAccess API
It retruns whether the caller has InCallService access for the companion
 apps. A companion app is an app associated with a physical wearable
 device via the {@link android.companion.CompanionDeviceManager} API.

Test: cts
Bug: 169595473
Change-Id: Id659bfae8556e965d3c31613848bde808f28a858
2020-10-26 16:57:38 -07:00
Tyler Gunn
5c17953fb7 Merge "Modify the TelecomLoaderService to provide LocalServices to Telecom" 2020-10-26 15:59:36 +00:00
Hall Liu
f2addd13df Merge changes from topic "mainline-telecom-constants" am: c155bb62a1 am: e5eef00627 am: 0494ed6b1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1471168

Change-Id: If029ec79c21683684f6d55232ec843cc7b845ff8
2020-10-23 03:46:22 +00:00
Hall Liu
c313e8a85d API tweaks in response to feedback am: 5968c09340 am: 429a15d480 am: 5cff38cc1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1471167

Change-Id: Iaab53ad343a38a3764344f6e5ace2f7e242c79c1
2020-10-23 03:46:06 +00:00
Brad Ebinger
ee4eca707c Modify the TelecomLoaderService to provide LocalServices to Telecom
We need access to the DeviceIdleController, which is not currently
accessible via the PowerWhitelistManager due to restrictions with
components in the same SYSTEM process accessing public APIs (see
context#enforceCallingPermission).

To get around this, we need to wrap services only available as
LocalServices using Binder to pass these services to the Telecom
code. This is all in-process (no IPC allowed), so there should be
little to no impact.

Bug: 160724034
Test: miss call and verify `adb shell cmd deviceidle tempwhitelist` contains
default dialer.
Test: atest TelecomUnitTests; atest CtsTelecomTestCases

Change-Id: I6275b550d19743e576b93f5fcd2bd3aa9ea4e1a8
Merged-In: I3d71331cbc8f01f764cc0b9704416821007feeb5
2020-10-22 21:43:02 +00:00
Hall Liu
2cf63f72cd Update documentation for phone account sort order
Update documentation to reflect that the sort order extra
should contain integers.

Bug: 169153499
Test: docs only
Change-Id: Ic5269d577f007e01a0c9eaa95cd7e8814ab8f79a
Merged-In: Ic5269d577f007e01a0c9eaa95cd7e8814ab8f79a
2020-10-22 14:07:38 -07:00
Hall Liu
5968c09340 API tweaks in response to feedback
Update documentation on PhoneAccount#EXTRA_SORT_ORDER to make it more
clear what the sorting order is in edge cases.

Make DisconnectCause#REASON_EMULATING_SINGLE_CALL public, since it might
get propogated up to dialer apps.

Fixes: 169153499
Test: docs only
Change-Id: I7f810f909a8a61b422283c3bafcc97307e4d863b
Merged-In: I7f810f909a8a61b422283c3bafcc97307e4d863b
2020-10-22 14:07:32 -07:00
Anton Hansson
24b4d166dd Merge "Remove @TestApi from @SystemApi symbols" am: d2d4637685 am: cbe282347e am: 14897c256d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466264

Change-Id: I859503688ea3254d5bd1b55e80cf1962286e948f
2020-10-20 20:31:58 +00:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Anton Hansson
dd7d52f963 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Sungjae
7f4137452d Use phoneAccountHandle based on connection
After triggering dial, phoneAccountHandle can be changed.
In this case, the stack to which dial is requested and
the stack to be displayed on the UI can be different.
So, modified to use phoneAccountHandle which base on
connection, not request.

Bug: 168681491
Test: manual

Signed-off-by: Sungjae <sung_jae.kim@samsung.com>
Change-Id: I56ac5b2d4f1b5e8d78741a43a332b025af7e4d54
2020-10-19 11:14:35 +09:00
Shuo Qian
af6b219d6f Merge "Use TelephonyManager#isEmergencyNumber() instead" am: 1963c4b1c6 am: e931ca461e am: 4e847577d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1454556

Change-Id: Iaf149e798f39c8bceecb5a50ba2933f46402ba52
2020-10-14 18:44:18 +00:00
Taesu Lee
b40a55ccc9 Use TelephonyManager#isEmergencyNumber() instead
Replace deprecated PhoneNumberUtils#isLocalEmergencyNumber() and
isEmergencyNumber() with TelephonyManager#isEmergencyNumber().

Test: Build
Bug: 132703886

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I232d7f7d23efd963b6d30938f0fa304c90fca8a8
Merged-In: I232d7f7d23efd963b6d30938f0fa304c90fca8a8
2020-10-14 02:31:14 +00:00
Taesu Lee
902b89d936 Use TelephonyManager#isEmergencyNumber() instead
Replace deprecated PhoneNumberUtils#isLocalEmergencyNumber() and
isEmergencyNumber() with TelephonyManager#isEmergencyNumber().

Test: Build
Bug: 132703886

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I232d7f7d23efd963b6d30938f0fa304c90fca8a8
2020-10-13 15:52:20 -07:00
Tyler Gunn
d67a33d6e1 Merge "Add clarification text on getCallerNumberVerificationStatus docs." am: f83bccb02f am: 793b248026 am: 0b22366dc7 am: 49f8fc73bf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1455218

Change-Id: Icf13ea562dc9dbfd241c28c7938b8bfa50d4631b
2020-10-09 19:01:21 +00:00
Tyler Gunn
49f8fc73bf Merge "Add clarification text on getCallerNumberVerificationStatus docs." am: f83bccb02f am: 793b248026 am: 0b22366dc7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1455218

Change-Id: I6f93ead176a20d649eb32456288f40b2d8a9d116
2020-10-09 18:34:41 +00:00
Tyler Gunn
f83bccb02f Merge "Add clarification text on getCallerNumberVerificationStatus docs." 2020-10-09 17:07:40 +00:00
Tyler Gunn
9c64249ea2 Add clarification text on getCallerNumberVerificationStatus docs.
Update API docs to make it clear what the verification status means and how
it can be used by CallScreeningService and CallRedirecitonService
implementations.

Test: Build API docs and view offline.
Bug: 150343312
Change-Id: I56f92f5e3ab544e31337a8147134baac33bb4ea9
2020-10-08 13:37:03 -07:00
Jeff Sharkey
f76ffeaff1 Merge changes from topic "oct6"
* changes:
  Upgrade AndroidFrameworkBinderIdentity to fatal.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
2020-10-08 18:50:22 +00:00
Treehugger Robot
01aca15537 Merge "CallScreeningService API docs cleanup." am: 834c527a3b am: fcafb9acdf am: c3f4c873df am: 1f4f3591a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1453996

Change-Id: I71719dac58f6cda5e94fb62cd68015ce11a097c3
2020-10-08 04:20:36 +00:00
Treehugger Robot
1f4f3591a8 Merge "CallScreeningService API docs cleanup." am: 834c527a3b am: fcafb9acdf am: c3f4c873df
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1453996

Change-Id: I201fb017f2bd7c4e0c808a6053cdf3655669151c
2020-10-08 04:05:46 +00:00
Treehugger Robot
834c527a3b Merge "CallScreeningService API docs cleanup." 2020-10-08 02:49:10 +00:00
Treehugger Robot
7709d39a4d Merge "Clarify API docs for getCannedTextResponses." am: fc1a08a982 am: 9626f7cc42 am: 48b97996fb am: 0108bb9b4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1451125

Change-Id: Id0185ea220741f93f43ebf7433d9655013f9dae9
2020-10-08 02:36:03 +00:00
Treehugger Robot
0108bb9b4b Merge "Clarify API docs for getCannedTextResponses." am: fc1a08a982 am: 9626f7cc42 am: 48b97996fb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1451125

Change-Id: Ic9201f0e0a3b48561926023524eb308abd4cde91
2020-10-08 02:14:17 +00:00
Tyler Gunn
467acc47a3 CallScreeningService API docs cleanup.
Cleanups for call screening service APIs and to provide more clarity for
the lifecycle of the service.

Fixes: 170286897
Test: make docs ; preview docs genreated.
Change-Id: I487b438e39abb83cee1bd050889a6bce164247d7
2020-10-07 15:54:43 -07:00
Tyler Gunn
434fc2c524 Clarify API docs for getCannedTextResponses.
The API docs do not clearly indicate the fact that canned text responses
may not be available when a call is first added.  Updating the API docs
to clarify this and reference the listener a developer can use to be
informed of changes to the canned responses.

Test: Docs only change.
Bug: 162843384
Change-Id: I52ced96439b2dfa31c1f2428979ab54466763afa
2020-10-06 14:23:54 -07:00
Jeff Sharkey
2d2e07e2ff Tighten up Binder.clearCallingIdentity() usage.
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.

This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared.  Here's the exact command
used to generate this CL:

$ find . -name "*.java" -exec sed -Ei \
    's/    (long \w+ = .+?clearCallingIdentity)/    final \1/' \
    {} \;

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
2020-10-06 11:18:09 -06:00
Hall Liu
4bb53ec753 Update documentation for phone account sort order
Update documentation to reflect that the sort order extra
should contain integers.

Bug: 169153499
Test: docs only
Change-Id: Ic5269d577f007e01a0c9eaa95cd7e8814ab8f79a
2020-09-29 15:15:24 -07:00
Hall Liu
221f804a00 API tweaks in response to feedback
Update documentation on PhoneAccount#EXTRA_SORT_ORDER to make it more
clear what the sorting order is in edge cases.

Make DisconnectCause#REASON_EMULATING_SINGLE_CALL public, since it might
get propogated up to dialer apps.

Fixes: 169153499
Test: docs only
Change-Id: I7f810f909a8a61b422283c3bafcc97307e4d863b
2020-09-23 16:48:59 -07:00
Hall Liu
e82e9bf01b Merge "Expose Telecom constants for use in Telephony" am: 9fcb2819d0 am: 1bf919f084 am: 5b6beb2fc0 am: 2f8cf2f852 am: 74bb99708b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1427473

Change-Id: Id62c2a0f4add8ce3fccaef64240f9a8efb79aa94
2020-09-16 01:48:21 +00:00
Hall Liu
74bb99708b Merge "Expose Telecom constants for use in Telephony" am: 9fcb2819d0 am: 1bf919f084 am: 5b6beb2fc0 am: 2f8cf2f852
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1427473

Change-Id: Ib461b9a4f7271b9f9263cae8292dc5d0579fc102
2020-09-16 01:25:39 +00:00
Hall Liu
2ef041183d Expose Telecom constants for use in Telephony
Expose Telecom constants that are used in Telephony in preparation for
mainline. Exposure is a combination of public/system -- those which made
sense for 3pty apps to access were made public.

Fixes: 168551099
Test: atest CtsTelecomTestCases
Change-Id: I688f04ba4ddf0498bad3463888fae71cdff2844a
2020-09-14 18:37:44 -07:00
Brad Ebinger
c2d060210a Merge "Modify the TelecomLoaderService to provide LocalServices to Telecom" into rvc-qpr-dev am: ebef1b923b am: 4cead2c3e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12522284

Change-Id: I021763a0d7108b89b09087d115d143ae140bb7a8
2020-09-09 23:41:50 +00:00
Brad Ebinger
4cead2c3e8 Merge "Modify the TelecomLoaderService to provide LocalServices to Telecom" into rvc-qpr-dev am: ebef1b923b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12522284

Change-Id: I3d71331cbc8f01f764cc0b9704416821007feeb5
2020-09-09 17:42:32 +00:00
Songchun Fan
c903f6ac26 [telecom] system_server should not call non forUser Settings.Secure.get* methods
BUG: 166312046
Test: builds
Change-Id: I69e91c84ff170abd6e82e0ff322e168c11004daa
2020-09-03 22:59:14 +00:00
Brad Ebinger
cfa3045a5b Modify the TelecomLoaderService to provide LocalServices to Telecom
We need access to the DeviceIdleController, which is not currently
accessible via the PowerWhitelistManager due to restrictions with
components in the same SYSTEM process accessing public APIs (see
context#enforceCallingPermission).

To get around this, we need to wrap services only available as
LocalServices using Binder to pass these services to the Telecom
code. This is all in-process (no IPC allowed), so there should be
little to no impact.

Bug: 160724034
Test: miss call and verify `adb shell cmd deviceidle tempwhitelist` contains
default dialer.
Test: atest TelecomUnitTests; atest CtsTelecomTestCases

Change-Id: I6275b550d19743e576b93f5fcd2bd3aa9ea4e1a8
2020-09-03 22:36:54 +00:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Grace Jia
1c997e4ead Merge "Add adhoc conference APIs to RemoteConnection and RemoteConnectionService." am: 329c6ff777 am: e40cfa60de am: 6a55cd1644 am: 300b3cce72 am: f98b0c5eb1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1388908

Change-Id: I3fc6ba1492996d41530461452e83759a490adc6d
2020-08-13 19:30:59 +00:00
Grace Jia
6a55cd1644 Merge "Add adhoc conference APIs to RemoteConnection and RemoteConnectionService." am: 329c6ff777 am: e40cfa60de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1388908

Change-Id: I49034d851b111792fa54b3d2f236d56513bb00f9
2020-08-13 18:46:06 +00:00
Grace Jia
329c6ff777 Merge "Add adhoc conference APIs to RemoteConnection and RemoteConnectionService." 2020-08-13 18:06:19 +00:00
Tyler Gunn
560c97bc25 Merge "Improve remote connection logging." 2020-08-12 18:27:36 +00:00
Tyler Gunn
419c0fa22e Merge "Fix createLaunchEmergencyDialerIntent API behavior when Telecom unavailable." 2020-08-12 18:27:18 +00:00
Grace Jia
9a09c67075 Add adhoc conference APIs to RemoteConnection and
RemoteConnectionService.

Plumb through the adhoc conference APIs via these new APIs.

Bug: 159944852
Test: atest CtsTelecomTestCases:RemoteConnectionTest
Change-Id: Icfa27e0616dd35ba350f7a491e5c95337a286b9d
2020-08-11 19:26:33 +00:00
Grace Jia
0128b3c58c Deprecate TelecomManager#getPhoneAccountsForPackage for security.
Bug: 153995334
Test: make
Change-Id: I66d757139f3b7e25481b302e9378327873c7912c
2020-08-07 00:41:29 +00:00
Tyler Gunn
c59fd0cd80 Improve remote connection logging.
This CL improves traceability of calls initiated via a remote connection
service.
For regular incoming/outgoing calls, when initiating a request to create
a remote connection in RemoteConnectionService, we set
EXTRA_REQUESTING_PACKAGE_NAME in the parcelled request to the package name
of the connection manager.  In ConnectionService this serves as an
indicator that the incoming request is via a connection manager and is
used to trigger setting of EXTRA_REMOTE_PHONE_ACCOUNT_HANDLE with the
phone account handle the remote connection service uses to place the call.
For conferences and existing connections, the initial request is from
the remote connection service to the connection manager so we can
just set the EXTRA_REMOTE_PHONE_ACCOUNT handle there directly.

Also cleaned up logging in the telecom session logging to remove the
assumption that the ownerInfo is an incall service.

Test: Manual testing with connection manager to verify logging.
Bug: 154353494
Fixes: 155097158
Merged-In: I916750e0f558db1eb9e581bab7a9fbc71f781709
Change-Id: Iee1b5cfd3334a5de08d7b04022b7c6d5af6a4b04
2020-08-05 13:45:33 -07:00
Tyler Gunn
893a602e61 Fix createLaunchEmergencyDialerIntent API behavior when Telecom unavailable.
The API contract for createLaunchEmergencyDialerIntent indicates that
the return value is @NonNull, however the code clearly can return a null
value if either:
1. Telecom is unavailable.
2. There is a remote exception.

Since the API just returns a new ACTION_EMERGENCY_DIAL intent with the
package name of the emergency dialer (from Telecom string resources), we
can provide a reasonable fallback behavior by just returning a new
ACTION_EMERGENCY_DIAL intent with no targeted package.  The system will
still launch the emergency dialer in this case, but if there is a scenario
where multiple emergency dialers are installed on a device, the AOSP one
may get launched instead.  This is, however, better than there being NO
emergency dialer launched.

Test: Comment out call to Telecom service and verify the AOSP emergency
dialer still launches.
Bug: 152187752
Fixes: 155097434
Merged-In: I1665d456dace8e41cc035e792f319d98dd07219c
Change-Id: I06f8a5bebace5b22822f7bb714e14915126b904f
2020-08-05 13:37:27 -07:00