Commit Graph

7112 Commits

Author SHA1 Message Date
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
Lorenzo Colitti
538c643533 [automerger skipped] Merge "Clean up the permission control code in framework" into qt-dev
am: 4f47f2c827 -s ours
am skip reason: change_id I25224c9576f52d2a0a0bd2182325c7aac7b28eb5 with SHA1 2bebfc2b87 is in history

Change-Id: Ia49181982198f2074a11afc881a047f86263699b
2019-05-14 23:49:27 -07:00
Chenbo Feng
7a8e7fc512 [automerger skipped] Clean up the permission control code in framework
am: 2bebfc2b87 -s ours
am skip reason: change_id I25224c9576f52d2a0a0bd2182325c7aac7b28eb5 with SHA1 4737299d94 is in history

Change-Id: If4d60807fd1cc312393bf56830f09bddeff7b59f
2019-05-14 23:43:03 -07:00
Lorenzo Colitti
4f47f2c827 Merge "Clean up the permission control code in framework" into qt-dev 2019-05-15 06:26:52 +00:00
Paul Hu
399f297121 [automerger skipped] Merge "Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission" into qt-dev
am: 53e2a9b0ae -s ours
am skip reason: change_id I1025da29beb53259f57bd9ca5648b32f2847ed4a with SHA1 a4980fc1fd is in history

Change-Id: I0fd395b418475c6b9d8ac7dbd363d43e437d2203
2019-05-14 21:51:21 -07: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
Paul Hu
49ea93861d Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission
Caller should get SecurityException if called
ConnectivityManager#startCaptivePortalApp() w/o
MAINLINE_NETWORK_STACK permission. But now it will not get any
exception and can launch captive portal app successfully.

Bug: 132662433
Test: atest android.net.cts.ConnectivityManagerTest#testStartCaptivePortalApp
      w and w/o MAINLINE_NETWORK_STACK permission
Test: atest FrameworksNetTests NetworkStackTests

Change-Id: Ib70fe6fad107f3e9dce9ce673188c5ce5dc1ad7b
Merged-In: I1025da29beb53259f57bd9ca5648b32f2847ed4a
Merged-In: Ib70fe6fad107f3e9dce9ce673188c5ce5dc1ad7b
(cherry picked from commit 72b3ab18ca302a3117f424a0f0ef6c08897c310e)
2019-05-15 02:09:52 +00:00
Chalard Jean
31740e4ed3 Update throws documentation for requestNetwork*
Bug: 78126688
Test: builds
Change-Id: I8b5bb052bf73feed0dfafafaf44fcd07f58186ce
2019-05-14 22:16:29 +09:00
Paul Hu
a4980fc1fd Merge "Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission" am: c381068caa
am: fb8186d0a9

Change-Id: I1025da29beb53259f57bd9ca5648b32f2847ed4a
2019-05-14 04:17:29 -07:00
Paul Hu
fb8186d0a9 Merge "Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission"
am: c381068caa

Change-Id: I065b5403d2f89d158e76f63c9b125ad30e603633
2019-05-14 04:06:04 -07:00
Paul Hu
c381068caa Merge "Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission" 2019-05-14 10:48:48 +00:00
paulhu
de3a2452a0 Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission
Caller should get SecurityException if called
ConnectivityManager#startCaptivePortalApp() w/o
MAINLINE_NETWORK_STACK permission. But now it will not get any
exception and can launch captive portal app successfully.

Bug: 132662433
Test: atest android.net.cts.ConnectivityManagerTest#testStartCaptivePortalApp
      w and w/o MAINLINE_NETWORK_STACK permission
Test: atest FrameworksNetTests NetworkStackTests

Change-Id: I61be1b0647f4165665a2d4166311adeac956e0d4
2019-05-14 18:44:16 +08: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
Aaron Huang
81c72fc6c0 [automerger skipped] Merge "Send message to add/remove NAT-T keepalive packet filter." into qt-dev
am: 31e7bbccb1 -s ours
am skip reason: change_id Ic97ffe9ff5781778efd264460809f5059f0f4230 with SHA1 77abd94876 is in history

