Commit Graph

3757 Commits

Author SHA1 Message Date
Hugo Benichi
deebea6136 IpConnectivity metrics: add version number
This patch adds a version field to ipconnectivity.proto and populates it
to 2, which is the logical version number for NYC-MR2.

Test: IpConnectivity{EventBuilder,Metrics}Test pass
Bug: 32127906

(cherry picked from commit f04b01f0a0)

Change-Id: If8f167c0dc4c1abe0e235e2adfd131168a4ddc52
2017-01-26 18:51:18 +09:00
Etan Cohen
0aa0f341ba [CS] Remove timeout event after first available
Guarantees that timeouts are only delivered if a network never
becomes available. Once a network is available the timeout is
canceled.

Bug: 31402633
Test: all timeout related unit tests pass (new one added)

(cherry picked from commit 5eba9d7061)

Change-Id: I7cd3086544c881915fc6dbf14b87a24ab0cd8748
2017-01-26 18:51:15 +09:00
Lorenzo Colitti
ebc2b946ee Move the connectivity tests to frameworks/base/tests/net.
This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb  shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner'  # PASS

(cherry picked from commit 5a7c486d70)

Change-Id: I993eeaa5dec001c39389023f355f506129b356e7
2017-01-26 18:50:59 +09:00
Lorenzo Colitti
ae5c443943 De-guava BroadcastInterceptingContext and move it to testutils.
Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

(cherry picked from commit 6a64dd2178)

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest  # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
2017-01-26 18:50:52 +09:00
Lorenzo Colitti
91772021e9 Move FakeSettingsProvider to a common location.
(cherry picked from commit 4163f9ca8f)

Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I8d4d4de2937012dd33924f53e68f96241a9b2b4f
2017-01-26 18:50:48 +09:00
Hugo Benichi
65ecfacf15 ConnectivityServiceTest: mark flaky test as such
This patch extracts into its own independent test a test sub-block looking
for a race condition when not waiting on handlers to become idle:
there is no way to prevent the race from not happening when looking for
it this way. This makes the test flakky.

This new independent test is tagged with @FlakkyTest(tolerance = 3).

Test: ConnectivityServiceTest passes, with higher probability.
Bug: 31479480

(cherry picked from commit 144810b6cf)

Change-Id: I3c702bd981ed80ed606be0fb52d61eb3d7195a6f
2017-01-26 18:50:45 +09:00
Calvin On
c11a8e2206 Add option to skip and avoid captive portals.
Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699

(cherry picked from commit dada145a85)

Change-Id: I90c0f97fe0e41de4059bceae7b56ab3a70145696
2017-01-26 18:50:42 +09:00
Erik Kline
d99da81fae Support timeouts for requestNetwork() invocations.
(cherry-pick of 0b7a74842b)
(cherry picked from commit 155a59aa63)

Bug: 21414325
Change-Id: I1a58823a372154589f972b98c4c428eab0e0523e
2017-01-26 18:50:23 +09:00
Pierre Imai
e3b646f25d Silence the obnoxious MTU 0 error message that occur when no MTU is
specified for a given network.

Bug: 10705136

(cherry picked from commit 07c53a35ae)

Change-Id: I89e2fdfbbfa981d435a2974422d9d9c009872d76
2017-01-26 18:50:18 +09:00
Hugo Benichi
edecac55f1 DO NOT MERGE frameworks-test: adding missing @SmallTest
am: bb1b93dfa8  -s ours

Change-Id: I8499fb3133f75170de4cfb177ab538d155ccc738
2017-01-24 18:50:34 +00:00
Hugo Benichi
bb1b93dfa8 DO NOT MERGE frameworks-test: adding missing @SmallTest
This activates all frameworks-test tests in runs of the continuous
platform tests.

