Commit Graph

1295 Commits

Author SHA1 Message Date
Etan Cohen
43c1536c6b Merge "[CM] Fix NPE due to unvalidated callback value" 2019-05-22 13:53:31 +00:00
Lorenzo Colitti
91ddb23d66 Merge "Properly use versioned interfaces." am: 9572afce76
am: b92fbe0435

Change-Id: Idf49e840263ef32b9ee4fafa6718d4f893ea7c87
2019-05-22 01:20:45 -07:00
Etan Cohen
b58e366f2d [CM] Fix NPE due to unvalidated callback value
When unregistering callback due to ON_UNAVAILABLE did not check for
a non-null callback.

Bug: 132950880
Test: atest ConnectivityServiceTest
Change-Id: I8f3322963f322e6690f1403681bf66e8b38b35f8
2019-05-22 04:56:09 +00:00
Lorenzo Colitti
4b56771878 Properly use versioned interfaces.
Our stable AIDL interfaces need to use versioned build targets,
otherwise getVersion will always return 0, which makes it
impossible to support different components at different versions.

List generated with:
find . -name Android.bp -exec egrep \
    -H "(netd|dnsresolver|ipmemorystore|networkstack).aidl.interface(s?)-(java|cpp)" {} \;

Bug: 133124190
Test: m
Change-Id: Id175c99daa77507847673777a8dcce51897ab17b
2019-05-22 03:12:59 +00:00
Ian Kasprzak
db10850966 Reland: Add FrameworksNetTests dependency on libcgrouprc
Original CL description:
Add FrameworksNetTests dependency on libcgrouprc

The tests are currently broken without this dependency.

Bug: 132925169
Test: atest FrameworksNetTests
Change-Id: I473b250587d871158e1e9595d56183a0342238d8
Merged-In: If9c8aa41c4e96a79b71c88f199a4f3b0483e31cd
2019-05-17 17:11:16 +09:00
Paul Hu
b725fc0059 Merge "Ignore NetworkTest when running CtsNetTestCases in instant app mode" into qt-dev 2019-05-17 06:46:36 +00:00
Xiao Ma
30dfd6ecfa Clean up the arguments annotation and verify items on IpMemoryStoreTest.
Bug: 131133347
Test: atest FrameworksNetTests

Merged-In: I8ce3bed435fbbb814d71fe48ffd305ff3f947f3f
Merged-In: I1db13a48b59d743482436ecf8a20d7f12edd6e1c
(cherry picked from commit 7567c4ac50508c2bcd38b37fc48b299912a34cf5)

Change-Id: I78024c0e25d812639d1236faa59d383742ae2141
2019-05-15 14:53:42 +00:00
Paul Hu
5688ce39c4 Ignore NetworkTest when running CtsNetTestCases in instant app mode
Ignore NetworkTest#testBindSocketOfConnectedDatagramSocketThrows
when running CtsNetTestCases in instant app mode due to sockect
cannot bind in instant app mode.

Bug: 123366918
Test: atest CtsNetTestCases --instant
Test: atest FrameworksNetTests

Change-Id: I1e93d4491e3d9e5a095ff4b6169b2f70e7b3b690
Merged-In: Ia28eea113e19b9c44998677e5b8093be178a06a3
Merged-In: I1e93d4491e3d9e5a095ff4b6169b2f70e7b3b690
(cherry picked from commit 73c0d48b14488c93b2f42a1e149e4be8499d3469)
2019-05-15 06:58:27 +00:00
Paul Hu
bea628fb59 Merge "Ignore NetworkTest when running CtsNetTestCases in instant app mode" am: a00c638ebe
am: a582a82795

Change-Id: Ia28eea113e19b9c44998677e5b8093be178a06a3
2019-05-14 21:35:43 -07:00
Paul Hu
a582a82795 Merge "Ignore NetworkTest when running CtsNetTestCases in instant app mode"
am: a00c638ebe