Change-Id: I40a476b7bb8b4cff1107e5786f5da2900ef0462f
2019-05-13 07:52:13 -07:00
junyulai
8a11b43814 [automerger skipped] Merge changes from topic "cleanupkeepalive" into qt-dev
am: c31ccecf6c -s ours
am skip reason: change_id I0481a469ee23231e5f0ab738a06b5e09f6cdb680 with SHA1 6e2c653c6e is in history

Change-Id: Ib6b1225fa45270974cce121a60e46f49f79e68ec
2019-05-13 07:42:08 -07:00
Junyu Lai
029da6e8f7 Merge "Fix concurrent modification exception in KeepaliveTracker" am: 7da0d7f02e
am: 5fb8a1d525

Change-Id: I6221bdff630ebef88bfd9d609e31a0f9ede036ad
2019-05-13 03:52:25 -07:00
Aaron Huang
4f4d8cb417 Send message to add/remove NAT-T keepalive packet filter.
Remove definition of TYPE_NATT and TYPE_TCP since the type
can be identified by checking message.obj is an instance of
NattKeepalivePacketData or TcpKeepalivePacketData.
It's more simple and won't have dependency on KeepaliveInfo.

Bug: 33530442
Test: atest FrameworksNetTests
      atest NetworkStackTests

(Clean cherry-pick of aosp/955419)

Change-Id: Ic97ffe9ff5781778efd264460809f5059f0f4230
Merged-In: Ic97ffe9ff5781778efd264460809f5059f0f4230
2019-05-13 18:48:19 +08:00
junyulai
714801ec75 Fix concurrent modification exception in KeepaliveTracker
In aosp/951200, the clean up function delete the item in the
hash map that holds the record while iterating it, where the
list used to iterate the records is backed by the hash map,
so changes to the map are reflected in the list and caused
the concurrent modification exception.

Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 300
      2. atest FrameworksNetTests --generate-new-metrics 10

(Clean cherry-pick of aosp/959599)

Change-Id: I9cdfe6f6d11c5400c856cc30a33ff4a44ba9d811
Merged-In: I0481a469ee23231e5f0ab738a06b5e09f6cdb680
2019-05-13 18:44:39 +08:00
Junyu Lai
2c84918729 Clean up the keepalive slots when network disconnect
In general, keepalive slots are released after result of
stopping has returned. However, for network disconnect case,
the service side cannot communicate with network agent since
the async channel is broken.

Clean up keepalive slots right after stop in this case.

Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
      2. atest FrameworksNetTests --generate-new-metrics 10

Change-Id: Id3e4e159713c0ed7e03f45169e87b73ae6408e4f
(cherry picked from commit a5f6bd16062fba89bcf900aca93aa3514d93f662)
Merged-In: Id3e4e159713c0ed7e03f45169e87b73ae6408e4f
Merged-In: Icb5a1b5bb10617aa5a7b35db6cf48db3dc53b7fd
2019-05-13 18:43:00 +08: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
Junyu Lai
5fb8a1d525 Merge "Fix concurrent modification exception in KeepaliveTracker"
am: 7da0d7f02e

Change-Id: Ibd23240fdf8fb56b4216e2482152f605374f76db
2019-05-13 03:39:29 -07:00
Junyu Lai
6e95d70fae [automerger skipped] Merge changes I92f6d977,I06840834 into qt-dev
am: b05b4d609f -s ours
am skip reason: change_id Ibcb91105e46f7e898b8aa7c2babc3344ef2c6257 with SHA1 0586a60292 is in history

Change-Id: I64a66b8c08963428d409908f93c1d557fd9e4ff6
2019-05-13 03:14:30 -07:00
Junyu Lai
7da0d7f02e Merge "Fix concurrent modification exception in KeepaliveTracker" 2019-05-13 10:09:48 +00:00
junyulai
c602b40237 Limit unprivileged keepalives per uid
Public APIs for creating unprivileged NATT socket keepalive
might allow users to exhaust resource if malicious apps try
to create keepalives with fd which is not created by
IpSecService through binder call. Thus, this change add
customizable limitation per uid to prevent resource exhaustion
attack.