Test: $ runtest frameworks-net passes (expect Tether
Bug: 32561414

(cherry picked from commit 3664598601)

Change-Id: I84f9aecfbf9ebe07c6fcfec26acb2c2cfaae2d60
2017-01-24 15:42:45 +09:00
Hugo Benichi
ef41b769e8 ConnectivityServiceTest: remove flaky waitForIdle test.
This patch removes testNotWaitingForIdleCausesRaceConditions() from
ConnectivityServiceTest because it is in nature flaky and prevents using
ConnectivityServiceTest as a patch presubmit check. Estimated failure
rate is 1/15 on Nexus 6p.

This patch also simplifies how ConnectivityServiceTest waits for
handlers to become idle by removing IdleableHandlerThread and turning it
into a signle static method.

Test: $ runtest frameworks-net
Bug: 31479480
Change-Id: I2d78709cbb61d5d01cd59cff326469417f73f1ab
2017-01-24 15:22:48 +09:00
Hugo Benichi
2ffbac43f4 ConnectivityServiceTest: fix flaky tests
This patch adjusts timeouts in ConnectivityServiceTest to fix tests
known to fail spruriously.

Test: ran the following tests 500 times without observing any failure
 - testBackgroundNetworks()
 - testMultipleLingering()
 - testPacketKeepalives()
 - testSatisfiedNetworkRequestDoesNotTriggerOnUnavailable()
 - testSatisfiedThenLostNetworkRequestDoesNotTriggerOnUnavailable()
Bug: 32561414
Change-Id: I184fe7189aac768a65b927cc42eefaf8b1b3f930
2017-01-24 15:21:18 +09:00
Robin Lee
c9327b4903 Merge "Disable always-on VPN in factoryReset" am: 9847e78b72 am: adb7a1c631 am: f6c57b8f2f
am: 5c709185ef

Change-Id: Iaccb7394994ccce66df0ab2f713fd890a8b999c8
2017-01-23 17:05:42 +00:00
Robin Lee
5c709185ef Merge "Disable always-on VPN in factoryReset" am: 9847e78b72 am: adb7a1c631
am: f6c57b8f2f

Change-Id: I99207281321861a3e720b5c1e2e316e12b104677
2017-01-23 17:01:31 +00:00
Robin Lee
f6c57b8f2f Merge "Disable always-on VPN in factoryReset" am: 9847e78b72
am: adb7a1c631

Change-Id: I66b6721932ae8798cbb406cafa04ed0c92fe47f6
2017-01-23 16:54:59 +00:00
Robin Lee
adb7a1c631 Merge "Disable always-on VPN in factoryReset"
am: 9847e78b72

Change-Id: I021b288e3db17ddefbea3645fd282e3ee123a6e8
2017-01-23 16:47:58 +00:00
Robin Lee
9847e78b72 Merge "Disable always-on VPN in factoryReset" 2017-01-23 16:40:07 +00:00
Erik Kline
c4529228a0 Merge "More concisely export whether we have a "tetherable configuration"" am: 1f2437c65a am: b0949a3ede am: e7234fc716
am: 157ac7a76a

Change-Id: I290df5269739bc7fb5ebc8614a96c38bf7faf367
2017-01-23 07:30:22 +00:00
Erik Kline
157ac7a76a Merge "More concisely export whether we have a "tetherable configuration"" am: 1f2437c65a am: b0949a3ede
am: e7234fc716

Change-Id: Iba07ae91906fa2f0763dae831f56b4841572e1f1
2017-01-23 07:26:28 +00:00
Erik Kline
e7234fc716 Merge "More concisely export whether we have a "tetherable configuration"" am: 1f2437c65a
am: b0949a3ede

Change-Id: Ic67b2d4589f586c67109216330f68cb1fc08c55a
2017-01-23 07:20:32 +00:00
Erik Kline
b0949a3ede Merge "More concisely export whether we have a "tetherable configuration""
am: 1f2437c65a

Change-Id: I5f9717c9dab6b39f1fbf2186107b2a1f3f2d4f8f
2017-01-23 07:13:56 +00:00
Treehugger Robot
1f2437c65a Merge "More concisely export whether we have a "tetherable configuration"" 2017-01-23 07:04:22 +00:00
Erik Kline
21933391e8 More concisely export whether we have a "tetherable configuration"
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - vanilla WiFi-to-mobile tethering works
Bug: 32163131
Change-Id: I20dd36b5bf7fc55a639c76ea4bdb55b650654881
2017-01-23 13:04:28 +09:00
Jeff Sharkey
3d4135dd9d Merge "StrictMode to detect untagged network traffic." 2017-01-20 17:31:59 +00:00
TreeHugger Robot
9de405bfbe Merge "ConnectivityServiceTest: some fixes in CallbackInfo" 2017-01-20 09:43:19 +00:00
Hugo Benichi
6b09d953e9 Merge "DO NOT MERGE Unit tests for NetworkNotificationManager" am: 216a4e7655 -s ours am: dfcad2252b -s ours am: 03b7f286ca
am: d6377b3d0c  -s ours

Change-Id: I65b787f2752eb7b17ec175336a7f25ba23529781
2017-01-20 08:31:57 +00:00
Hugo Benichi
d6377b3d0c Merge "DO NOT MERGE Unit tests for NetworkNotificationManager" am: 216a4e7655 -s ours am: dfcad2252b -s ours
am: 03b7f286ca

Change-Id: I78a3f6ffb4e1906906bf218dd11c8f65c5d3c96b
2017-01-20 07:59:43 +00:00
Hugo Benichi
2c60db16ef ConnectivityServiceTest: some fixes in CallbackInfo
- CallbackInfo becomes a static class so that it can be instantiated
  and looked at more easily than before.
- CallbackInfo gains hashCode() because it has equals().
- effectively final field are qualified final
- fixes bug when polling the next callback: poll() on a LinkedBlockingQueue
  returns null when timing out, which was not failing the test cleanly.

Test: ConnectivityServiceTest passes
Bug: 32561414

(cherry picked from commit b573a2964c)

Change-Id: Ica5f1609975e4b256f4e2f3dc2ac84362e762da2
2017-01-20 16:56:41 +09:00
Hugo Benichi
03b7f286ca Merge "DO NOT MERGE Unit tests for NetworkNotificationManager" am: 216a4e7655 -s ours
am: dfcad2252b  -s ours

Change-Id: I847fe5f04ebf8b5634c3ae0974e69d50cef9df76
2017-01-20 07:55:35 +00:00
Hugo Benichi
dfcad2252b Merge "DO NOT MERGE Unit tests for NetworkNotificationManager"
am: 216a4e7655  -s ours

Change-Id: I05fe9095395df00b96df3cbe3a6e4f31a160e0b5
2017-01-20 07:51:31 +00:00
Hugo Benichi
f4fcd280f1 DO NOT MERGE Unit tests for NetworkNotificationManager
Test: new unit test, no functional changes.
Bug: 32198726

(cherry picked from commit baebb23d3c)

Change-Id: I123de68de9ae353b95edce89eb570cfbb5f8d9a3
2017-01-20 15:08:38 +09:00
Jeff Sharkey
475c3eadb0 StrictMode to detect untagged network traffic.
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.

To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.

Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
2017-01-19 20:52:05 -07:00
sj.cha
a256f19d3a Infinite reboot when OS upgrade from M to N with set Always-on VPN
Symptom : Infinite reboot

Reproduce step :
1. Set the Always-on VPN in M OS
2. OS upgrade from M to N

Reproduce frequency : 100%

Reason of issue :
https://android.googlesource.com/platform/frameworks/base/+/9b74791
As you know, in M OS, Always-on VPN information is stored in keystore with encryted.
However, in N OS, there is no encryption when it put in keystore.
So, You deleted keystore check(locked/unlock) logic on ConnectivityService.
By this reason, when device upgrade to N OS(set Always-on VPN), it goes infinite boot.
(Cannot read old always-on vpn information untill device unlock.)

Solution :
I founded exception handling when this case as follows:
If getting Credentials.LOCKDOWN_VPN information has null value(catch the exception),
updateLockdownVpn returns false value.

Signed-off-by: SangJin Cha <sj.cha@lge.com>
Change-Id: I6fd980152440bb5248aab45e2f8fda448d3f6c7b
2017-01-20 12:40:15 +09:00
Tamas Berghammer
b4958e68d1 Merge "DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"" into nyc-mr1-dev-plus-aosp am: a05cbcb4b1
am: 3b9f1466b1  -s ours

Change-Id: Ie697d5efaea39e1522e947ac1a8f38f1443a1964
2017-01-18 22:38:09 +00:00
Tamas Berghammer
1e5b34d567 DO NOT MERGE: Revert "Update package names to work with the proto3 compiler" am: 4dac494ece -s ours
am: 8ad263e479  -s ours

Change-Id: I17090081cb6721124d3ba513f8d59f1982764cb8
2017-01-18 22:12:04 +00:00
Tamas Berghammer
3b9f1466b1 Merge "DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"" into nyc-mr1-dev-plus-aosp
am: a05cbcb4b1

Change-Id: I9d5789a9c4f12c12c5cc13eb8f92d3084a818440
2017-01-18 20:32:44 +00:00
Tamas Berghammer
8ad263e479 DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"
am: 4dac494ece  -s ours

Change-Id: I09a58385e10e135af06dff346624dcbc9eb76a4f
2017-01-18 20:22:57 +00:00
Tamas Berghammer
9443bca1e9 Merge "Update package names to work with the proto3 compiler" into nyc-mr1-dev-plus-aosp am: 4ce688e0d8
am: 0d53c255ad

Change-Id: I229a5c77a0dc5d75afc43669eb1d58d16f492844
2017-01-18 20:02:42 +00:00
Tamas Berghammer
a05cbcb4b1 Merge "DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"" into nyc-mr1-dev-plus-aosp 2017-01-18 19:59:59 +00:00
Tamas Berghammer
04ff5d580f Update package names to work with the proto3 compiler am: 0c0c8f7825 -s ours
am: 3c5feceabd

Change-Id: I092a61abba417a71fe1a8eb9d29016e74808feb2
2017-01-18 19:55:14 +00:00
Tamas Berghammer
4dac494ece DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"
This reverts commit 0c0c8f7825.

Change-Id: I6e8d193fa22e0e7e30b214c13ae0480d3c9b0dc6
2017-01-18 19:33:22 +00:00
Tamas Berghammer
0d53c255ad Merge "Update package names to work with the proto3 compiler" into nyc-mr1-dev-plus-aosp
am: 4ce688e0d8

Change-Id: Ia944e535f7329c32bf34770fb0d99019cc1091f9
2017-01-18 18:06:43 +00:00
Tamas Berghammer
3c5feceabd Update package names to work with the proto3 compiler
am: 0c0c8f7825  -s ours

Change-Id: I8c957a9ad00cb393dbaaa05bec9730cc3a84a94e
2017-01-18 17:44:23 +00:00
Tamas Berghammer
4ce688e0d8 Merge "Update package names to work with the proto3 compiler" into nyc-mr1-dev-plus-aosp 2017-01-18 12:58:01 +00:00
Tony Mak
a631cff09b DO NOT MERGE: Show notification for always-on app VPN
am: dc464b9525  -s ours

Change-Id: I8af0a0746154d5774b0fb841616b57ce65a36707
2017-01-18 10:49:08 +00:00
Stephen Chen
eaef497013 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
am: 5df334f572  -s ours

Change-Id: I970aed286a5bcc69d2ee69ea23b53af36dc2bbea
2017-01-18 10:48:16 +00:00
Hugo Benichi
7879e7c7c9 DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings
am: 0bcc4a517e  -s ours

Change-Id: Ifdac8feb994342d18a0795a676da558445867b1f
2017-01-18 10:47:07 +00:00
Hugo Benichi
151e0a67ee DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark
am: 020844b6cf  -s ours

Change-Id: Iccb849a88e017c3189b2c374a98c44dc58085861
2017-01-18 10:46:07 +00:00
Felipe Leme
7f60f6a75b DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
am: 5210ff9305  -s ours

Change-Id: I4c92c8bfe7cd19839a86a63e5afb3b3868a63825
2017-01-18 10:43:14 +00:00