Change-Id: I670b9847a2e3b3b794ee4694a0838440cabdc39f
2019-05-14 21:17:33 -07:00
Paul Hu
a00c638ebe Merge "Ignore NetworkTest when running CtsNetTestCases in instant app mode" 2019-05-15 03:42:32 +00:00
Chenbo Feng
2bebfc2b87 Clean up the permission control code in framework
Delete the unused NetworkManagementService API for set/remove
permissions. Use PERMISSION_NONE to replace NO_PERMISSIONS so the
framework now use the same set of permission constant when communicate
with netd.

Bug: 128944261
Test: PermissionMonitorTest.java

Change-Id: I25224c9576f52d2a0a0bd2182325c7aac7b28eb5
Merged-In: I25224c9576f52d2a0a0bd2182325c7aac7b28eb5
(cherry picked from commit 05887f99c6ca6885db737af2f356023dc6de80a2)
2019-05-13 14:22:58 -07:00
Chenbo Feng
9313f7adf9 Merge "Clean up the permission control code in framework" am: 0e6d2b5f4f
am: 6cb0c1579d

Change-Id: I1af059171c5d80be7abaee636f012f3b55dac2df
2019-05-13 11:32:59 -07:00
Chenbo Feng
6cb0c1579d Merge "Clean up the permission control code in framework"
am: 0e6d2b5f4f

Change-Id: Iff2316f72df4cff56829b281882dc920d63937bd
2019-05-13 11:20:31 -07:00
Treehugger Robot
0e6d2b5f4f Merge "Clean up the permission control code in framework" 2019-05-13 18:04:50 +00:00
Junyu Lai
5e135ee2b9 Release keepalive slot after stopped
Currntly, keepalive slot is released when stop() is called. Next
starting keepalive can use the same slot number while previous
keepalive is still stopping. When the previous keepalive is
stopped, the incoming as will be processed by the new keepalive.

This change release keepalive slot after the result of stopping
has returned. Thus, newly created keepalive cannot allocate the
same slot number while lower layer is still processing stop event.

This change also disable flaky assertions that are caused by
test port has been occupied by other process.

Bug: 129512753
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
      2. atest FrameworksNetTests --generate-new-metrics 10
      3. simulate the fail case manually.

Change-Id: I790f6bbc5efc3f088034ac45ec379da5f781d0ca
Merged-In: I1991627545519ee5cb408a3df3a006f710f4af7b
(cherry picked from commit 3523a3d02a1f88a3990ab9cc4948c705ecc713c8)
2019-05-13 18:42:19 +08:00
junyulai
ec4eb8f448 Support customization of supported keepalive count per transport
This change specifies the required minimum supported keepalives
in SDK, and allows OEMs to customize supported keepalive count
per network through resource overlay.

Bug: 129371366
Test: 1. m -j doc-comment-check-docs
      2. atest FrameworksNetTests

Clean cherry-pick of aosp/946359

Change-Id: I06840834d0ee8121358bf4829fe47ecf9964d395
Merged-In: I0218f3674628c13ead63fc9a873895ba7f113033
Merged-In: Ia667386c1a8949839871a6949d79552d9c8b88f0
2019-05-13 15:52:07 +09:00
TreeHugger Robot
1140cb3dbb Merge "Add CTS API coverage for APIs which are used by NetworkStack" into qt-dev 2019-05-13 02:41:34 +00:00
TreeHugger Robot
4506469d8e Merge "Add ApfCapabilities common test cases" into qt-dev 2019-05-13 02:28:03 +00:00
Paul Hu
9a5d592793 Add ApfCapabilities common test cases
Bug: 129199900
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass

Change-Id: I737ab11ccd1bf6f92bae4eae21e67d4d6f86a758
Merged-In: Icfd80943212430b2a0e6a4b55f53270cbc3d1693
Merged-In: I737ab11ccd1bf6f92bae4eae21e67d4d6f86a758
(cherry picked from commit ce54fa5cb392c38bfec62b81664fcc25098eb9dc)
2019-05-13 01:19:00 +00:00
Paul Hu
cd36ebcfcd Add LinkProperties common test cases
Bug: 129198747
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass

Change-Id: I03d162ea3c5bc2ccb8f913bbfdf85ebcd194c35a
Merged-In: I8d36177cbf4f39da602331e091a60a40f6eaea33
Merged-In: I03d162ea3c5bc2ccb8f913bbfdf85ebcd194c35a
(cherry picked from commit 385757291c2e822f1338157a2368e319d4048c89)
2019-05-13 01:17:06 +00:00
Paul Hu
3f11892c07 Merge "Add ApfCapabilities common test cases" am: cc8d6dd0bb
am: f8f19beda6

Change-Id: Icfd80943212430b2a0e6a4b55f53270cbc3d1693
2019-05-12 10:26:45 -07:00
Paul Hu
f8f19beda6 Merge "Add ApfCapabilities common test cases"
am: cc8d6dd0bb

Change-Id: Iafcc1bad3e4d5a6bd574231ccf79b0e775617ae2
2019-05-12 10:15:31 -07:00
Paul Hu
cc8d6dd0bb Merge "Add ApfCapabilities common test cases" 2019-05-12 16:57:18 +00:00
Ian Kasprzak
7617ca1b96 Reland: Add FrameworksNetTests dependency on libcgrouprc
Bug: 132435820
Bug: 132437254

Original CL description:
Add FrameworksNetTests dependency on libcgrouprc

The tests are currently broken without this dependency.

Bug: 129902619
Test: atest FrameworksNetTests
Merged-In: I85891485157ed86e069039dfe3092028ff703dd5
Change-Id: I7daf6bdf8a9f8836d17746e1e352f8f75cd34adc
2019-05-10 12:08:44 -07:00
Xiao Ma
992b7f79a7 Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." am: 3bee1cdc4e
am: 82a7e510a5

Change-Id: I1db13a48b59d743482436ecf8a20d7f12edd6e1c
2019-05-10 08:45:30 -07:00
Xiao Ma
3bee1cdc4e Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." 2019-05-10 15:16:33 +00:00
Chalard Jean
9ff61e4948 Support strict mode private DNS on VPNs that provide Internet.
Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Bug: 122652057
Test: atest FrameworksNetTests NetworkStackTests
Test: manually ran a VPN with private DNS in strict mode
atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
(cherry picked from commit 414b8c8b1ce8ae2ad6ef95c1ffba19062077d3e6)
2019-05-10 13:09:00 +00:00
Chalard Jean
c455822846 Merge "Support strict mode private DNS on VPNs that provide Internet." am: 9db77747a6
am: e3950cf24a

Change-Id: I28cc679def7cdd4dc5187e65f4524c3998ebcafc
2019-05-10 04:33:43 -07:00
Chalard Jean
9db77747a6 Merge "Support strict mode private DNS on VPNs that provide Internet." 2019-05-10 09:39:17 +00:00
Paul Hu
612724480f Merge "Add LinkProperties common test cases" am: 78415c34f4
am: 5574b26c8e

Change-Id: I8d36177cbf4f39da602331e091a60a40f6eaea33
2019-05-10 02:20:04 -07:00
Junyu Lai
04a972ec05 Merge changes Ibcb91105,I0218f367 am: 6a5c545890
am: 278e66a401

Change-Id: Ia667386c1a8949839871a6949d79552d9c8b88f0
2019-05-10 02:13:34 -07:00
paulhu
73f8eca8ad Add ApfCapabilities common test cases
Bug: 129199900
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Change-Id: I0c2aeaa1451e1f07edb0d0f8529e42e6fa107a6d
2019-05-10 16:03:42 +08:00
Xiao Ma
103a7ce029 Clean up the arguments annotation and verify items on IpMemoryStoreTest.
Bug: 131133347
Test: atest FrameworksNetTests
Change-Id: I371e7b637ab1c2671f0378508b06adff174f024d
2019-05-10 15:42:33 +09:00
Junyu Lai
1e518579a8 Merge changes Ibff278a6,If6d537a3 am: 5cb924da73
am: 6c6580aa4f

