Commit Graph

20715 Commits

Author SHA1 Message Date
Svet Ganov
c2841ec7fe Allow UiAutomation to adopt the shell permission indentity
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.

This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions  granted to the shell.

Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
          -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions

bug:80415658

Merged-In: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
2019-02-21 19:59:14 +00:00
Nathan Harold
a6dda25ac9 Merge "Expose the Radio HAL Version for Test Purposes" 2019-02-20 17:50:41 +00:00
Shuo Qian
59d8275546 Merge "Populate 'hasKnownUserIntentEmergency'" 2019-02-15 21:23:52 +00:00
Nathan Harold
69e0ed19e1 Expose the Radio HAL Version for Test Purposes
To properly check that values are being populated by
devices supporting newer HALs, it is necessary to
avoid enforcement on devices using older HAL versions.
Exposing the HAL version for test purposes allows that.

Bug: 122834594
Test: compilation
Change-Id: Idadc2fc8dd4f7b4765af90d92b62eea3e017a843
2019-02-15 09:56:00 -08:00
Remi NGUYEN VAN
bfe928d593 Merge "Remove NetworkMonitor dependency on ICaptivePortal" 2019-02-15 08:09:29 +00:00
Remi NGUYEN VAN
cfff01e2db Remove NetworkMonitor dependency on ICaptivePortal
ICaptivePortal is used in the framework and cannot be used as a
dependency in NetworkMonitor, as the framework class takes precedence
when linking.
Also fix NetworkMonitorTest that was not verifying the right
startCaptivePortalApp call.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: I8e7bb79e50650ae182a2e4277fb49abf5fb6d910
Merged-In: Ib6a89e54312628662b130fbeec18d11e139f09fa
2019-02-15 12:20:03 +09:00
Benedict Wong
0dddb902ae Merge "Add Test Network and Transport types" 2019-02-14 18:37:04 +00: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
Jordan Liu
b8493ac5eb Merge "Add UNINITIALIZED and rename INVALID" 2019-02-14 00:14:11 +00:00
Hall Liu
a3aae9fe4b Merge "Implement more location checks" 2019-02-13 23:21:43 +00:00
Pengquan Meng
600827273c Merge "Add getSlotsMapping to TelephonyManager" 2019-02-13 22:23:16 +00:00
Hall Liu
ee313737e9 Implement more location checks
Make the following modifications to APIs and required permissions.
Move the following APIs from checking coarse permission to fine
permission (except for apps targeting pre-Q):
TelephonyManager.getCellLocation()
(deprecated) TelephonyManager.getNeighboringCellInfo()
TelephonyManager.getAllCellInfo()
TelephonyManager.requestCellInfoUpdate()
PhoneStateListener#onCellLocationChanged
PhoneStateListener#onCellInfoChanged

Start checking for fine permission on the following APIs:
(Note -- these will only be logged, not denied until a future CL)
TelephonyManager.requestNetworkScan()
TelephonyScanManager.requestNetworkScan()
NetworkScanCallback#onResults

Start checking for coarse permission on the following APIs:
(Note -- these will only be logged, not denied until a future CL)
TelephonyManager#getAvailableNetworks
TelephonyManager#getServiceStateForSubscriber and #getServiceState
PhoneStateListener#onServiceStateChanged

Bug: 116258458
Test: manual via testapps
Change-Id: I45326ddacbcf538da50ca544d67eed12cf0c0861
2019-02-13 11:07:37 -08:00
Nathan Harold
627900696f Merge "Add missing UARFCN Getter to CellIdentityTdscdma" 2019-02-13 18:17:36 +00:00
Jordan Liu
1f85a3ddf3 Add UNINITIALIZED and rename INVALID
UNINITIALIZED_CARD_ID is for before the card ID is ready.
INVALID_CARD_ID is renamed to UNSUPPORTED_CARD_ID and it is used if the
card ID is known to be unsupported.

Bug: 122978614
Test: atest UiccControllerTest
Change-Id: Ia2315d9b38ef35b30d9b96b6436c08fa4404e4df
Merged-In: Ia2315d9b38ef35b30d9b96b6436c08fa4404e4df
2019-02-13 09:54:30 -08:00
Po-Chien Hsueh
fa240e8054 Merge "Add DynamicAndroidClient" 2019-02-13 01:20:26 +00:00
Pengquan Meng
0c44939a95 Add getSlotsMapping to TelephonyManager
Bug: 123101769
Test: build
Merged-In: I416d741947b1a15e66ebf71b8104c4b2ec95e310
Change-Id: I416d741947b1a15e66ebf71b8104c4b2ec95e310
(cherry picked from commit 83e7b920de)
2019-02-12 16:24:22 -08:00
Chen Xu
307f4cfeb1 Merge "Address API feedbacks for networktypebitmask" 2019-02-12 23:27:36 +00:00
Nathan Harold
da59b53907 Add missing UARFCN Getter to CellIdentityTdscdma
Add a method to get the UARFCN for CellIdentityTdscdma.
There is an equivalent method in all the other classes,
so this is simply correcting an oversight.

