Commit Graph

7676 Commits

Author SHA1 Message Date
Xin Li
6e7bf3337c Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:23 +00:00
Lucas Lin
957cbf397c Merge "Fix flaky test - testPartialConnectivity" am: 44190d3d18 am: e6d69c7644 am: 8e9ef8dd0f
am: d398274ef0

Change-Id: If0230281ae66caef11da31ddfa55a6cabebf756b
2019-09-05 05:39:45 -07:00
Lucas Lin
d398274ef0 Merge "Fix flaky test - testPartialConnectivity" am: 44190d3d18 am: e6d69c7644
am: 8e9ef8dd0f

Change-Id: I431756e6e52b99bbbad45f8310f718a40dd5a2b5
2019-09-05 05:32:09 -07:00
Lucas Lin
8e9ef8dd0f Merge "Fix flaky test - testPartialConnectivity" am: 44190d3d18
am: e6d69c7644

Change-Id: Ic38879fc39fda8ce84032d520f83608e10ea2dd9
2019-09-05 05:24:35 -07:00
Lucas Lin
e6d69c7644 Merge "Fix flaky test - testPartialConnectivity"
am: 44190d3d18

Change-Id: Ic643ec7a5641b531befc8a9c4af524177f97e761
2019-09-05 05:09:48 -07:00
Lucas Lin
44190d3d18 Merge "Fix flaky test - testPartialConnectivity" 2019-09-05 11:40:01 +00:00
lucaslin
a878f700d3 Fix flaky test - testPartialConnectivity
This timing issue is happened when test case already verified
NetworkMonitor#setAcceptPartialConnectivity() before
NetworkAgent send the CONNECTED state to ConnectivityService.
This test case expects that the
NetworkMonitor#setAcceptPartialConnectivity() will be invoked
when network state is CONNECTED in
ConnectivityService#updateNetworkInfo().

NetworkAgent communicates with ConnectivityService by
AsyncChannel. Before they connect to each other, the thread of
NetworkAgent is keeping idle, so waitForIdle cannot handle this
kind of case. Although they have connected to each other, but
they don't communicate with each other, waitForIdle() still
cannot handle this case. It means waitForIdle() can only handle
the case that NetworkAgent already connected to
ConnectivityService and NetworkAgent is communicating with
ConnectivityService. So, that's why waitForIdle() sometimes
doesn't work in this case, and the most simplest and right way
to fix this case is to wait the available callback then verify
the method.

Bug: 140306320
Test: atest FrameworksNetTests: \
      ConnectivityServiceTest#testPartialConnectivity \
      --generate-new-metrics 500

Change-Id: I64bfecbfe3c5776bd5c347a821f9127e79539c48
2019-09-05 11:39:20 +00:00
Remi NGUYEN VAN
e6cc28b75f Merge "Add NetIdManagerTest" am: 4339cf3402 am: 02ed6c8978 am: 68c3368934
am: e865fe0e7a

Change-Id: Id54bf8a7b8506d62b839a42dd4ddd8c30185b547
2019-09-05 00:36:57 -07:00
Remi NGUYEN VAN
e865fe0e7a Merge "Add NetIdManagerTest" am: 4339cf3402 am: 02ed6c8978
am: 68c3368934

Change-Id: Iea5c3d1ab35678edf25f103e54784ce8ab49ca12
2019-09-05 00:22:50 -07:00
Remi NGUYEN VAN
68c3368934 Merge "Add NetIdManagerTest" am: 4339cf3402
am: 02ed6c8978

Change-Id: I47250a4593af4d803942e0ac736b7c0625b6ee70
2019-09-05 00:08:58 -07:00
Remi NGUYEN VAN
02ed6c8978 Merge "Add NetIdManagerTest"
am: 4339cf3402

Change-Id: Ifbebb446601fcbbdf91fff48dc66ad173a6ecc7c
2019-09-04 23:54:58 -07:00
Remi NGUYEN VAN
f20329348e Merge "Add ConnectivityServiceIntegrationTest" am: 324d724fd7 am: 6eb1da5b5d am: 8e101b18a7
am: 7230c2fe11

Change-Id: I0fdd3bea8ff31c71e78ba37900382c02b7e4667b
2019-09-04 23:09:44 -07:00
Remi NGUYEN VAN
7230c2fe11 Merge "Add ConnectivityServiceIntegrationTest" am: 324d724fd7 am: 6eb1da5b5d
am: 8e101b18a7

Change-Id: I256ee5f6bad08b4a6ca5037a80388b478ebff266
2019-09-04 23:01:43 -07:00
Remi NGUYEN VAN
8e101b18a7 Merge "Add ConnectivityServiceIntegrationTest" am: 324d724fd7
am: 6eb1da5b5d

Change-Id: I78627992846ce9e89abe0d8a9cf512c07552e4d2
2019-09-04 22:51:15 -07:00
Remi NGUYEN VAN
6eb1da5b5d Merge "Add ConnectivityServiceIntegrationTest"
am: 324d724fd7

