Commit Graph

5464 Commits

Author SHA1 Message Date
Roshan Pius
45190f8e7f Merge "NetworkAgent: Send primitive integer in score" 2018-08-10 14:33:07 +00:00
Roshan Pius
d594290fd9 NetworkAgent: Send primitive integer in score
|Integer| is not parcelable and hences crashes when the binder call
crosses a process boundary. Using a primitive integer should suffice
for sending the value to the server. There are no other usage of
|EVENT_NETWORK_SCORE_CHANGED| in the codebase.

Bug: 112358948
Test: Device boots up and able to make wifi connection.
Change-Id: I4c8fc17f4b803f69a4d882c71a8ce014a194d1ba
2018-08-09 07:10:27 -07:00
Remi NGUYEN VAN
842a58215d Merge "Add tests for NetworkMonitor isCaptivePortal" am: 6ee63e03dc am: aebb44fd8e
am: 0af00d4866

Change-Id: I0f93d8a475a949e61e9f2b8e8116c241ae68faaf
2018-08-08 12:07:03 -07:00
Remi NGUYEN VAN
0af00d4866 Merge "Add tests for NetworkMonitor isCaptivePortal" am: 6ee63e03dc
am: aebb44fd8e

Change-Id: Ieba6ed270bce8ef5051ee34dc39695d56bda903f
2018-08-08 11:42:53 -07:00
Remi NGUYEN VAN
6ee63e03dc Merge "Add tests for NetworkMonitor isCaptivePortal" 2018-08-08 04:59:12 +00:00
Remi NGUYEN VAN
de25687203 Add tests for NetworkMonitor isCaptivePortal
Bug: b/79499239
Test: added tests, ConnectivityService tests pass

Change-Id: I98d503b8f92d7f35e59dd1621a90f2eca8c7a63c
2018-08-07 08:57:35 +00:00
Remi NGUYEN VAN
f3361d01c4 Merge "Add utils to convert Inet4Address <-> int" am: 2587292cd1 am: c9f4d7be9e
am: 4c10a126df

Change-Id: I8dac87304c9e7487715109b52fb8a43b948094e6
2018-08-06 12:18:52 -07:00
Remi NGUYEN VAN
4c10a126df Merge "Add utils to convert Inet4Address <-> int" am: 2587292cd1
am: c9f4d7be9e

Change-Id: Ia6830f33233210ea12816d6f099300231a7f9f6b
2018-08-06 12:09:31 -07:00
Remi NGUYEN VAN
c9f4d7be9e Merge "Add utils to convert Inet4Address <-> int"
am: 2587292cd1

Change-Id: I347d23f4682eca623e3b10f72bc9000b1c5954a3
2018-08-06 09:34:55 -07:00
Remi NGUYEN VAN
2587292cd1 Merge "Add utils to convert Inet4Address <-> int" 2018-08-06 05:49:52 +00:00
Remi NGUYEN VAN
6e2a93cf9a Add utils to convert Inet4Address <-> int
The current utilities map the higher-order bytes of ints to the
lower-order bytes of IPv4 addresses, which makes applying masks and
generating series of addresses confusing.

For example, the current utilities would convert 1.2.3.4 to 0x04030201,
or generate 0x0080ffff for a /17 subnet mask. The utilities in this CL
convert 1.2.3.4 to 0x01020304, and a /17 subnet mask is represented as
0xffff8000.

Includes tests for all the above methods and migration of
NetworkUtilsTest to JUnit4.

Test: added tests pass
Change-Id: I5f5aa2e6e3b054b66b9dc507dab64f41be9139b1
2018-08-03 15:55:24 +09:00
Nathan Harold
48452b82e3 Merge "Count and Report Bandwidth Requests by UID" am: e1d140619f am: 2bc5a4c9ee
am: b109118e28

Change-Id: I354ed7669f4c37842798a2ef8287a1b9132b8b89
2018-08-01 16:28:14 -07:00
Nathan Harold
b109118e28 Merge "Count and Report Bandwidth Requests by UID" am: e1d140619f
am: 2bc5a4c9ee

Change-Id: I2c1bd77de350c27206c9809a628d6d4e0eacad2f
2018-08-01 16:08:34 -07:00
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
8d01a427d7 Merge "Increase network request timeouts" am: dab690a61a am: 86bbc9e887
am: 8f78e88b8b

Change-Id: I972f717a2ba2ef17e372f7d2afe3a29d4ed839d2
2018-07-27 06:24:25 -07:00
Remi NGUYEN VAN
8f78e88b8b Merge "Increase network request timeouts" am: dab690a61a
am: 86bbc9e887

