Commit Graph

5868 Commits

Author SHA1 Message Date
Ian Kasprzak
ead65bd578 Merge "Temporarily disable flaky test."
am: 89351e03ed

Change-Id: Ie482f459c2f8bce40098657daa39efccfdf2bcd3
2019-03-12 21:38:43 -07:00
Xiao Ma
f4b7872afa Merge "[KA13]: add unit test for exposed TCP socket keepalive API."
am: 87b73b01df

Change-Id: I79fb97913e8b69c525733dcaec59a60ac6b980b6
2019-03-12 21:29:48 -07:00
Benedict Wong
493e04b932 Integrate testNetworkService and Manager with Connectivity stack
This change adds TestAPIs for tests to retrive an instance of
ConnectivityManager, allowing it to build test TUN interfaces, as well
as test networks.

This also integrates the TestNetwork types with ConnectivityManager,
creating virtual networks if the network agent is a test agent.

Bug: 72950854
Test: Compiles, CTS tests using this passing correctly
Change-Id: Ic1a04aa66014d1c66a74e65dbace3218437403ae
Merged-In: I741ef9cdf4bd4125d9129af3a030edf32f438e4f
2019-03-13 02:26:30 +00:00
Chalard Jean
11230da789 Merge "Tell the factory it is already serving a request." 2019-03-13 02:07:29 +00:00
Ian Kasprzak
89351e03ed Merge "Temporarily disable flaky test." 2019-03-13 01:52:21 +00:00
Xiao Ma
87b73b01df Merge "[KA13]: add unit test for exposed TCP socket keepalive API." 2019-03-13 01:13:08 +00:00
Lorenzo Colitti
321475fe7e Temporarily disable flaky test.
Test: None
Bug: 128426024
Change-Id: Id88bf452f41f512703d5831e357d9ba72dc5b911
2019-03-13 09:23:54 +09:00
Jeremy Klein
7e7c742ad7 Rename entitlement callback to adhere to API guidelines.
The method for OnTetheringEntitlementResultListener needs to be
onTetheringEntitlementResult in order to meet our API guidelines:

"Use Listener when there is a single callback method and there will
never be any others. It should be an interface whose name is the same
as the callback method plus Listener."

Bug: 126392011
Change-Id: I9a883765541ae853c4eb3bd52c9d93a7af16e661
Test: Manual build
2019-03-12 13:36:21 -07:00
Chalard Jean
29d06db64b Tell the factory it is already serving a request.
This is a cherry-pick of ag/607226 that has been rebased on
top of four years of changes and with comments addressed.

Gives each factory a serial number and propagates it to every
NetworkAgent so when a score comes back indicating a request is
being handled the factory can account for it properly.

Without this, a new request that's already handled by a network
offered by a factory will not cause an increment of the factorys
ref count. Concretely this results in issues like the RAT icon
not being displayed in spite of the network actually being up
and usable.

This will be ported to AOSP as soon as possible, but immediately
some master-only WiFi tests need to be adjusted with this change
which would not let me submit to AOSP.

Bug: 18637384
Bug: 29030667
Test: manual
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks-net
Test: atest CtsNetTestCases CtsHostsideNetworkTests
Change-Id: I597ac588f76dd507512ff02868fd1310b7e63f7e
Merged-In: I597ac588f76dd507512ff02868fd1310b7e63f7e
2019-03-12 21:47:21 +09:00
Chalard Jean
821d197ce6 Merge "[CS] Support "instant failure" from factories"
am: dce527fbd6

Change-Id: I0c5f2823763857edfc5095686345c764d9be12e1
2019-03-12 05:25:48 -07:00
Chalard Jean
dce527fbd6 Merge "[CS] Support "instant failure" from factories" 2019-03-12 12:04:46 +00:00
Xiao Ma
fcd1ab6aaf [KA13]: add unit test for exposed TCP socket keepalive API.
Bug: 123987272
Test: atest FrameworksNetTests
Change-Id: I543d8f00ae539b706592a149981e3e8992999284
2019-03-12 17:30:47 +09:00
Lucas Lin
0ea87a4edb Merge "Check if network has partial connectivity"
am: 2d3cc4577a

Change-Id: I3e94029fe067a1a22acc640a0df6a87720572b94
2019-03-12 01:28:50 -07:00
Lucas Lin
2d3cc4577a Merge "Check if network has partial connectivity" 2019-03-12 08:11:14 +00:00
lucaslin
2240ef679d Check if network has partial connectivity
In some networks, network validation may only get success
result for http probe but fail result for https probe.
For this kind of network, it may still work at some websites
or apps, but user didn't know about that. In order to fix this
issue, we will check if network has partial connectivity and
notify user to make a choice if they want to use this partial
connectivity or not.

Bug: 113450764
Test: 1. Build pass.
      2. Fake partial connectivity case for testing.
      3. atest FrameworksNetTests
      4. atest NetworkStackTests

