Commit Graph

2935 Commits

Author SHA1 Message Date
Hugo Benichi
82e85fedb6 DO NOT MERGE IpConnectivityMetrics reads buffer size in settings
am: 8e597e85f6

Change-Id: I5c433faa0d43202ae1169fdba4c42c09dd9c17dd
2016-12-13 04:08:18 +00:00
Hugo Benichi
ee0f284908 DO NOT MERGE IpConnectivity metrics: add version number
am: 62e743bc9d

Change-Id: Iccdf7d09ef4dc80f05c76774c456b5effb2c08c7
2016-12-13 04:05:08 +00:00
Hugo Benichi
8e597e85f6 DO NOT MERGE IpConnectivityMetrics reads buffer size in settings
Test: IpConnectivityMetricsTest passes. Also manually changed the new
setting and verified the buffer size is as expected after flushing the
buffer.
Bug: 32198637

(cherry pick from commit 05686dbb6b965eb1a54591d2ed2334337886c6ee)

Change-Id: Ie7ca1638533479601c5983bb6e54705003561b6c
2016-12-13 10:20:03 +09:00
Hugo Benichi
62e743bc9d DO NOT MERGE 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 d680d4c856f54bea0c60dea74ba4204822391e49)

Change-Id: I5f37633afd9ec82f5402c5b6670fe2febae82a14
2016-12-13 10:19:13 +09:00
Hugo Benichi
d3c9fb118c DO NOT MERGE Captive portal systel log improvements
am: 47230f539a

Change-Id: Icbba206e8c035f566ff6d9e500d972a3dcf65bb6
2016-12-13 00:32:46 +00:00
Erik Kline
f559069d8b Merge "Stop setting net.dns{1234} system properties." am: 269d35f870 am: cc122a0d6c
am: 43d5129fe5

Change-Id: I38d6608f64076ffa3300255eb66c51c32e590b0f
2016-12-12 08:41:47 +00:00
Erik Kline
43d5129fe5 Merge "Stop setting net.dns{1234} system properties." am: 269d35f870
am: cc122a0d6c

Change-Id: I7d400352de4bc11204cd1ec8c9aeda5381cd4931
2016-12-12 08:35:20 +00:00
Erik Kline
cc122a0d6c Merge "Stop setting net.dns{1234} system properties."
am: 269d35f870

Change-Id: I9b31b281896995943ce8217c3230867db380a841
2016-12-12 08:29:14 +00:00
Treehugger Robot
269d35f870 Merge "Stop setting net.dns{1234} system properties." 2016-12-12 08:16:35 +00:00
Lorenzo Colitti
c568d45d23 Merge changes from topic 'framework-net-aosp' am: 5ad2853426 am: 1a2fa0f372
am: 7fbb7d397d

Change-Id: Idb0e86655f5d4f835796f5ebe31da99e419d66bf
2016-12-09 10:53:48 +00:00
Hugo Benichi
c88e0b2ab3 DO NOT MERGE: frameworks-test: adding missing @SmallTest am: 787d3da986 -s ours am: 9f65f04157 -s ours
am: 6bca82763d

Change-Id: Ib6a8f4b7ca365ab5cb42b9e57311228be273075a
2016-12-09 10:40:12 +00:00
Hugo Benichi
5f35a1cd5c DO NOT MERGE: Netd events: record connect() success/errno am: 74e67ae938 -s ours am: d84f932680 -s ours
am: 3a00c6b08e

Change-Id: Ic83b2d46bc4d25878c70c0a02d39f14ecbeab84f
2016-12-09 10:39:20 +00:00
Tony Mak
2296ffa69d DO NOT MERGE: Show notification for always-on app VPN am: c777123d5c -s ours am: 118071a481 -s ours
am: 22f0d5b47d

Change-Id: I871444d296f0c49f587e98d1e0b760846da37c13
2016-12-09 10:37:38 +00:00
Stephen Chen
4006015842 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries. am: 757658193d -s ours am: 3f5785260e -s ours
am: 179fbd9c84

Change-Id: Ic0f11bdb50d43c0dd9c449ae3c784b0214b865e3
2016-12-09 10:36:45 +00:00
Hugo Benichi
5b186cc142 DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings am: b1bddc92c5 -s ours am: a30ae5542b -s ours
am: 858eef0c7d

