Commit Graph

67 Commits

Author SHA1 Message Date
Makoto Onuki
a11035a7eb Remove unnecessarily @System/TestApi annotations
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.

Exempt-From-Owner-Approval: Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: I36e3562b72e64b51e4febd1d42a3bc8e4dc60988
2020-06-24 20:49:20 +00:00
Hall Liu
91219a4a4f Fix docs for LISTEN_CELL_LOCATION
Update docs to reflect the ACCESS_FINE_LOCATION requirement.

Fixes: 140711339
Test: docs only
Change-Id: I64141b9428632069e0ec2345f3ff58a22bbb20aa
2020-06-16 13:53:59 -07:00
Andrew Sapperstein
1f6e22cbd8 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
2020-05-01 00:42:22 +00:00
Hall Liu
6884145ba3 Unhide and update documentation for DisconnectCause
Unhide several constants and update the documentation for
android.telephony.DisconnectCause to reflect where it's being used.

Fixes: 154826441
Test: build
Change-Id: Ib3177367519a704bb469bc494f686c96fb516b85
2020-04-27 17:57:17 -07:00
Jack Yu
ecfb37b868 Renamed DisplayInfo to TelephonyDisplayInfo
To reduce ambiguity with android.view.DisplayInfo.

Test: Telephony sanity tests + unit tests
Bug: 151101989
Merged-In: Ic507b6bf082ca5510ff6d1dcde501f5be9ef074f
Change-Id: Ic507b6bf082ca5510ff6d1dcde501f5be9ef074f
(cherry picked from commit ac3ca33567)
2020-04-20 09:22:33 -07:00
Hall Liu
0a5365b9c0 Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
Merged-In: I4d6681d90705b68c3349f4124e434a29b50fd3a2
2020-04-07 17:13:19 -07:00
Hall Liu
1002495afa Institute limit on PhoneStateListener
Limit apps to 50 concurrently registered instances of PhoneStateListener
via TelephonyManager#listen

Test: atest CtsTelephonyTestCases:PhoneStateListenerTest#testListenerLimit
Bug: 151835251
Change-Id: I8486d86773a1e28b4018620c48003855dae75b9d
Merged-In: I8486d86773a1e28b4018620c48003855dae75b9d
2020-04-07 17:13:14 -07:00
Sarah Chin
bab3e662df Add method to reset network types
Test: build
Bug: 148218045
Change-Id: Ia6eaba4e40fe47e79f8a7b6bcbadc61151d84823
Merged-In: Ia6eaba4e40fe47e79f8a7b6bcbadc61151d84823
2020-03-31 12:57:03 -07:00
Sarah Chin
b93bf72090 Merge "API review: SubscriptionPlan#getNetworkTypes/setNetworkTypes" 2020-03-26 03:41:29 +00:00
Shuo Qian
0d8a3bb0f6 Merge "Hide several System APIs" 2020-03-25 23:11:27 +00:00
Hall Liu
66fc127ad1 Merge "Expose all TelephonyRegistryManager methods" 2020-03-25 20:53:10 +00:00
sqian
bc1f641138 Hide several System APIs
Test: Treehugger
Bug: 151241308
Change-Id: Ie611320f4651b83e0ced6f5c8fede34a8a0a41c1
Merged-In: Ie611320f4651b83e0ced6f5c8fede34a8a0a41c1
(cherry picked from commit 1e154a345c)
2020-03-24 18:40:23 -07:00
Hall Liu
2499c26a49 Expose all TelephonyRegistryManager methods
Expose all the methods as SystemApis for telephony to use.

Fixes: 148114017
Test: atest TelephonyRegistryManagerTest
Change-Id: I43537bf741742eb9e8df1a55e20cc3c8b2bbd874
Merged-In: I43537bf741742eb9e8df1a55e20cc3c8b2bbd874
2020-03-25 01:08:12 +00:00
Sarah Chin
14f87a28d8 API review: SubscriptionPlan#getNetworkTypes/setNetworkTypes
Default value is TelephonyManager#getAllNetworkTypes instead of null

Test: atest SubscriptionManagerTest, DcTrackerTest
Bug: 148218045
Change-Id: If7a46be43648a337ca11ca9dcb30bc532829ef43
Merged-In: If7a46be43648a337ca11ca9dcb30bc532829ef43
2020-03-20 16:40:03 -07:00
Meng Wang
ba66f0f761 SubscriptionPlan: remove getNetworkTypesBitMask
To avoid using hidden API TelephonyManager#getBitMaskForNetworkType

Bug: 140908357
Test: make
Change-Id: Ibb04fd43117d4b7cf9f768e6ccf9a8f605a2f5e8
Merged-In: Ibb04fd43117d4b7cf9f768e6ccf9a8f605a2f5e8
2020-03-20 16:37:57 -07:00
Jack Yu
f86bf75928 Fixed the doc
Added extra information