Change-Id: I69ed00ac4850904ff708c9fef22e148879a10e92
2019-03-12 07:37:33 +00:00
Junyu Lai
4a91c73e67 Merge "Improve keepalive offload documentation and error handling"
am: a0b880c9e8

Change-Id: Ia87def27904309d405c39607326a77133632461d
2019-03-11 22:21:27 -07:00
Junyu Lai
a0b880c9e8 Merge "Improve keepalive offload documentation and error handling" 2019-03-12 05:11:50 +00:00
Etan Cohen
fbfdd84e7c [CS] Support "instant failure" from factories
Add a mechanism by which a factory can declare "instant failure" for
a request - which would result in it getting an OnUnavailable()
(even without a timeout).

Factories may only do this iff:
1. They know they are the only factory which may fulfill this
   request (common for transport-specific requests).
2. The know that the request can definitely not be
   fulfilled at any point in the future.

Bug: 31382922
Test: atest ConnectivityServiceTest
Merged-In: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
Change-Id: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
2019-03-11 16:15:43 -07:00
Chalard Jean
90fcaac205 Merge "Add tethering event callback API"
am: 80c8a33c95

Change-Id: Ie38a521abf09e0eb530173508b14aa2acdb9267c
2019-03-11 10:26:28 -07:00
Chalard Jean
80c8a33c95 Merge "Add tethering event callback API" 2019-03-11 17:04:57 +00:00
Chalard Jean
407b351d68 Merge "[PT17.5] Revert to booleans for send/not send broadcast constants."
am: 4e9a6e4c53