Change-Id: Ic51f3b32375378ff74bdd54d1f36569b277fc80f
2019-05-09 23:30:19 -07:00
Paul Hu
78415c34f4 Merge "Add LinkProperties common test cases" 2019-05-10 05:55:11 +00:00
Junyu Lai
6a5c545890 Merge changes Ibcb91105,I0218f367
* changes:
  Limit unprivileged keepalives per uid
  Support customization of supported keepalive count per transport
2019-05-10 05:47:23 +00:00
Lorenzo Colitti
2fca7e3cb3 Support strict mode private DNS on VPNs that provide Internet.
Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Bug: 122652057
Test: atest FrameworksNetTests NetworkStackTests
Test: manually ran a VPN with private DNS in strict mode
atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
2019-05-10 14:30:54 +09:00
Treehugger Robot
5cb924da73 Merge changes Ibff278a6,If6d537a3
* changes:
  Revert "Add NATT keepalive resources and methods into IpSecService"
  Revert "[KA11] Verify fd ownership and allocate resource for NattKeepalive"
2019-05-10 01:42:26 +00:00
Xiao Ma
015598ea52 adopt non-blocking method to obtain the IpMemoryStore service.
Bug: 131133347
Test: atest FrameworksNetTests
Merged-In: I7de4f23370bdf9c9df5e74ed074c794080d93d95
Merged-In: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
(cherry picked from commit c4e4fd7beeda36c84548c7bb4a16312f20bdf188)
2019-05-10 00:55:14 +00:00
Xin Li
b4da895ce0 Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:45 +00:00
Junyu Lai
b4864e6c40 Revert "Add NATT keepalive resources and methods into IpSecService"
This reverts commit bdf7048571.

Reason for revert: Adds dependency between IpSecService and
                   ConnectivityService may lead to future deadlock
		   problems. Uses a simpler approach instead,
		   hence the solution is not needed.
		   See aosp/954040.

Change-Id: Ibff278a6eee666cd85dba81c2bed94d568679b02
2019-05-10 00:58:18 +08:00
junyulai
4dca18aa31 Support customization of supported keepalive count per transport
This change specifies the required minimum supported keepalives
in SDK, and allows OEMs to customize supported keepalive count
per network through resource overlay.

Bug: 129371366
Test: 1. m -j doc-comment-check-docs
      2. atest FrameworksNetTests

Change-Id: I0218f3674628c13ead63fc9a873895ba7f113033
2019-05-10 00:36:58 +08:00
Xiao Ma
42f6be8b40 Merge "adopt non-blocking method to obtain the IpMemoryStore service." am: 14b9e8b6d8
am: 042800ead0

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
2019-05-09 04:55:13 -07:00
Xiao Ma
042800ead0 Merge "adopt non-blocking method to obtain the IpMemoryStore service."
am: 14b9e8b6d8

Change-Id: Idd6110141795f86dcf28eafab87683eda4c70b93
2019-05-09 04:43:33 -07:00
Xiao Ma
14b9e8b6d8 Merge "adopt non-blocking method to obtain the IpMemoryStore service." 2019-05-09 11:30:56 +00:00
Lorenzo Colitti
80045d35e7 Merge "[CS] Unregister callback as part of onUnavailable dispatch" into qt-dev 2019-05-09 09:42:38 +00:00
paulhu
9f7636c722 Add LinkProperties common test cases
Bug: 129198747
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Change-Id: I15b8dbd060c313d0f2be89fed4518c18b3196d38
2019-05-09 15:49:00 +08:00
Etan Cohen
abc0036a8b Merge "[CS] Unregister callback as part of onUnavailable dispatch" am: e2ba92c411
am: 477211720f

Change-Id: Ida684c441e7aaedce9a29da071ef5a68403d08b3
2019-05-08 22:42:55 -07:00
Etan Cohen
477211720f Merge "[CS] Unregister callback as part of onUnavailable dispatch"
am: e2ba92c411

Change-Id: I14d3c0f6c606020bd1d1e756174a66ee933cb15f
2019-05-08 22:13:00 -07:00