Change-Id: I1f0840a3fec3605e51942e8bc0debb954fd571d5
2018-07-27 06:16:50 -07: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
f942290dd4 Merge "Use timeout consts in all ConnService tests" am: bbba1f7f9f am: 68225bc676
am: aa66c957f6

Change-Id: Ia2a25b560dd0aac670472a78583fa890b24c0633
2018-07-27 00:30:28 -07:00
Remi NGUYEN VAN
aa66c957f6 Merge "Use timeout consts in all ConnService tests" am: bbba1f7f9f
am: 68225bc676

Change-Id: I3d4a35aa3b78b455fe527c686b1a5cb2573ba47a
2018-07-27 00:20:07 -07: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
android-build-team Robot
e4a73d42cd Snap for 4916303 from 5ad001eb4f5152cf8d534608ebd2d369e383e8b9 to pi-qpr1-release
Change-Id: Ib3033bf0876b52d2d579359681ff542d0bf34b7d
2018-07-27 03:13:32 +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
6df2bc7c39 Merge "Increase linger delay and test callback timeout" am: 0544dfde7e am: 3b498060f6
am: 6c8e385212

Change-Id: I2a3b3a183cd3f852df98cf55693b9486cc5f4043
2018-07-26 04:29:25 -07:00
Remi NGUYEN VAN
6c8e385212 Merge "Increase linger delay and test callback timeout" am: 0544dfde7e
am: 3b498060f6

Change-Id: I22afb23e4ca6b9bf67a4a614c5fdc02852f29464
2018-07-26 04:20:23 -07: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
8a32ccec4b Merge "Increase TEST_LINGER_DELAY_MS" am: 9a783699cc am: 6cbacfa17e
am: 2a50183965

Change-Id: Ia01dbc28d95d1f6749bc1de79f632e3553eb51e3
2018-07-24 22:32:21 -07:00
Remi NGUYEN VAN
2a50183965 Merge "Increase TEST_LINGER_DELAY_MS" am: 9a783699cc
am: 6cbacfa17e

Change-Id: I88d46b9fc0c3fddb02671a2c4875afbf151f8f84
2018-07-24 22:19:38 -07:00
Remi NGUYEN VAN
6cbacfa17e Merge "Increase TEST_LINGER_DELAY_MS"
am: 9a783699cc

Change-Id: Iff68ee39ead571293877464c03ab98ab594dfcca
2018-07-24 22:05:37 -07:00
Chiachang Wang
d01c8937bb [automerger skipped] Merge "Push DNS configuration on network validation" into pi-dev
am: 8aa960f6b1  -s ours

Change-Id: If50c5ddd4c6b77edf27ace731a3fd93679fe601c
2018-07-22 19:47:52 -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
37a4409ea2 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
Merged-In: Ic2046e053faf58e2edf2824e01145c61a9f2991f
Merged-In: I209c38fab7f05909e61731a348b1b1a2b35feab2
Change-Id: I0471685c2234af8a8c7f5b2ad3205eb6e36333c5
2018-07-04 12:17:18 +09:00
Erik Kline
db62a50859 Merge "Push DNS configuration on network validation" am: b71c6a1b7e
am: 7ae1277cd3

Change-Id: Ic2046e053faf58e2edf2824e01145c61a9f2991f
2018-07-03 03:19:32 -07: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
6a53998f14 [automerger skipped] Merge "Prefer default Internet network for upstream tethering." am: 9442987fc6
am: a3b085b226  -s ours

Change-Id: I965178ec99083dcd907841b4959e456f6d492516
2018-06-25 06:33:21 -07: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
d54eb8b3df Merge "Add StackedLinkProperties test case" am: faf31f8638
am: e71a3833fe

Change-Id: Idebb0fc4279a059bddecffc563bdf3ddf394002c
2018-06-20 21:52:15 -07:00
Chalard Jean
e71a3833fe Merge "Add StackedLinkProperties test case"
am: faf31f8638

Change-Id: I33d75bf593708317dca4ba6cec035b7f035cfa86
2018-06-20 21:23:17 -07:00
Erik Kline
87c60852fd Merge "Prefer default Internet network for upstream tethering." into pi-dev
am: 1e1635a45e

Change-Id: I9cddf1fb7aa3b8d56bf048c563556244e74808c2
2018-06-20 01:14:14 -07:00
Erik Kline
359d4c6d61 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
Change-Id: I925b75994e31df8046f3ef9916a2457b4210485e
2018-06-19 20:57:21 +09: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