Change-Id: Ib8b991ce89fb94d7f0f8b865a1909f73b0b5be0d
2019-03-11 04:21:36 -07:00
Treehugger Robot
4e9a6e4c53 Merge "[PT17.5] Revert to booleans for send/not send broadcast constants." 2019-03-11 11:07:21 +00:00
Chalard Jean
2a67906ec5 [PT17.5] Revert to booleans for send/not send broadcast constants.
In PT17, for security of the patch these two constants have been
switched from boolean to enum values. While this is nice for making
sure a patch is correct, it's also pretty wasteful. Now that it's
certain that the values of these fields don't matter, they can be
set to logical values (as opposed to reversed as it was the case
before PT17.

Test: runtest
Change-Id: I93a0780e23c2f658687be066dc16f27529baaa86
2019-03-11 15:58:31 +09:00
Sasha Smundak
76cc41871e Merge "Convert tests/**/Android.mk files to Android.bp"
am: ef59cd5d8b

Change-Id: If96014624542d6c99f7d0841347806954dbd4a42
2019-03-08 15:20:09 -08:00
Treehugger Robot
ef59cd5d8b Merge "Convert tests/**/Android.mk files to Android.bp" 2019-03-08 22:54:11 +00:00
markchien
4ef53e8819 Add tethering event callback API
Provide OnTetheringEventCallback for system app to know
tethering's upstream.

Bug: 125583822
Test: -build, flash, boot
      -atest FrameworksNetTests

Change-Id: I7ca81b27c9b805cc01884509f5b20d9d0a24cd36
Merged-in: I7ca81b27c9b805cc01884509f5b20d9d0a24cd36
2019-03-09 00:35:55 +08:00
Luke Huang
39c58a32d3 Merge "Minor changes to the async DNS query JAVA API"
am: 06ef4a5bc4

Change-Id: I96e9325c7dd5396f48b25919a104be55fb9b6346
2019-03-08 06:51:48 -08:00
Benedict Wong
3feec059fa Merge changes Ie66ba631,Ic42c09a3
am: 6525e97ea5

Change-Id: I5c8a3364f0244c5945be2bbe919aac2dcc4eba66
2019-03-08 06:35:04 -08:00
Luke Huang
06ef4a5bc4 Merge "Minor changes to the async DNS query JAVA API" 2019-03-08 03:19:55 +00:00
Sasha Smundak
2e39455210 Convert tests/**/Android.mk files to Android.bp
See build/soong/README.md for more information.

Note: tests/ImfTest/Android.mk causes conflict as it hasn't been yet
ported to internal master. Do it later.
Note: the conversion in the following directories has to be done in the
internal master first because of the conflicts:
* tests/ActivityManagerPerfTests
* tests/AppLaunch
* tests/AppLaunchWear
* tests/BackgroundDexOptServiceIntegrationTests
* tests/Camera2Tests/CameraToo
* tests/Camera2Tests/SmartCamera/SimpleCamera
* tests/Compatibility
* tests/Internal
* tests/RcsTests
* tests/ServiceCrashTest
* tests/UsbTests

Bug: 122332340
Test: treehugger
Change-Id: Ie17590c6a96aee5caa80d38092a3de5c1b6efe8d
2019-03-07 16:14:00 -08:00
Benedict Wong
6525e97ea5 Merge changes Ie66ba631,Ic42c09a3
* changes:
  Implement TestNetworkService
  Add shell TestNetworkManager and Service
2019-03-07 23:32:55 +00:00
Mark Chien
71894fbf14 Merge "Fix TetheringEntitlementValueListener related API"
am: cdfb2b941d

Change-Id: Idd3a7110c32319b610d5dacad7e3632d759ac887
2019-03-07 05:32:33 -08:00
Mark Chien
cdfb2b941d Merge "Fix TetheringEntitlementValueListener related API" 2019-03-07 13:21:53 +00:00
Luke Huang
1244835690 Minor changes to the async DNS query JAVA API
1. refine the naming in DnsPacket and add more comment
2. add comment in DnsResolver

Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Ib482d079d6823fd1d9bff163427b7aad38374199
2019-03-07 16:40:49 +08:00
junyulai
97767bf71c Improve keepalive offload documentation and error handling
Bug: 123987401
Test: atest FrameworksNetTests
Change-Id: Id651cfb743f02b05ca3845af3c393eaf5762bb20
2019-03-07 16:01:30 +08:00
Brett Chabot
29e6ab8d01 Merge "Migrate frameworks/base/tests/net/ to androidx.test"
am: e69a7a1554

Change-Id: Ic6783d55ba6e6a4009569952b542b2a5a42501fe
2019-03-06 21:51:50 -08:00
Treehugger Robot
e69a7a1554 Merge "Migrate frameworks/base/tests/net/ to androidx.test" 2019-03-07 05:42:07 +00:00
markchien
bf5ab01869 Fix TetheringEntitlementValueListener related API
Test: -build, flash, boot
      -atest FrameworksNetTests
bug: 126701557
bug: 126392011

Change-Id: I6dda10fbfe8ffaef71269617750a22563396f5ea
2019-03-07 13:33:21 +08:00
Benedict Wong
2ffe4b8998 Implement TestNetworkService
This change adds the relevant JNI implementations, as well as the
implementations and NetworkAgent tracking code in the TestNetworkService.

TestNetworkService (And Manager) is designed for use exclusively in
testing code, allowing for the creation of TUN and IPsec backed networks
in test code. Specifically, this allows for testing of components such
as IP, DHCP, or DNS clients, as well as kernel features such as IPsec.

Access to the TestNetworkService will be conditioned upon the
MANAGE_TEST_NETWORKS permission that will be granted only to the Shell.
CTS will use UiAutomation.adoptShellPermissionIdentity() to gain the
ability to use this service.

Bug: 72950854
Test: CTS tests passing
Change-Id: Ie66ba631a548b5f9c6b5ed0797582f86688debe5
2019-03-06 15:37:52 -08:00
Andrei-Valentin Onea
1504da0942 Merge "Add @UnsupportedAppUsage annotations"
am: 7e3ccaa77a

Change-Id: Ib760897a2d3de2672b4f19d66e238ebee9bfb239
2019-03-06 09:41:34 -08:00
Andrei-Valentin Onea
7e3ccaa77a Merge "Add @UnsupportedAppUsage annotations" 2019-03-06 17:18:05 +00:00
Brett Chabot
147f6cf341 Migrate frameworks/base/tests/net/ to androidx.test
Test: atest FrameworksNetTests
Change-Id: Iaa59d606f5e1678cc5aaca9ed37e184fad894e5d
2019-03-05 09:05:47 -08:00
Varun Anand
cb011b799f Merge "Fix isActiveNetworkMetered for VPNs."
am: 8cf699851a

Change-Id: Ic219c083dffa426a8c6f548ff6a3f4b5c2555217
2019-03-04 17:50:43 -08:00
Varun Anand
8cf699851a Merge "Fix isActiveNetworkMetered for VPNs." 2019-03-05 01:37:30 +00:00
Amit Mahajan
65bde4b9a0 Merge "Adding new APN type for Mission Critical Services."
am: a32315e69a

Change-Id: I4ae43791c9444f792d69e27b76a5bf57f8dfb4c8
2019-03-04 10:43:30 -08:00
Amit Mahajan
a32315e69a Merge "Adding new APN type for Mission Critical Services." 2019-03-04 18:23:30 +00:00
Mark Chien
06477f2f37 Merge "Return not supported if no necessary socket option"
am: acb289f34e

Change-Id: I592d08040459e544a53861b4e8a0ee49a50f225b
2019-03-04 01:28:12 -08:00
Mark Chien
acb289f34e Merge "Return not supported if no necessary socket option" 2019-03-04 09:16:07 +00:00
Jack Yu
75d5f94bb5 Merge "Fixed all APIs not meeting API review requirement"
am: 37cde6b81d

Change-Id: I84c1b55e99bf89c818c365f4954d9e3921904636
2019-03-02 20:40:56 -08:00
Treehugger Robot
37cde6b81d Merge "Fixed all APIs not meeting API review requirement" 2019-03-03 04:27:32 +00:00