Commit Graph

5060 Commits

Author SHA1 Message Date
Nathan Harold
2bc5a4c9ee Merge "Count and Report Bandwidth Requests by UID"
am: e1d140619f

Change-Id: Iadfb7c04a49055c57cc8eed2ce9ad5f10e15cf52
2018-08-01 15:48:12 -07:00
Nathan Harold
b89cbfbdca Count and Report Bandwidth Requests by UID
To debug power drain due to modem wakeups,
one of the signals we'd like to track is
requests for bandwidth estimate to see which
apps are making requests and how often. This
patch keeps a simple count per-UID when an
app requests a bandwidth update, and that
count is made available in dumpsys.

Bug: 77498849
Test: runtest frameworks-net
Change-Id: I30d2ce85f9fa6747030cf4039d1080113a32e386
2018-07-31 02:37:38 +00:00
Remi NGUYEN VAN
86bbc9e887 Merge "Increase network request timeouts"
am: dab690a61a

Change-Id: Iaae31d7eaa5e5ccccdcf63ba39dd3fdc729161a5
2018-07-27 06:08:08 -07:00
Treehugger Robot
dab690a61a Merge "Increase network request timeouts" 2018-07-27 11:56:31 +00:00
Remi NGUYEN VAN
68225bc676 Merge "Use timeout consts in all ConnService tests"
am: bbba1f7f9f

Change-Id: Ie62b9893c5b5f4e7b24197c1308d33e06a6c8f71
2018-07-27 00:11:06 -07:00
Remi NGUYEN VAN
524ea05e39 Increase network request timeouts
With recent performance degradations on apct, the current timeouts are
too short and some requests trigger onUnavailable() before networks are
validated.

Test: runtest -x ConnectivityServiceTest.java
Bug: b/111778226
Change-Id: I083f529787f108065637a0aff3e5bb88e05e6510
2018-07-27 15:37:13 +09:00
Remi NGUYEN VAN
bbba1f7f9f Merge "Use timeout consts in all ConnService tests" 2018-07-27 05:50:35 +00:00
Remi NGUYEN VAN
626885b750 Use timeout consts in all ConnService tests
Fix some timeouts that were forgotten in parent CL.

Bug: b/111778226
Test: runtest --no-hidden-api-checks -x ConnectivityServiceTest.java
Change-Id: Ib848eaba8c69c07ac596aa4386a741c9a2a87fc9
2018-07-27 11:47:25 +09:00
Remi NGUYEN VAN
3b498060f6 Merge "Increase linger delay and test callback timeout"
am: 0544dfde7e

Change-Id: I088de7dae4191a65e75feb9e071dcf18c30dcf21
2018-07-26 04:10:02 -07:00
Remi NGUYEN VAN
0544dfde7e Merge "Increase linger delay and test callback timeout" 2018-07-26 09:54:03 +00:00
Remi NGUYEN VAN
b6bd15ac29 Increase linger delay and test callback timeout
Tests appear to have become much slower on apct in recent runs, although
local runs do not seem to be affected. As a first measure, increase our
timeouts to eliminate flakyness.

Bug: b/111778226
Test: runtest --no-hidden-api-checks -x ConnectivityServiceTest.java
Change-Id: I7a3bfb646eb554bcd9d50d026142f2a2cff74beb
2018-07-26 16:43:58 +09:00
Remi NGUYEN VAN
6cbacfa17e Merge "Increase TEST_LINGER_DELAY_MS"
am: 9a783699cc

Change-Id: Iff68ee39ead571293877464c03ab98ab594dfcca
2018-07-24 22:05:37 -07:00
Remi NGUYEN VAN
50cb7dbc11 Increase TEST_LINGER_DELAY_MS
The current timeout is short enough that lingered networks are torn down
before assertions can be run, causing flakyness in testMultipleLingering.
This CL sets the timeout to 300 in that particular test.