Change-Id: Iebd06f7c03b2068314c24a14a2b38d2413b88536
2016-12-09 10:32:40 +00:00
Hugo Benichi
dfc0ec7c84 DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark am: 8436dae4c3 -s ours am: 0bef352535 -s ours
am: 11051ef7f8

Change-Id: I7379d8223778d3f2df97d88c0d6f291df219c579
2016-12-09 10:31:27 +00:00
Felipe Leme
94a8f25fc6 DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock. am: 6670ab4480 -s ours am: fbbaf25665 -s ours
am: 2672fd0196

Change-Id: I4aa888c55824eba58b7e0af78b510a144608e704
2016-12-09 10:28:28 +00:00
Felipe Leme
26ca4d4d4b DO NOT MERGE: Use @Ignore to explicitly disable a @Test method. am: b8a440f538 -s ours am: b296948b3b -s ours
am: 38dd9dec90

Change-Id: Icaa4e18775b6e810738fb9d180ea20f7ce5c4506
2016-12-09 10:27:35 +00:00
Felipe Leme
2418431e4a DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4. am: 00a6e6c111 -s ours am: 82393f7b98 -s ours
am: 0866b93abf

Change-Id: I4acc3df60493e5ac388772f8c0e22ac92bc3ce4c
2016-12-09 10:26:08 +00:00
Jeremy Joslin
826d4ea141 DO NOT MERGE: VPN network stat accounting changes. am: 8c7be6114c -s ours am: 12bb3f057b -s ours
am: 652c3e59e9

Change-Id: Ie33371e7e4e47071aa9f74fef93ddf2cff2ec57a
2016-12-09 10:25:17 +00:00
Hugo Benichi
8e2798c72d DO NOT MERGE: ConnectivityThread: use lazy holder idiom am: 8f201294fe -s ours am: f6cb43ae32 -s ours
am: fde28b4f2b

Change-Id: I121ad24bed0fa12b80110b1058ad4279ec9c0107
2016-12-09 10:24:20 +00:00
Hugo Benichi
4a9ef15314 DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper am: 301b09738a -s ours am: 7337239702 -s ours
am: 8358a5fbdf

Change-Id: If52ab02bd501d4b071f24ddf8abdfe344e7358eb
2016-12-09 10:23:28 +00:00
Hugo Benichi
d886103e29 DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler am: 56260ed9cb -s ours am: ef148edaa2 -s ours
am: 7135d5e6f2

Change-Id: I7c177123057676622e1aa43c68676ee06ed60ee6
2016-12-09 10:22:25 +00:00
Jeremy Klein
14667351d8 DO NOT MERGE: Add a null check for the OnStartTetheringCallback. am: fb63d5a4ef -s ours am: 3cd1ae2261 -s ours
am: aa7506310c

Change-Id: I897f28d2b002e1a2aa6be8ec423a1c9b1d5b761b
2016-12-09 10:20:04 +00:00
Lorenzo Colitti
7fbb7d397d Merge changes from topic 'framework-net-aosp' am: 5ad2853426
am: 1a2fa0f372

Change-Id: I746ee7fd37946df2ba31ca8aee928fa3ef04591c
2016-12-09 10:18:11 +00:00
Hugo Benichi
6bca82763d DO NOT MERGE: frameworks-test: adding missing @SmallTest am: 787d3da986 -s ours
am: 9f65f04157  -s ours

Change-Id: I717dbbd4d3ed657fec9ed9f45a5ae6f3e2a04b3e
2016-12-09 10:08:43 +00:00
Hugo Benichi
3a00c6b08e DO NOT MERGE: Netd events: record connect() success/errno am: 74e67ae938 -s ours
am: d84f932680  -s ours

Change-Id: I2e11ad15c3327a1d57453295ebc904dcf68ec3e0
2016-12-09 10:07:51 +00:00
Tony Mak
22f0d5b47d DO NOT MERGE: Show notification for always-on app VPN am: c777123d5c -s ours
am: 118071a481  -s ours