Change-Id: Ib82c5e5aee9e830a0efe8ea6335933237bb33856
2019-09-04 22:41:44 -07:00
Xin Li
c050adec3f DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: I9e3c4fe5406c9913d50fe3b07d7f7cef7a246b96
2019-09-04 13:33:59 -07:00
Remi NGUYEN VAN
df6248fe83 Add NetIdManagerTest
Add a simple test to verify that IDs loop correctly, that they skip used
IDs correctly, and throw when there is no remaining ID.

Test: atest com.android.server.NetIdManagerTest
Change-Id: I4c9518c725156d743286e062fd2eec1423a0459e
2019-09-04 15:57:58 +09:00
Remi NGUYEN VAN
317b2d2065 Add ConnectivityServiceIntegrationTest
This test exercises the Connectivity <-> NetworkMonitor integration.
This CL only contains a simple test (network validates), but more
generally it sets up a test package that contains both services.jar
classes and NetworkStack classes, and runs NetworkStack components in
another process (using TestNetworkStackService).

ConnectivityServiceIntegrationTest runs in the test process and binds to
TestNetworkStackService to obtain TestNetworkStackConnector and to
NetworkStackInstrumentationService to obtain
NetworkStackInstrumentationConnector. That last connector allows the
test to mock NetworkMonitor HTTP Requests.

Test: atest FrameworksNetIntegrationTests
Change-Id: Ieca18e273609044cf6b1870d2f0dba33ca7b38d3
2019-09-04 15:57:47 +09:00
Guang Zhu
fd973f97b1 Merge "Mark 3 tests as flaky." am: ff69dc29d2 am: 4154f65316 am: 224c175070
am: 5c812530ef

Change-Id: I284e445e84209f0670ee3733f13f9e12d0f33a04
2019-09-03 15:03:50 -07:00
Guang Zhu
5c812530ef Merge "Mark 3 tests as flaky." am: ff69dc29d2 am: 4154f65316
am: 224c175070

Change-Id: I1af80ae660727f7902e98680c43f03cb7668682a
2019-09-02 12:45:42 -07:00
Guang Zhu
224c175070 Merge "Mark 3 tests as flaky." am: ff69dc29d2
am: 4154f65316

Change-Id: I6e33cfdfccbea43eaf36bd6a97098de523e31d33
2019-09-02 12:21:40 -07:00
Guang Zhu
4154f65316 Merge "Mark 3 tests as flaky."
am: ff69dc29d2

Change-Id: Ie1c38e247ccfaa407d35cf6b6e28306d36cdccca
2019-09-02 12:03:12 -07:00
Treehugger Robot
ff69dc29d2 Merge "Mark 3 tests as flaky." 2019-09-02 18:44:24 +00:00
Guang Zhu
df1d1ebc2b Mark 3 tests as flaky.
Bug: 140306320
Bug: 140305589
Bug: 140305678
Test: apct/net/networking_framework_unit_test
Change-Id: I5a288d7d64b3e95e0025c2c1f4a64ffe85cc3cd6
2019-09-01 21:37:04 -07:00
Aurimas Liutikas
0b5a55734e [automerger skipped] Merge "Add missing nullability annotations." am: 61789bab0c -s ours am: 4afcf291e7 -s ours am: 3107a1eeec -s ours
am: 458fd930cb -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 8fae993514 is in history

Change-Id: I2af5416c9af0f0cda4110d1d9dc5ac8a9d880de1
2019-08-30 12:47:58 -07:00
Aurimas Liutikas
458fd930cb [automerger skipped] Merge "Add missing nullability annotations." am: 61789bab0c -s ours am: 4afcf291e7 -s ours
am: 3107a1eeec -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 8fae993514 is in history

Change-Id: If5de5ce42bdec77db69dc229a2f5c7367b28a560
2019-08-30 12:33:40 -07:00
Aurimas Liutikas
3107a1eeec [automerger skipped] Merge "Add missing nullability annotations." am: 61789bab0c -s ours
am: 4afcf291e7 -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 8fae993514 is in history

Change-Id: I729acc32ce9625df646bf0a820f9f4d95a9d60cf
2019-08-30 12:08:42 -07:00
Aurimas Liutikas
4afcf291e7 [automerger skipped] Merge "Add missing nullability annotations."
am: 61789bab0c -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 8fae993514 is in history

Change-Id: I7b2712e4ab3635f94f8257d88f24c20bc68a3ac0
2019-08-30 11:49:09 -07:00
Aurimas Liutikas
61789bab0c Merge "Add missing nullability annotations." 2019-08-30 18:30:39 +00:00
Paul Hu
6950f29ce0 Merge "Fix flaky testTcpBufferReset" am: 09b6f14675 am: 522aa587b4 am: 14792361e1
am: be9cb6dd88

Change-Id: I807107d076835032a7eb2684c362f773688c6a92
2019-08-30 09:56:44 -07:00
Paul Hu
be9cb6dd88 Merge "Fix flaky testTcpBufferReset" am: 09b6f14675 am: 522aa587b4
am: 14792361e1