Test: None
Bug: 150126754
Merged-In: Ice5032ba84a24dd5d9091f80303ccbbc3bd1ff20
Change-Id: Ice5032ba84a24dd5d9091f80303ccbbc3bd1ff20
(cherry picked from commit f23e44e84b)
2020-03-18 21:34:32 -07:00
Nathan Harold
61b5d6741b Add Callback to notify changes of barring status
-Create a BarringInfo class to pass Barring information
 from HAL to PhoneStateListener.
-Add a multi-callback registrant so that ServiceStateTracker
 and potentially DcTracker can also listen to barring info in
 the future.

Bug: 143226991
Test: make update-api && make && atest BarringInfoTest
Merged-In: I08240259f3142beeca991238bf705236f0303954
Change-Id: I08240259f3142beeca991238bf705236f0303954
2020-03-18 09:52:10 -07:00
Daniel Bright
60fe698771 Whitelist telephony broadcasts for bground use
Whitelisted telephony broadcasts using the intent background flag.
Ensured that each broadcast was protected manually through cts test below.

Bug: 148181747
Bug: 151112539
Test: Switched on ActivityManagerDebugConfig.DEBUG_BACKGROUND_CHECK for SIM_STATE_CHANGED
Test:  android.telephony.cts.TelephonyProtectedBroadcastsTest
Merged-In: Id280fc2128b84dda2a8184dfa32ecc5b8f787afb
Change-Id: Id280fc2128b84dda2a8184dfa32ecc5b8f787afb
2020-03-11 17:07:23 -07:00
Jack Yu
987b8df24d Added telephony display info support
Added the new APIs allowing clients like System UI to display
network icons correctly based on the provided telephony display
info.

Test: Telephony sanity tests
Bug: 148540139
Change-Id: I4dfb6eb7a313539e0565a4239d555426f12e503e
Merged-In: I4dfb6eb7a313539e0565a4239d555426f12e503e
2020-03-03 11:21:05 -08:00
Amit Mahajan
da6a199972 Hide TelephonyRegistryManager.
This was added for telephony mainline, and as such is not needed in
R now.

Test: basic sanity
Bug: 149850449
Merged-in: I2b47ab45839f07494dcad4f1878809a55ddd3087
Change-Id: I2b47ab45839f07494dcad4f1878809a55ddd3087
(cherry picked from commit 7411d22e57)
2020-02-27 16:58:09 -08:00
Jack Yu
d588c33c71 Added area info support in cell broadcast service
Added a broadcast for area info changed event, and
also a get method in cell broadcast service to
retrieve the area info.

Test: Cell broadcast sanity tests
Bug: 141318859

Merged-In: I5995e3c5099a1e49cb0c54d33da1dbfcc94d4037
Change-Id: I5995e3c5099a1e49cb0c54d33da1dbfcc94d4037
(cherry picked from commit afaa71d418)
2020-02-04 17:03:01 -08:00
sqian
dfdee636e3 Add LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH into Shell permission
> Is the minimally scoped permission that needs to be added?
This is a minimal permission for always listening to signal strength.

> What options did you explore that did not need this permission?
CTS is required by API council; Telephony CTS is using shell to have
system permission. I don't see other options.

Integrate the callback of LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH

Test: CTS; https://paste.googleplex.com/5811446241820672
Bug: 147322848
Change-Id: Id5afd261a7f00c25e3af3558f30fb92aad42f060
2020-01-30 14:14:43 -08:00
Rambo Wang
63ebb4b126 Clear up permission READ_PRIVILEGED_PHONE_STATE.
- Group all events that need the permisson together
- Enforce the permission of the group mask instead of multiple individuals
- Clear up javadoc of APIs require the permission

Bug: 148021947
Test: make offline-sdk-docs
Test: atest com.android.internal.telephony.TelephonyRegistryTest
Test: atest android.telephony.cts.PhoneStateListenerTest
Test: atest com.android.internal.telephony.PhoneStateListenerTest

Merged-In: I6c801039e3eaf22bae052de6569cf1d9a5b28396
Change-Id: I6c801039e3eaf22bae052de6569cf1d9a5b28396
(cherry picked from commit aac979e1c102c7274dac89b674b5709002d02705)
2020-01-29 04:29:27 +00:00
Jordan Liu
dd6d0b26af Merge "Fix ordered background broadcast API" 2020-01-28 16:33:18 +00:00
sqian
6cd260243a Support always reporting signal strength phone state listener
We should not allow other stack (such as Bluetooth) to directly control
 modem indication reporting. The hidden API
 TelephonyManager.setRadioIndicationUpdateMode added before do not
 support multiple clients and do not support the case when clients'
 process die.

