Commit Graph

94 Commits

Author SHA1 Message Date
Jack Yu
59e09ca52a Merge "Added telephony display info support" 2020-02-13 17:42:54 +00:00
Jack Yu
73036c4075 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
2020-02-12 20:31:22 -08:00
Meng Wang
9c99325b87 Revert "System API used by telephony to bind to WapPushManager app."
This reverts commit e6a40697e1.

Reason for revert: API review comments

Bug: 148179277
Change-Id: I729e1c27492b25cfcdb4244e294672ba34a7e7ea
2020-02-10 14:42:41 -08:00
Nathan Harold
0d9a92bd53 Update Privileges for BARRING_INFO and REG_FAILURE
Modify the privilege for LISTEN_BARRING_INFO and for
LISTEN_REGISTRATION_FAILURE to require READ_PRECISE_PHONE_STATE.

Because both of these should only be of interest to special-
purpose applications such as Carrier Apps or diagnostics apps,
limit the permissions to encourage barring info to be collected
via NET_CAPABILITY_NOT_CONGESTED, and for registration failure
to be learned in a more digestible fashion via ServiceState.

Bug: 149061935
Test: atest TelephonyManagerPermissionTest && atest CarrierApiTest
Change-Id: If8c915745951d745a5b30e9c44732db704f09a8d
2020-02-06 21:12:30 -08:00
Automerger Merge Worker
331dc63204 Merge "Add LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH into Shell permission" am: a3243e8e6e am: 535739cdd7 am: 16d8f3ccc6
Change-Id: I57eba979ba1146a349c2cd85f0e5d5129006e398
2020-01-31 16:57:19 +00:00
Daniel Bright
3f6ebb55ff Merge "Whitelist telephony broadcasts for bground use" 2020-01-30 23:45:52 +00: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
Daniel Bright
8acac15ced 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
Test: Switched on ActivityManagerDebugConfig.DEBUG_BACKGROUND_CHECK for SIM_STATE_CHANGED
Test:  android.telephony.cts.TelephonyProtectedBroadcastsTest
Change-Id: Id280fc2128b84dda2a8184dfa32ecc5b8f787afb
2020-01-29 16:46:05 -08:00
Rambo Wang
879bc4ae15 Merge "Clear up permission READ_PRIVILEGED_PHONE_STATE." 2020-01-29 22:06:11 +00:00
Jack Yu
afaa71d418 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

Change-Id: I5995e3c5099a1e49cb0c54d33da1dbfcc94d4037
2020-01-28 21:05:25 -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
Meng Wang
489e391d8f TelephonyManager: do not acceess hidden API
... PhoneStateListener.mSubId; move the logic to
TelephonyRegistryManager.

Bug: 140908357
Test: make
Change-Id: I2594cdfe178b02aeab9f88dc16586418eca985ff
2020-01-27 18:10:24 -08: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
Jordan Liu
2bc01a8764 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
2020-01-27 10:07:20 -08:00
Peter Wang
51b09fa089 [Telephony Mainline] Remove usages of IBinder's for classes that do not
belong to Telephony

Bug: 142255256
Bug: 147703450
Change-Id: Ic687858415d1812eae2777e8dd7d96a0d8814528
Fix: 147703450
Test: Build
2020-01-23 11:53:32 -08:00
Rambo Wang
feed16dda7 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
Change-Id: I6c801039e3eaf22bae052de6569cf1d9a5b28396
2020-01-22 14:12:41 -08:00
TreeHugger Robot
bfbad6d3e0 Merge "Expose all TelephonyRegistryManager methods" 2020-01-22 20:41:09 +00:00
Hall Liu
9b94e1fcf2 Expose all TelephonyRegistryManager methods
Expose all the methods as SystemApis for telephony to use.

Fixes: 148114017
Test: atest TelephonyRegistryManagerTest
Change-Id: I43537bf741742eb9e8df1a55e20cc3c8b2bbd874
2020-01-21 20:07:01 -08:00
Rambo Wang
4083e5942d resolve merge conflicts of 5a10428642 to master
Bug: None
Test: atest com.android.internal.telephony.TelephonyRegistryTest
Test: atest android.telephony.cts.PhoneStateListenerTest
Change-Id: Ibd9b67ce9be1d8ad718da45d494fc2bfe75f0959
2020-01-21 17:23:14 -08:00
Shuo Qian
93642d4433 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
2020-01-17 22:25:46 -08: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
Chen Xu
546ce5e45e modularize telephony-framework from framework.jar
Bug: 140908357
Test: Build & Manaul
Change-Id: Idd4cbdb84247b98072b6ebc00a37168fde6fbbaa
2020-01-16 14:32:50 -08:00
Nathan Harold
c564b1dc33 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
Change-Id: I08240259f3142beeca991238bf705236f0303954
2020-01-14 13:54:09 -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
Meng Wang
e6a40697e1 System API used by telephony to bind to WapPushManager app.
Bug: 145179378
Test: make
Change-Id: Ibfb5ce49d20addcd19775d9e8d762945e71b9843
2020-01-08 13:52:19 -08:00
Meng Wang
1ce0f39441 Merge "ANY_DATA_CONNECTION_STATE_CHANGED: define locally" 2020-01-08 02:26:44 +00:00
Meng Wang
dd43acc58f ANY_DATA_CONNECTION_STATE_CHANGED: define locally
to cut the tie with telephony mainline module.

Bug: 147101086
Test: make
Change-Id: I2b749cadbbf425649b38786821025a1634fe4d4e
2020-01-07 14:05:25 -08:00
Nathan Harold
8b804f3308 Merge "Add Callback for Registration Failure" 2020-01-07 18:17:03 +00:00
Artur Satayev
df4395991f 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
2020-01-07 13:29:50 +00:00
Meng Wang
0c8855d36c SubscriptionPlan: remove getNetworkTypesBitMask
To avoid using hidden API TelephonyManager#getBitMaskForNetworkType

Bug: 140908357
Test: make
Change-Id: Ibb04fd43117d4b7cf9f768e6ccf9a8f605a2f5e8
2020-01-03 10:28:26 -08:00
Nathan Harold
5e6e983cad 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
Change-Id: I4a4ba4479dfd465a9d8063135f3b4bf4e1323e99
2020-01-02 17:01:36 -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
Automerger Merge Worker
45b1f5ad60 Merge "Exposing voice connection status system APIs as public API" am: 96e8628049 am: 55cc8b27b8 am: 04e221f3f9
Change-Id: Icd243058227e34171c3c6f72de6d3eaf1fee9d6c
2019-12-21 03:02:41 +00:00
Automerger Merge Worker
04e221f3f9 Merge "Exposing voice connection status system APIs as public API" am: 96e8628049 am: 55cc8b27b8
Change-Id: Ic43b8d82f5caeca0a7339d77f4f53bebc408d871
2019-12-21 02:51:34 +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
Meng Wang
d75f97d21e 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
Change-Id: I6225f100953a2ad354acaa261a774989926393ce
2019-12-20 10:50:09 -08: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