Bug: 123957505
Test: atest CellIdentityTdscdmaTest
Change-Id: I743d90b4532b86edb34d267ae55eca73de2a0086
2019-02-12 13:26:46 -08:00
Nathan Harold
e13c593c9f Add NR Cell Identity to CellIdentityNr
Add the NCI to CellIdentityNr.

Bug: 124126359
Test: atest CellIdentityNrTest
Change-Id: I628048c61d3d6b6e2439357e8233c483a3c0d1d4
2019-02-12 13:26:46 -08:00
chen xu
fdeb60bd74 Address API feedbacks for networktypebitmask
1. change networktypebitmask from int to long
2. right shift definition by 1 for each bitmask, in consistent with
NW bitmask used in APN settings
3. add missing definition for IWLAN

Bug: 119118373
Test: atest CtsTelephonyTestCases:TelephonyManagerTest#testGetRadioAccessFamily
Change-Id: Idf0f88225c20fc0ed10ae4fccb705f988a3bec60
(cherry picked from commit 75b486e4c8)
Merged-in: Idf0f88225c20fc0ed10ae4fccb705f988a3bec60
2019-02-12 19:13:09 +00:00
Pengquan Meng
0beb397fa5 Merge "Add get/set PreferredNetworkTypeBitmap" 2019-02-12 03:08:57 +00:00
Nazanin Bakhshi
55faf37439 Merge "Make isRebootRequiredForModemConfigChange SystemApi" 2019-02-12 00:37:43 +00:00
Michele Berionne
31e933cf78 Merge "Add API to check if a SIM card matches carrier restrictions." 2019-02-11 23:47:25 +00:00
Xiangyu/Malcolm Chen
52a31598e7 Merge changes from topics "118348832", "120945564"
* changes:
  Adding validationBeforeSwitchSupported in phoneCapability.
  Add API to handle user's subscription selection changes.
2019-02-11 23:19:17 +00:00
Benedict Wong
89ce5e3c1b Add Test Network and Transport types
This change adds new network types for testing purposes, signifying a
network with an extremely limited feature set.

Bug: 72950854
Test: Compiles, CTS tests relying on this work correctly.
Change-Id: I06cade6044afd12e0b69ed3c2f160f27f85d43d0
2019-02-11 12:57:43 -08:00
Nazanin Bakhshi
0e3e93a07c Make isRebootRequiredForModemConfigChange SystemApi
Bug: 124074656
Test: build
Change-Id: I32c6b0786d32b05d690cea862e977e6a2b756c90
2019-02-11 10:37:45 -08:00
Sahin Caliskan
74ebff87b5 Unhide RcsMessageStore APIs
This change unhides the RcsMessageStore APIs

Test: Existing tests pass. Repo upload didn't complain about anything
API related

Bug:109759350
Change-Id: Ifc980dd9173df520bad899a7a6681e6da63e46fc
2019-02-11 16:42:30 +00:00
Howard Chen
1eb4c54294 Add DynamicAndroidClient
DynamicAndroidClient is the SystemApi to invoke DynamicAndroid
installation service. It also provides a listener for status update.

Bug: 122440941
Test: Compile and run on internal target
Change-Id: I1ea5e861ecaca1647b445eac57ed15a144be68e8
Merged-In: I1ea5e861ecaca1647b445eac57ed15a144be68e8
2019-02-11 14:02:46 +08:00
Paul Duffin
1af02739be Deprecate ref... methods in MethodHandleInfo
These methods were mistakenly exposed as part of the public API in
Android 26. They do not appear to be used by any apps so this is a
prelude to removing them from the API completely.

Bug: 114175595
Test: make checkbuild
Change-Id: I17b7369a4fbb568bde5285d705d9194ac91e576d
2019-02-08 14:59:46 +00:00
Paul Duffin
6bb71b0322 Merge "Add TEST_MAPPING for api specifications" 2019-02-08 11:51:39 +00:00
Malcolm Chen
77b2b559e1 Add API to handle user's subscription selection changes.
When user selects a eSIM subscription, Settings app informs Telephony.
Telephony needs to take actions such as writting it into global
settings, switch profiles and notify registrants, for example
AlternativeNetworkAccessService.

Bug: 120945564
Test: unittest
Change-Id: I846d9444aac368d183e06744c9eb8aa0c08dfe6a
Merged-In: I846d9444aac368d183e06744c9eb8aa0c08dfe6a
2019-02-07 17:42:34 -08:00
Michele
a10f9e82f7 Add API to check if a SIM card matches carrier restrictions.
Add API to check if one SIM card or a combination of SIM cards for
multisim devices is allowed on the terminal, based on the existing
carrier restriction rules.