The new solution would be adding a new listener
 PhoneStateListener.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH and let
 telephony registry (which is running under system process) to tell
 telephony whether to always turn on signal strength update if any client
 is listening to this event.

Introduce a new system API for TelephonyRegistry
to tell Telephony module this listening mechanism.

Introduce a new permision for this function

Test: WIP (Have this CL out to try to catch up the API deadline)
Bug: 147322848

Change-Id: Iaee832c75b29d89dbc9e5c6659e1a7e89c4a467f
Merged-In: Iaee832c75b29d89dbc9e5c6659e1a7e89c4a467f
(cherry picked from commit 93642d4433)
2020-01-27 14:20:09 -08:00
Jordan Liu
f026bce66c Fix ordered background broadcast API
This API is only intended for a specific use, so do not allow the caller
to pass in other intents and use it for other things.

Bug: 144108192
Test: atest CellBroadcastIntentsTest
Change-Id: Ibf70fdbb419bbb24f2feeffedc0331e31c865a52
Merged-In: Ibf70fdbb419bbb24f2feeffedc0331e31c865a52
2020-01-27 21:58:19 +00:00
Rambo Wang
82a46e22ce Permission READ_PRECISE_PHONE_STATE implementation polish
- Update the javadoc for all APIs that require this permission.
- Allow carrier privileged apps to access listener APIs that require
  READ_PRECISE_PHONE_STATE.
- Consolidate permissions checks into READ_PRECISE_PHONE_STATE permission group.

Bug: 146383220
Test: atest com.android.internal.telephony.TelephonyRegistryTest
Test: atest android.telephony.cts.PhoneStateListenerTest

Change-Id: I98232261381a4629c4d65a70d6aefee35665b48d
2020-01-17 18:28:26 -08:00
Treehugger Robot
93db49faec Merge "Add Callback for Registration Failure" 2020-01-13 20:58:00 +00:00
Treehugger Robot
9938c70fb5 Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 13:05:17 +00:00
Nathan Harold
c41cb737ed Add Callback for Registration Failure
Add a callback to PhoneStateListener to indicate that
a registration procedure has failed.

Bug: 143187047
Test: make update-api && make
Merged-In: I4a4ba4479dfd465a9d8063135f3b4bf4e1323e99
Change-Id: I4a4ba4479dfd465a9d8063135f3b4bf4e1323e99
(cherry picked from commit 5e6e983cad)
2020-01-12 10:33:03 -08:00
Sarah Chin
c9e48d9403 Update javadocs for API review
Move plan requirements from Builder to SubscriptionPlan
Null and empty network types do not have the same behavior.
Clarify where plan requirements is enforced

Bug: 143550313
Test: none

Change-Id: I80c3b4425f317d5b4e9c685878c866742b706b85
Merged-In: I80c3b4425f317d5b4e9c685878c866742b706b85
2020-01-10 11:01:55 -08:00
Sarah Chin
0262cb7765 Merge "5G meteredness for telephony framework" 2020-01-10 16:36:48 +00:00
Sarah Chin
80b73b9e1c 5G meteredness for telephony framework
Added networkTypes to SubscriptionPlan
Send SubscriptionPlans as dispatch via listener
Updated API for R

Bug: 139070884
Test: atest FrameworksTelephonyTests
Test: atest cts/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
Change-Id: Idb67fb7676adf9e1158113e7b8b08e655f470920
Merged-In: Idb67fb7676adf9e1158113e7b8b08e655f470920
(cherry-pick from ag/9459941)
2020-01-09 19:45:14 +00:00
Artur Satayev
2d330f6fa8 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
Merged-In: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
2020-01-09 15:08:18 +00:00
Meng Wang
8af4d4ad78 Use Parcelable CellIdentity instead of CellLocation in AIDL.
Currently CellLocation is passed over AIDL by manually
marshalling/unmarshalling to/from Bundle, and type info
is not preserved in the process.

Bug: 146092124
Test: make
Merged-In: I6225f100953a2ad354acaa261a774989926393ce
Change-Id: I6225f100953a2ad354acaa261a774989926393ce
2020-01-08 20:29:27 -08:00
Treehugger Robot
0104ce5293 Merge "(Backport) Pipe through featureId from caller to permission checks in telephony code" 2020-01-09 02:48:14 +00:00
Philip P. Moltmann
06b07e9e25 (Backport) Pipe through featureId from caller to permission checks in telephony
code

Test: atest FrameworksTelephonyTests CtsAppOpsTestCases
Bug: 136595429
Fixes: 146350559
Change-Id: Ie58007cf2a4e4a39cdfd72822150efce71dfbe84
Merged-In: I7ef41e8961e48d40e5685c4a521e83cb20953e48
2020-01-08 14:16:54 -08:00
Nathan Harold
801bfb0d80 Merge "Expose PreciseDataConnectionState to Public API"
am: 47fbf0aaa0