Bug: 129371366
Bug: 132307230
Test: atest FrameworksNetTests

Clean cherry-pick of aosp/954040
Merged-In: Ibcb91105e46f7e898b8aa7c2babc3344ef2c6257
Merged-In: Ia667386c1a8949839871a6949d79552d9c8b88f0

Change-Id: I92f6d977b6dfde4e1bf74df6b60c9a0b9e8eec40
2019-05-13 15:53:02 +09: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
junyulai
6e2c653c6e Fix concurrent modification exception in KeepaliveTracker
In aosp/951200, the clean up function delete the item in the
hash map that holds the record while iterating it, where the
list used to iterate the records is backed by the hash map,
so changes to the map are reflected in the list and caused
the concurrent modification exception.

Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 300
      2. atest FrameworksNetTests --generate-new-metrics 10

Change-Id: I0481a469ee23231e5f0ab738a06b5e09f6cdb680
2019-05-13 14:48:41 +08:00
Paul Hu
16a3411c95 [automerger skipped] Merge "Add CTS API coverage for APIs which are used by NetworkStack" into qt-dev
am: 1140cb3dbb -s ours
am skip reason: change_id Id3f0d1c19a76c7987b69e449203fc50423f5e531 with SHA1 e6a0ed54d3 is in history

Change-Id: I0dc150eb7a4c72f381df12919de8e7ccfb341ba0
2019-05-12 19:46:24 -07: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
Paul Hu
36ca94dee1 [automerger skipped] Merge "Add ApfCapabilities common test cases" into qt-dev
am: 4506469d8e -s ours
am skip reason: change_id Icfd80943212430b2a0e6a4b55f53270cbc3d1693 with SHA1 3f11892c07 is in history

Change-Id: I759c399eedf0e111de92b5d4538409b0a14759bb
2019-05-12 19:40:50 -07:00
Paul Hu
807bd09ce0 [automerger skipped] Merge "Add LinkProperties common test cases" into qt-dev
am: 3d8ee7e355 -s ours
am skip reason: change_id I8d36177cbf4f39da602331e091a60a40f6eaea33 with SHA1 612724480f is in history

Change-Id: Icc484c8d0c483e3306a892f2ed0300109d1328e3
2019-05-12 19:36:34 -07: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
5e44e5fafc [automerger skipped] Merge "Reland: Add FrameworksNetTests dependency on libcgrouprc" am: 6e0c162246 -s ours
am: e3dc775c7f -s ours
am skip reason: change_id I85891485157ed86e069039dfe3092028ff703dd5 with SHA1 ecbcb7fbfc is in history

Change-Id: If9c8aa41c4e96a79b71c88f199a4f3b0483e31cd
2019-05-10 14:26:25 -07:00
Ian Kasprzak
e3dc775c7f [automerger skipped] Merge "Reland: Add FrameworksNetTests dependency on libcgrouprc"
am: 6e0c162246 -s ours
am skip reason: change_id I85891485157ed86e069039dfe3092028ff703dd5 with SHA1 ecbcb7fbfc is in history

Change-Id: Iec27ecd2f0c0636b066fa0fe83c049fff656343f
2019-05-10 13:37:45 -07:00
Ian Kasprzak
6e0c162246 Merge "Reland: Add FrameworksNetTests dependency on libcgrouprc" 2019-05-10 20:08:54 +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
Chalard Jean
38836eabec [automerger skipped] Merge "Support strict mode private DNS on VPNs that provide Internet." into qt-dev
am: 5c31d4ff79 -s ours
am skip reason: change_id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA1 2fca7e3cb3 is in history

Change-Id: I83461198c27a7252d5328283ae37cd52f3902863
2019-05-10 08:41:39 -07:00
Xiao Ma
82a7e510a5 Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest."
am: 3bee1cdc4e

Change-Id: Ifbd359f9fec530076f3216c171120436ed4221a6
2019-05-10 08:33:48 -07:00
Xiao Ma
3bee1cdc4e Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." 2019-05-10 15:16:33 +00:00