Verified that 300ms is enough with 500 successful runs on Sailfish.

An alternative would be to mock firing of the lingering timer, but
keeping the WakeupMessage logic realistic has already proven useful in
detecting races.

Bug: b/110673602
Test: runtest --no-hidden-api-checks frameworks-net
Change-Id: I6f9a656190bcff0b071ae2584d0f5fa74158472b
2018-07-19 17:12:38 +09:00
Erik Kline
7ae1277cd3 Merge "Push DNS configuration on network validation"
am: b71c6a1b7e

Change-Id: I5907831e5f5f1f3659580cc56e2e081cbe88b1cc
2018-07-03 03:09:16 -07:00
Treehugger Robot
b71c6a1b7e Merge "Push DNS configuration on network validation" 2018-07-03 09:03:35 +00:00
Erik Kline
a73af00583 Push DNS configuration on network validation
Test: as follows
    - built, flashed, booted
    - runtest frameworks-net passes
    - connected to captive portal network,
      saw failed validation attempt (opportunistic),
      passed portal, saw successful revalidation attempt
Bug: 64133961
Bug: 72344805
Bug: 109928338

Change-Id: I0471685c2234af8a8c7f5b2ad3205eb6e36333c5
2018-07-03 13:33:34 +09:00
Erik Kline
a3b085b226 Merge "Prefer default Internet network for upstream tethering."
am: 9442987fc6

Change-Id: I0990d077627aed71b03e7aa40a8acc460448a774
2018-06-25 06:24:22 -07:00
Treehugger Robot
9442987fc6 Merge "Prefer default Internet network for upstream tethering." 2018-06-25 12:08:46 +00:00
Erik Kline
a34b584026 Prefer default Internet network for upstream tethering.
Rather than use the crufty config.xml list of upstream transport types,
use ConnectivityService's notion of the default network for the upstream.
In cases where a DUN network is required and the default network is
currently a mobile network, look for a DUN network (code in Tethering
is currently responsible for requesting one).

Test: as follows
    - built, flashed, booted
    - runtest frameworks-net
    - tethered via mobile, joined captive portal network, maintained
      laptop access via mobile until captive passed (then used wifi)
    - disabled client mode wifi, disabled mobile data, plugged in
      ethernet adapter, observed connectivity via ethernet
Bug: 32163131
Bug: 62648872
Bug: 63282480
Bug: 109786760
Bug: 110118584
Bug: 110260419
Merged-In: I9cddf1fb7aa3b8d56bf048c563556244e74808c2
Merged-In: Icac3e5e20e99093ddb85aae1ca07ed7b5cf309fd
Change-Id: I925b75994e31df8046f3ef9916a2457b4210485e
(cherry picked from commit 359d4c6d61)
2018-06-25 19:25:17 +09:00
Chalard Jean
e71a3833fe Merge "Add StackedLinkProperties test case"
am: faf31f8638

Change-Id: I33d75bf593708317dca4ba6cec035b7f035cfa86
2018-06-20 21:23:17 -07:00
junyulai
74f9a8b52a Add StackedLinkProperties test case
Change access level of getNetworkAgentInfoForNetwork in ConnectivityService to get
better testability. And add test case to verify clat state transition and make sure
linkProperties are updated correctly.

Bug: 80261579, 109913107
Test: runtest frameworks-net -c com.android.server.ConnectivityServiceTest \
          -m testStackedLinkProperties
Change-Id: I72fce594d74bd349f65557edca03640e1b86317c
2018-06-19 16:53:08 +08:00
Chalard Jean
fb5f0d1c37 Merge changes I4b1bca8b,Idb7d2f28,I4825e632
am: 84d4e535ae

Change-Id: I7278ffe7ca8e25b040d6bce7fb880ccf0984f6ee
2018-06-18 03:06:05 -07:00
Chalard Jean
24749e0b40 Merge changes I6abd2221,I2c149d29,I45d22857,I1f879b2c,If4986a25, ...
am: 6c0106b57f