Bug: 123939943
Test: added test cases for the new API
Change-Id: Ieaa3c25da75e04e2acb3b169e10638d967732f99
2019-02-07 16:02:49 -08:00
Treehugger Robot
21b38267fa Merge "Deprecate BreakIterator.getTitleInstance() functions and KIND_TITLE field" 2019-02-07 10:20:01 +00:00
Pengquan Meng
7f62bcde3d Add get/set PreferredNetworkTypeBitmap
Bug: 111453000
Test: build
Merged-In: Icbd3b2108ce8eb75e863dcf38fb8249c1e37ea91
Change-Id: Icbd3b2108ce8eb75e863dcf38fb8249c1e37ea91
2019-02-06 23:20:14 -08:00
Remi NGUYEN VAN
ca551ce981 Merge "Add API for NetworkStack to start captive portal" 2019-02-07 02:39:17 +00:00
Paul Duffin
507cbc4e58 Add TEST_MAPPING for api specifications
Changes to the various api directories will run the
tests which make use of the API specification in those directories.

Could not include CtsSystemApiSignatureTestCases as it is broken on
git_master because of bug 116632058.

Bug: 123254057
Test: atest
Change-Id: I1fe4ca498cbd0393aba7cf4c1386a6325ace7937
2019-02-06 13:57:42 +00:00
junyulai
352dc2f202 [KA04] Expose TCP socket keepalive API
The new set of API allows applications to request keepalives
offload for established TCP sockets over wifi.

However, the application must not write to or read from the
socket after calling this method, until specific callbacks are
called.

Bug: 114151147
Test: atest FrameworksNetTests FrameworksWifiTests NetworkStackTests

Change-Id: I3880505dbc35fefa34ef6c79555458ecf5d296a4
2019-02-06 22:51:42 +09:00
Remi NGUYEN VAN
6606b77247 Merge "Add Os.bind, Os.sendTo to public API" 2019-02-06 10:58:54 +00:00
Remi NGUYEN VAN
dc48356147 Add API for NetworkStack to start captive portal
Endpoints protected with INTERACT_ACROSS_USERS_FULL, such as
startActivityAsUser, should only be used by modules signed with the
platform cert. The NetworkStack needs to have the system server start
the application so this restriction can be applied.

Bug: 123846255
Test: flashed, captive portal works from primary and secondary user
Change-Id: Ib3e427b3fd03ced80c02985e795f79b096a2ec9a
2019-02-06 16:38:32 +09:00
Chalard Jean
eb1ea889bc Deprecate getActiveLinkProperties.
There are other, more idiomatic ways to do this. Deprecating this
with usage limited to P will curb usage and reduce the maintenance
load.
This also deprecates the extra EXTRA_NETWORK_TYPE, which has
survived from an old world but has only been used in deprecated
broadcasts for some time.

Bug: 109783091
Test: eyeball current.txt
Change-Id: I87b74833bb4ec362ee3fd07511a66d318c29067d
2019-02-06 15:44:44 +09:00
Tyler Gunn
d6471064e9 Merge "Add nuisance call reporting API to Telecom." 2019-02-05 21:23:15 +00:00
Nathan Harold
ef4110074e Merge "Add a Telephony Debug Surface" 2019-02-05 17:59:14 +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
Sooraj Sasindran
17ed973b1b Merge "Allow Privileged apps to read prefered data state" 2019-02-05 02:53:14 +00:00
Sooraj Sasindran
96b977f796 Allow Privileged apps to read prefered data state
Allow Privileged apps to read prefered data state
Change ArrayList to List for public API

Bug: 122900079
Bug: 123697660
Test: verified manually
Change-Id: Ib1221a65edf554b700088d68505da137ccd7de5e
2019-02-04 16:25:59 -08:00
Treehugger Robot
256640541f Merge "Use default methods for MBMS group call callbacks" 2019-02-04 23:41:33 +00:00
Nathan Harold
948195bb01 Add a Telephony Debug Surface
This commit adds a small surface to allow telephony
to generate events for an external logger to capture
and use to take action such as gathering bugreports
or proprietary logs.

The event-IDs are considered non-stable, so they may
change from release to release or device to device.

Bug: 120941729
Test: manually tested by modifying Settings. Further
      tests will require the creation of a package
      that has READ_PRIVILEGED_PHONE_STATE.
Change-Id: I6360dab2d997d518ebd5f38a72fe88801e693bb7
2019-02-04 14:34:48 -08:00
Hall Liu
3d834a0e69 Merge "Unhide isRttSupported in TelephonyManager" 2019-02-04 21:15:04 +00:00
Chen Xu
996f047394 Merge "Add NR to preferred network type combination" 2019-02-02 01:24:00 +00:00
Tyler Gunn
6e3a88a3e2 Merge "Deprecate acceptRingingCall and endCall." 2019-02-01 17:27:58 +00:00