Change-Id: I35f5107f9984284379136fd86c57432317066e68
2016-12-09 10:05:30 +00:00
Stephen Chen
179fbd9c84 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries. am: 757658193d -s ours
am: 3f5785260e  -s ours

Change-Id: Ib6f4a4af04c3f4e26028604c66f6cc4f1720a801
2016-12-09 10:04:41 +00:00
Hugo Benichi
858eef0c7d DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings am: b1bddc92c5 -s ours
am: a30ae5542b  -s ours

Change-Id: If1fe794f87060443d721f0f269f519046a9ee321
2016-12-09 10:00:41 +00:00
Hugo Benichi
11051ef7f8 DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark am: 8436dae4c3 -s ours
am: 0bef352535  -s ours

Change-Id: I92e3730002c11f3c2d5ea9c324f61237190f44bc
2016-12-09 09:59:49 +00:00
Felipe Leme
2672fd0196 DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock. am: 6670ab4480 -s ours
am: fbbaf25665  -s ours

Change-Id: I66000b3cd40a8494ad144610436f6ee953821a06
2016-12-09 09:57:16 +00:00
Felipe Leme
38dd9dec90 DO NOT MERGE: Use @Ignore to explicitly disable a @Test method. am: b8a440f538 -s ours
am: b296948b3b  -s ours

Change-Id: I43b77614b0ccdd573cf8b29b08ef518bad617aff
2016-12-09 09:55:47 +00:00
Felipe Leme
0866b93abf DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4. am: 00a6e6c111 -s ours
am: 82393f7b98  -s ours

Change-Id: I175601094ae486700c8a6886470abb3147b6ef4e
2016-12-09 09:54:55 +00:00
Jeremy Joslin
652c3e59e9 DO NOT MERGE: VPN network stat accounting changes. am: 8c7be6114c -s ours
am: 12bb3f057b  -s ours

Change-Id: Id9d26bf1b9512a85cd9b6a3253b86b77a6f62e77
2016-12-09 09:54:07 +00:00
Hugo Benichi
fde28b4f2b DO NOT MERGE: ConnectivityThread: use lazy holder idiom am: 8f201294fe -s ours
am: f6cb43ae32  -s ours

Change-Id: I08a03dd249d30bc474a5d16472883737d12fec37
2016-12-09 09:53:16 +00:00
Hugo Benichi
8358a5fbdf DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper am: 301b09738a -s ours
am: 7337239702  -s ours

Change-Id: Ida0d76b540e800db215569717a1c5d26e0f583b0
2016-12-09 09:52:26 +00:00
Hugo Benichi
7135d5e6f2 DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler am: 56260ed9cb -s ours
am: ef148edaa2  -s ours

Change-Id: Ie8ebf41835e62b64ceb22e552208c77482d96c73
2016-12-09 09:50:57 +00:00
Jeremy Klein
aa7506310c DO NOT MERGE: Add a null check for the OnStartTetheringCallback. am: fb63d5a4ef -s ours
am: 3cd1ae2261  -s ours

Change-Id: I3c471a8971c21cdbf1ebf7e1302524b038b20375
2016-12-09 09:48:50 +00:00
Lorenzo Colitti
5ad2853426 Merge changes from topic 'framework-net-aosp'
* changes:
  DO NOT MERGE: frameworks-test: adding missing @SmallTest
  DO NOT MERGE: Netd events: record connect() success/errno
  DO NOT MERGE: Add missing dependency.
  DO NOT MERGE: Show notification for always-on app VPN
  DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
  DO NOT MERGE: NetworkMonitor: send one DNS probe per web probe
  DO NOT MERGE: NetworkMonitor metrics: add first validation information
  DO NOT MERGE: APF: also drop any ICMPv6 RSs
  DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings
  DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark
  DO NOT MERGE: Switch over to new "time.android.com" NTP pool.
  DO NOT MERGE: Define API for metering network stats buckets.
  DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.
  DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.
  DO NOT MERGE: VPN network stat accounting changes.
  DO NOT MERGE: ConnectivityThread: use lazy holder idiom
  DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper
  DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler
  DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  DO NOT MERGE: Add a null check for the OnStartTetheringCallback.