Change-Id: I86bc83e2bd859b48017f12832e9ff0080ec162b8
2018-06-12 06:57:33 -07:00
Chalard Jean
fe357814b4 [PT09] Add javadoc comments to all ProxyTracker methods/members.
Also rename some vars and inline a function that is now private.

Test: runtest
Change-Id: I4b1bca8b29f46d97056973cd38ed8effc3f5b591
2018-06-12 19:03:16 +09:00
Chalard Jean
d9e70ac17e [PT08] Move setDefaultProxy to ProxyTracker
Test: runtest
Change-Id: Idb7d2f2895aac63d54e3a6481379b739a726eff6
2018-06-12 19:03:16 +09:00
Chalard Jean
8cbd2dd7e4 [PT06] Move setGlobalProxy into ProxyTracker
Test: runtest
Change-Id: I6abd2221882db368a411b7174c66d8bd3b6b5110
2018-06-12 19:03:15 +09:00
Chalard Jean
e18083062e [PT07] Small cleanup of setGlobalProxy
Test: runtest
Change-Id: I4825e6326f7ce7bd45d625d57824f8d27c51d6f2
2018-06-12 19:03:15 +09:00
Chalard Jean
5c0ca509d5 [PT05] Move sendProxyBroadcast into ProxyTracker.
Test: runtest
Change-Id: I2c149d29d4b75d3978021b940b6bc58f677b8d17
2018-06-12 19:03:15 +09:00
Chalard Jean
faf4a2083d [PT04] Move PacManager into ProxyTracker.
Test: runtest
Change-Id: I45d22857459fe1746d484ac04f8d5cd81fc61835
2018-06-12 19:03:15 +09:00
Chalard Jean
777e2e59e6 [PT03] Move some more code into ProxyTracker.
Add finals and annotations. Remove comments that have lost their
context (they were in the context of disabling a permission check
that had been added, but constituted an API change that would not
serve any real purpose).

Test: runtest
Change-Id: I1f879b2c105d2127072b88233d72097a0d78fe14
2018-06-12 19:03:15 +09:00
Chalard Jean
7d97afc73f [PT02] Move static methods to ProxyTracker
No logic changes. Only changes are adding nullability annotations,
final modifiers, and adding an s in a comment.

Test: runtests
Change-Id: If4986a25bb36819de8ff459c4c0439c56d4e5a50
2018-06-12 19:03:14 +09:00
Chalard Jean
5d70ba4502 [PT01] Introduce ProxyTracker
The goal of this is to simplify ConnectivityService by reducing
the amount of code it contains. This is small enough to be obviously
correct and followup changes will move code into this class.

Test: runtest
Change-Id: Ic5ab19b521e98ae397c9bf657856820304362fbb
2018-06-12 19:03:14 +09:00
Chalard Jean
0ceb26580f Remove a useless parameter.
This argument is useless because all its callers pass the same
value : false.

Test: runtest
Change-Id: Id921caa4ffadef535a5bbcfea052283a07320b28
2018-06-12 19:03:14 +09:00
Chalard Jean
040a41f850 Small cleanup of Network.
Test: runtest
Change-Id: I56dbd37bb8f890938d360f45835de72be4beb91a
2018-06-12 19:03:14 +09:00
Chalard Jean
d51966a41b Cleanup of LinkProperties.
Test: runtest
Change-Id: I7299de93a79901635ce755a2d933666ee43767d5
2018-06-12 19:03:07 +09:00
Chalard Jean
d5a1bfbef2 Merge changes Ifd7d73ad,Id79096fa
am: abf2a3f652

Change-Id: I263f51ba2aafdf8e19e020b2a4f6ff1b8238fa3c
2018-06-11 06:12:34 -07:00
Treehugger Robot
abf2a3f652 Merge changes Ifd7d73ad,Id79096fa
* changes:
  Bugfixes in LinkProperties#toString
  Cleanup of ConnectivityManager.