Change-Id: I748243b2ebc02c6c750b83b722e5b38cf8fcf26e
2019-12-26 15:10:18 -08:00
Nathan Harold
47fbf0aaa0 Merge "Expose PreciseDataConnectionState to Public API" 2019-12-26 23:05:58 +00:00
Shi Lu
55cc8b27b8 Merge "Exposing voice connection status system APIs as public API"
am: 96e8628049

Change-Id: I222a9a2b44050825a4553b4b7baa7dfe7de3e046
2019-12-20 18:39:56 -08:00
Shi Lu
96e8628049 Merge "Exposing voice connection status system APIs as public API" 2019-12-21 02:31:36 +00:00
Nathan Harold
d9b5dda461 Expose PreciseDataConnectionState to Public API
1) Remove Unused Parameters for onDataConnectionState:
The data connection state broadcast includes a number of
parameters that are never used anywhere. To prepare for
updated code that relies on PreciseDataConnectionState,
remove the unused parameters that were internal-only and
included in the broadcast.

-LinkProperties
-NetworkCapabilities
-DataRoaming
-DataAllowed
-Interface name

2) Add Disconnecting State for Data Connections

Add a disconnecting state to correct a mismatch
between the internal and externally visible enums.

This will allow apps to know when connections are
in the process of being torn down, which in the case
of radio link issues could be as much as 15 seconds.

3) Expose PreciseDataConnection for Carrier Apps

Exposes the PSL for PreciseDataConnectionState along
with existing fields in the PreciseDataConnectionState
class.

-Make PreciseDataConnectionState public along with some
 of its fields.
-Expose onPreciseDataConnectionStateChanged.
-Add onPreciseDataConnectionStatesChanged to provide PDCS
 for all APNs in one cohesive batch.

4) Cache PreciseDataConnectionState by APN Type

In telephony registry, multiple different APN types
are all piped through the same cache entry, so every
time any APN changes relative to the previous type,
it triggers an update. This also means that when
a registrant requests the data connection state, only
the most recent type's state is updated.

This change caches entries in TelephonyRegistry based
on the APN's type (specifically the type among types
which triggered the change).

Bug: 143083105
Test: make update-api && make offline-sdk-docs
      (no functional change in this CL).
Test: atest FrameworksTelephonyTests

Merged-In: Ib6a769f5a0cae923ca47a842733bd28755a90ed5
Change-Id: Ib6a769f5a0cae923ca47a842733bd28755a90ed5
(cherry picked from commit 4d340f12c9)
(cherry picked from commit c95b4e5421)
2019-12-20 10:06:54 -08:00
Meng Wang
6846fe997c Merge "Remove PhoneStateLister#onOtaspChanged"
am: 0d7a5dc2ea

Change-Id: Ide424903fac31549a660ded17d24c14fa4e5db5b
2019-12-17 13:25:04 -08:00
Meng Wang
66972daf11 Remove PhoneStateLister#onOtaspChanged
and replace with Registrant in Phone, since the callback is only used
inside telephony.

Bug: 140908357
Test: make
Change-Id: Ia86e9885f85d7f6b3698e96653add00e9b8670ed
2019-12-16 15:10:43 -08:00
Chen Xu
91c9100315 Merge "expose APIs for mainline telephony-sdk"
am: 0bc81e1d23

Change-Id: I0aff3aabfe041fdd24a7a18389b91a6471d3548c
2019-12-16 12:58:06 -08:00
Chen Xu
0bc81e1d23 Merge "expose APIs for mainline telephony-sdk" 2019-12-16 20:51:04 +00:00
Jordan Liu
e0c19be377 Merge changes from topic "cellbroadcastintents"
am: 6bcc4db8c0

Change-Id: Idd0a6a63731f996573f51e3343c3165d692d1adc
2019-12-12 16:02:56 -08:00
Jordan Liu
10373f032e Add API to send background intent
am: d0f439c43b

Change-Id: I82352ac4247dc785efef4c006a440d56e514f575
2019-12-12 16:02:48 -08:00
Jordan Liu
3fd1264acb Do not modify passed in intent
If the caller wanted to use that intent object after passing it to this
method, it would be mutated in an unexpected way. Instead we create a
copy of the intent and broadcast that.

Bug: 144108192
Test: atest com.android.internal.telephony.CellBroadcastIntentsTest
Change-Id: I89e08b4a50beeb49410521baa9d449b2dc28ecd3
Merged-In: I89e08b4a50beeb49410521baa9d449b2dc28ecd3
2019-12-12 14:06:59 -08:00
Jordan Liu
d0f439c43b Add API to send background intent
Test: manual
Bug: 144108192
Change-Id: I93c49d377921830a2ae83217a3fbef5026982319
Merged-In: I93c49d377921830a2ae83217a3fbef5026982319
2019-12-12 13:08:12 -08:00