2016-12-09 09:11:22 +00:00
Hugo Benichi
47230f539a DO NOT MERGE Captive portal systel log improvements
This patch improves system logging around captive portal detection to
make inspection of bug reports sligthly easier:

- NetworkMonitor now logs by default CMD_CAPTIVE_PORTAL_RECHECK and
  CMD_CAPTIVE_PORTAL_APP_FINISHED. Other system logs are kept off with
  a new VDBG boolean contant,
- NetworkNotificationManager now prints the notification id at
  notification time. This allows to easily correlate show and clear.
- errors in NetworkNotificationManager are logged as Throwable instead
  of through their implicit toString() method.

Test: $ runtest frameworks-net
Bug: 32198726

(cherry picked from commit 8b025bf108c729156b40159038befa0e6c5bebce)

Change-Id: I7780c389a94c4b9fa226f53b02fe5960d1c08618
2016-12-09 16:14:32 +09:00
Hugo Benichi
787d3da986 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: I7b0706a7e3368f971d508388e8ad4afc5de9d646
2016-12-09 14:35:05 +09:00
Hugo Benichi
74e67ae938 DO NOT MERGE: Netd events: record connect() success/errno
Test: $ runtest frameworks-net pass
Bug: 32198976

(cherry picked from commit 8b06bcdfd24100302818ae0e11ee751dd813d5cf)
2016-12-09 14:34:39 +09:00
Tony Mak
c777123d5c DO NOT MERGE: Show notification for always-on app VPN
This is the same notification as the one shown during legacy lockdown
mode, sans the 'reset' button.

The notification is only shown during times when VPN has not yet
established or has failed, for example during boot or after a crash.

Bug: 29123115

(cherry picked from commit 9ca892f698)

Change-Id: I929a05c24df01e21415535a333bb14ac4b790a9d
2016-12-09 14:23:10 +09:00
Stephen Chen
757658193d DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 9369e9d105)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a
2016-12-09 13:59:33 +09:00
Hugo Benichi
b1bddc92c5 DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings
This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.

This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.

Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.

With this change the test has been observed to pass with 100% success
rate over 50000 invocations.

Test: $ runtest frameworks-net
Bug: 32561414

(cherry picked from commit b54c8cffa8)

Change-Id: If41a24989d5f65aeb439f68741f511b5eb53b18d
2016-12-09 13:59:19 +09:00
Hugo Benichi
8436dae4c3 DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark
This patch fixes flakyness of testRequestBenchmark by adjusting time
limit for callback registration from 100ms to 180ms, and time limits for
onAvailable and onLost triggers from 30ms to 40ms.

With these timeouts the test succeeds 100% over 5000 iterations.

When using 150ms for registration timeout, running the test 5000 times
fails 2 times.

When using 30ms for onLost timeout, running the test 5000 times fails
1 times.

In addition, this patch also cleans testRequestBenchmark and uses the
more stable SystemClock.elapsedRealtime() for duration measurements.

Test: $ runtest frameworks-net
Bug: 32561414

(cherry picked from commit 766e564647)

Change-Id: I196ab9ef7f5abe456a783eed65db09279d2ecb8c
2016-12-09 13:59:18 +09:00
Felipe Leme
6670ab4480 DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.net.NetworkStatsServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 30943463

(cherry picked from commit de2a6f1b1d)

Change-Id: Ia9929295ab2396a7ebb133e65d157f98414e4dfa
2016-12-09 13:59:14 +09:00
Felipe Leme
b8a440f538 DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.
BUG: 30839080
BUG: 31007021

(cherry picked from commit a4dc2a7129)

Change-Id: I35942e60493adebb22871541a34240368c691ee7
2016-12-09 13:59:10 +09:00
Felipe Leme
00a6e6c111 DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.
Most tests were failing because due to a null NetworkCapabilities.
Example:

1) testNetworkStatsWifi(com.android.server.net.NetworkStatsServiceTest)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkCapabilities.hasCapability(int)' on a null object reference
	at
	com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:983)

BUG: 30839080

(cherry picked from commit f96df4b298)

Change-Id: Ie09b2f43cf6ec745e404d5ec98bd0b072d211ea3
2016-12-09 13:59:04 +09:00