2018-06-11 11:54:21 +00:00
Chalard Jean
d3930f170a Bugfixes in LinkProperties#toString
We should stop trying to use a human brain to write code

Test: manual
Change-Id: Ifd7d73ad65de0f671466080beacbd97287e17bfe
2018-06-11 18:48:37 +09:00
Chalard Jean
9dd116103e Cleanup of ConnectivityManager.
This is not exhaustive, but still an undeniable improvement.

Test: runtest frameworks-net
Change-Id: Id79096faf20eec80de7c17b261ef338b895af1e0
2018-06-11 18:48:37 +09:00
Chalard Jean
ee3bcc9b8b Merge "No-op cleanup of ConnectivityService."
am: a706027ff9

Change-Id: I9ec9633a85b8b2298f90419da2a73c540b6e6805
2018-06-10 22:09:18 -07:00
Treehugger Robot
a706027ff9 Merge "No-op cleanup of ConnectivityService." 2018-06-11 04:57:31 +00:00
junyulai
2f364968b2 Merge "Copy clat modified linkProperties into new one."
am: 7d13e7cebe

Change-Id: Ia1f9ab3d5c3b889beddb4dda56ad3389c4967275
2018-06-10 21:44:16 -07:00
Treehugger Robot
7d13e7cebe Merge "Copy clat modified linkProperties into new one." 2018-06-11 03:26:26 +00:00
Nathan Harold
1db89848ab Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Manually merging this due to skipping a merge
conflict at 9fe9ec18c1

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde
2018-06-08 23:23:04 +00:00
Xin Li
db82c4c8f8 Skip 9fe9ec18c1 in proposed pi-dev-plus-aosp-without-vendor merge.
Bug: 79597307
Change-Id: I8ac04fdd94b069434e2f00b0bfab63eb916f6129
2018-06-08 14:36:00 -07:00
nharold
9fe9ec18c1 Merge changes from topic "ipsec-sync-with-pi"
am: ff904be7a9

Change-Id: Ic91ed8f496163c560c6f1fd306bc74e5fecb61c2
2018-06-08 12:34:09 -07:00
nharold
ff904be7a9 Merge changes from topic "ipsec-sync-with-pi"
* changes:
  Disable the AppOp Restriction for IpSec Tunnels
  Rework Exception Handling for IpSecManager
  Update IpSecManager to use InetAddress and prefixLen
  Add AppOps Checks for MANAGE_IPSEC_TUNNELS
  Add MANAGE_IPSEC_TUNNELS Permission
2018-06-08 17:07:11 +00:00
Chalard Jean
d6c33dcc5d No-op cleanup of ConnectivityService.
Funny how these things accumulate. Not exhaustive of course, but
still an improvement.
- Remove unused imports.
- Remove unused variables and members.
- Replace members with locals where applicable.
- Remove useless type parameters and explicit unboxings for Java 7.
- Conversely add the diamond operator for auto-genericity for
  Java 6.
- Reduce visibility of members where possible.

Test: runtest frameworks-net
Change-Id: I13586aee09b4cd1c87c525fafb5eee44dedb5360
2018-06-08 19:10:59 +09:00
junyulai
1ccc18576f Copy clat modified linkProperties into new one.
updateLinkProperties copied the linkProperties in networkAgent,
but the clat fix-up function did not copy stacked link into new one.
This caused an incorrect clat iface removal, and the IPv4 network
 to be unreachable.

Clean cherry-pick of ag/4260470

Bug: 80261579
Test: 1. ping after ipv6 only data call with 2g voice call on/off
      2. runtest frameworks-net
      3. run cts -m CtsNetTestCases
Change-Id: Ide47a3b0680dddfcf3e2e759a59b19aee3605050
2018-06-08 16:28:32 +09:00
Nathan Harold
71fc014f00 Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde
2018-06-07 18:44:34 -07:00