Commit Graph

6919 Commits

Author SHA1 Message Date
Xiao Ma
fb7d869e8a [automerger skipped] Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." into qt-dev am: cfaa8ead59 -s ours
am: 36d894ca5c -s ours
am skip reason: change_id I8ce3bed435fbbb814d71fe48ffd305ff3f947f3f with SHA1 8f4a5a1bf8 is in history

Change-Id: I1539837acb43af6f0325d8331e424a05fdeafabe
2019-05-15 23:32:38 -07:00
Xiao Ma
36d894ca5c [automerger skipped] Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." into qt-dev
am: cfaa8ead59 -s ours
am skip reason: change_id I1db13a48b59d743482436ecf8a20d7f12edd6e1c with SHA1 992b7f79a7 is in history

Change-Id: Ie908aaa904db4fd8540819b3afe2930de273e28a
2019-05-15 17:50:03 -07:00
Xiao Ma
6852ea4b3f [automerger skipped] Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." into qt-dev am: cfaa8ead59 -s ours
am: 12232917c0 -s ours
am skip reason: change_id I8ce3bed435fbbb814d71fe48ffd305ff3f947f3f with SHA1 8f4a5a1bf8 is in history

Change-Id: I571e9103c42433241a5dfd3443c97f5082a26b28
2019-05-15 09:33:46 -07:00
Xiao Ma
12232917c0 [automerger skipped] Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." into qt-dev
am: cfaa8ead59 -s ours
am skip reason: change_id I1db13a48b59d743482436ecf8a20d7f12edd6e1c with SHA1 992b7f79a7 is in history

Change-Id: I206c3efa264a7a8b16f07683c7c1bbf9fb29b426
2019-05-15 09:22:19 -07: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
Lorenzo Colitti
32c98046d1 [automerger skipped] Merge "Clean up the permission control code in framework" into qt-dev am: 4f47f2c827 -s ours
am: 538c643533 -s ours
am skip reason: change_id I25224c9576f52d2a0a0bd2182325c7aac7b28eb5 with SHA1 2bebfc2b87 is in history

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

Change-Id: Ib04616201b7a1254d71c47d917498bccec817459
2019-05-14 23:53:01 -07: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
e3101f710e [automerger skipped] Merge "Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission" into qt-dev am: 53e2a9b0ae -s ours
am: 399f297121 -s ours
am skip reason: change_id I1025da29beb53259f57bd9ca5648b32f2847ed4a with SHA1 a4980fc1fd is in history

Change-Id: I57914fd792bcd76fa695dc4b626c95fbdb8be1f3
2019-05-14 22:48:51 -07:00
Paul Hu
0063651eca Merge "Ignore NetworkTest when running CtsNetTestCases in instant app mode" am: a00c638ebe am: a582a82795
am: bea628fb59

Change-Id: I1e93d4491e3d9e5a095ff4b6169b2f70e7b3b690
2019-05-14 22:41:10 -07: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
Paul Hu
b50ceeee1e Merge "Fix captive portal app can be launched w/o MAINLINE_NETWORK_STACK permission" am: c381068caa am: fb8186d0a9
am: a4980fc1fd

Change-Id: Ib70fe6fad107f3e9dce9ce673188c5ce5dc1ad7b
2019-05-14 04:28:35 -07: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
b6ca681c7a Merge "Clean up the permission control code in framework" am: 0e6d2b5f4f am: 6cb0c1579d
am: 9313f7adf9

Change-Id: Iab7ee1619565b1be23d454d158d6ec33cf106c96
2019-05-13 11:57:23 -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
b8fa1bcfc2 [automerger skipped] Merge "Send message to add/remove NAT-T keepalive packet filter." into qt-dev am: 31e7bbccb1 -s ours
am: 81c72fc6c0 -s ours
am skip reason: change_id Ic97ffe9ff5781778efd264460809f5059f0f4230 with SHA1 77abd94876 is in history

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

Change-Id: I487ad4a020a25c1d12b6370589777685261b8af0
2019-05-13 07:53:24 -07: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
5dfbe98635 Merge "Fix concurrent modification exception in KeepaliveTracker" am: 7da0d7f02e am: 5fb8a1d525
am: 029da6e8f7

Change-Id: I25af44d8d8c64036ad39346faa363e2154cfbbc5
2019-05-13 04:03:43 -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
437102472c [automerger skipped] Merge changes I92f6d977,I06840834 into qt-dev am: b05b4d609f -s ours
am: 6e95d70fae -s ours
am skip reason: change_id Ibcb91105e46f7e898b8aa7c2babc3344ef2c6257 with SHA1 0586a60292 is in history

Change-Id: If7d6bc26315616e9851cd2d0a98bb95ce9482d1b
2019-05-13 03:31:02 -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
c44af9c092 [automerger skipped] Merge "Add CTS API coverage for APIs which are used by NetworkStack" into qt-dev am: 1140cb3dbb -s ours
am: 16a3411c95 -s ours
am skip reason: change_id Id3f0d1c19a76c7987b69e449203fc50423f5e531 with SHA1 e6a0ed54d3 is in history

Change-Id: I67cabf9896f3654df00ab3fe5d32c363528ead12
2019-05-12 20:01:53 -07:00
Paul Hu
7231a1af25 [automerger skipped] Merge "Add ApfCapabilities common test cases" into qt-dev am: 4506469d8e -s ours
am: 36ca94dee1 -s ours
am skip reason: change_id Icfd80943212430b2a0e6a4b55f53270cbc3d1693 with SHA1 3f11892c07 is in history

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

Change-Id: I1121cad186fda00bacaeaf2fbe2441db22fe5b20
2019-05-12 19:47:52 -07: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