Change-Id: I1bc614bda266be290dc5f85e5bd2b84368afd6f0
2019-08-30 09:39:44 -07:00
Paul Hu
14792361e1 Merge "Fix flaky testTcpBufferReset" am: 09b6f14675
am: 522aa587b4

Change-Id: I08452036ddfc3bc7f155c9fa0247288197f2e3ae
2019-08-30 09:30:51 -07:00
Paul Hu
522aa587b4 Merge "Fix flaky testTcpBufferReset"
am: 09b6f14675

Change-Id: Ia344cb1a8c0be07a62eac98117911b6cdb329525
2019-08-30 09:19:42 -07:00
Paul Hu
09b6f14675 Merge "Fix flaky testTcpBufferReset" 2019-08-30 16:01:45 +00:00
junyulai
c5cabe0545 Merge "Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN" am: c07aed0fd4 am: bfa8b89ed1 am: 2ffc7b4c01
am: 992209592b

Change-Id: I6b9f7942a456fdf790be2961e5b154be49df3121
2019-08-30 08:58:39 -07:00
Aurimas Liutikas
b812d40d37 Merge "Add missing nullability annotations." into stage-aosp-master am: 9fe20bf048 am: 1224bc8ec2
am: 260b360174

Change-Id: I60c55b6706e8d43121e8b2c7a35efff38668f66b
2019-08-30 08:54:38 -07:00
junyulai
992209592b Merge "Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN" am: c07aed0fd4 am: bfa8b89ed1
am: 2ffc7b4c01

Change-Id: Idb5a89d644cedfda1f0e057dab6ee5d44726903a
2019-08-30 08:48:46 -07:00
Aurimas Liutikas
260b360174 Merge "Add missing nullability annotations." into stage-aosp-master am: 9fe20bf048
am: 1224bc8ec2

Change-Id: I202951d51820be47b9195734601830553215bdd7
2019-08-30 08:43:01 -07:00
junyulai
2ffc7b4c01 Merge "Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN" am: c07aed0fd4
am: bfa8b89ed1

Change-Id: Ia5bcd39c177c650a4e0174fc69d5078bc12b9e4c
2019-08-30 08:40:14 -07:00
Aurimas Liutikas
1224bc8ec2 Merge "Add missing nullability annotations." into stage-aosp-master
am: 9fe20bf048

Change-Id: Ic9ea2b9840fbb678bbb6ab77038415581feba918
2019-08-30 08:35:52 -07:00
junyulai
bfa8b89ed1 Merge "Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN"
am: c07aed0fd4

Change-Id: If5b3f6f1d397d3ac35b509a2e634a60933f2df6c
2019-08-30 08:30:10 -07:00
Aurimas Liutikas
9fe20bf048 Merge "Add missing nullability annotations." into stage-aosp-master 2019-08-30 15:19:45 +00:00
paulhu
22e2195a8a Fix flaky testTcpBufferReset
If EVENT_NETWORK_INFO_CHANGED was handled after waitForIdle()
method done, this test will be failed due to
INetd#setTcpRWmemorySize() was not executed yet. Instead of
waiting for idle state, it's better to use NetworkCallback to
ensure events completely on ConnectivityService.

Bug: 140206578
Test: atest ConnectivityServiceTest#testTcpBufferReset\
      --generate-new-metrics 500

Change-Id: Iad77415db38038603881d9ebe0e37586b549a45c
2019-08-30 20:21:03 +08:00
junyulai
0c27ddf71b Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN
When resetting legacy Always-On VPN, the intent is handled by
main thread. And it will also initialize VPN shutdown process,
which will cause networkInfo changed event on
ConnectivityService internal thread. These two events need to
hold their corresponding lock and ask for the other one, which
causes the deadlock.

This patch move the event handling to the same thread to prevent
such deadlock, and cleanup some unused variables.

Change-Id: I5b656c0d0381acb4e33409a11f502db9b180296c
Fix: 139122208
Test: atest FrameworksNetTests, manual test
2019-08-30 19:56:59 +08:00
Remi NGUYEN VAN
f12ae468ae Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f am: 904ee8f635 am: 11e0de0f30
am: 33d70e8fbd

Change-Id: I8ada7ccf94e0ade83c0d810daba9703da60a6f59
2019-08-30 04:05:18 -07:00
Remi NGUYEN VAN
33d70e8fbd Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f am: 904ee8f635
am: 11e0de0f30

Change-Id: I12d7b8fca85502807288bba03417f2ceb0c9f533
2019-08-30 03:53:46 -07:00
Remi NGUYEN VAN
11e0de0f30 Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f
am: 904ee8f635

Change-Id: I288994ccfdd044453aa818681745b8e69881264a
2019-08-30 03:47:09 -07:00
Remi NGUYEN VAN
904ee8f635 Merge "Run callbacks on ConnectivityService thread"
am: 08e1dae42f

Change-Id: I7a8d035ec7453c5351eb2646c631c19964cb0f88
2019-08-30 03:36:26 -07:00
Treehugger Robot
08e1dae42f Merge "Run callbacks on ConnectivityService thread" 2019-08-30 10:18:28 +00:00
Aurimas Liutikas
07be422126 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:16:24 +00:00