Commit Graph

279392 Commits

Author SHA1 Message Date
Lorenzo Colitti
fb636d1faa DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest. am: 5bce5a16b1 -s ours am: efd928fe56 -s ours
am: 5cf18abca9

Change-Id: I1846d606bdcc35b099f03554107f8ccfe0704a93
2016-12-08 11:32:26 +00:00
Lorenzo Colitti
3cf39b018c DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net. am: 7ceef950a0 -s ours am: d1e22a3f07 -s ours
am: 4c4a86fd4d

Change-Id: I6b52a0383884ad41b1601bdd9cf976f58c0dcefd
2016-12-08 11:31:13 +00:00
Lorenzo Colitti
77852d0a9f DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils. am: 3c295b59f5 -s ours am: bcb7e32954 -s ours
am: eb7b7664cb

Change-Id: I261c10f930d32c6d69d0ced4d0d7d81f3357cf63
2016-12-08 11:30:17 +00:00
Lorenzo Colitti
0c34c32534 DO NOT MERGE: Move FakeSettingsProvider to a common location. am: b8df76e413 -s ours am: a84ede299c -s ours
am: 33b238bd42

Change-Id: I3e877a603c1c19af15e5f38d4e0301dfddfc6f39
2016-12-08 11:29:28 +00:00
Hugo Benichi
80587a02cc DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such am: 5d540d1410 -s ours am: e47b0886ad -s ours
am: 412e89fe9f

Change-Id: If5133073f09b59b0458c1784b9d288f9a176c568
2016-12-08 11:28:34 +00:00
Calvin On
c39a37c0d6 DO NOT MERGE: Add option to skip and avoid captive portals. am: 1f64f3fd14 -s ours am: 8006bd5c66 -s ours
am: 573880a198

Change-Id: I7e7f6fa8d643bbd83c9b73614f80d202e3f28f20
2016-12-08 11:27:11 +00:00
Hugo Benichi
52587963ca DO NOT MERGE: ApfFilter: use elapsedRealTime for RA lifetime am: dafc44ea11 -s ours am: d063978acf -s ours
am: 9c37634688

Change-Id: I08c00727a2746760d78f03e90a2fcbadf60ce2d2
2016-12-08 11:26:19 +00:00
Hugo Benichi
9a686a26c6 DO NOT MERGE: Do not synchronize boolean reads/writes am: 94dcb3c3fd -s ours am: eb98bc95d2 -s ours
am: a63d5e5fd8

Change-Id: I4de7bc73125acad6e45783835a9ec6063b5e260b
2016-12-08 11:25:31 +00:00
Hugo Benichi
eaf63414bf DO NOT MERGE: ApfFilter: systematically use u8, u16, u32 getters am: 4104ff9220 -s ours am: 2889968553 -s ours
am: 02f1650458

Change-Id: I40383c9c322d7bf3eb85f74202e79d0fa19cffa5
2016-12-08 11:24:38 +00:00
Hugo Benichi
796a0babf9 DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing am: 0668a61d82 -s ours am: 976ef7538a -s ours
am: 046c5a3119

Change-Id: Id643a779050fa557632117e90dd9f1f6589fbd5e
2016-12-08 11:23:17 +00:00
Erik Kline
cea7843c61 DO NOT MERGE: Support timeouts for requestNetwork() invocations. am: 3841a48d0a -s ours am: eb6be2c826 -s ours
am: e8dda0f7e4

Change-Id: I3cba7c98328a4237105243502fe148ed6a35ef48
2016-12-08 11:22:25 +00:00
Pierre Imai
59d46341c8 DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network. am: accd5fcb79 -s ours am: 8a73b2896d -s ours
am: a8500b7efc

Change-Id: I20016d9056888897515e6a4b4296e3ea76f11b61
2016-12-08 11:21:31 +00:00
Lorenzo Colitti
5cf18abca9 DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest. am: 5bce5a16b1 -s ours
am: efd928fe56  -s ours

Change-Id: I08660dacb99bb50654157ce5d507247339cd2348
2016-12-08 11:05:48 +00:00
Lorenzo Colitti
4c4a86fd4d DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net. am: 7ceef950a0 -s ours
am: d1e22a3f07  -s ours

Change-Id: I92f0f18ed7ee196f1cdb1369393ff7c4e2c800fc
2016-12-08 11:04:38 +00:00
Lorenzo Colitti
eb7b7664cb DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils. am: 3c295b59f5 -s ours
am: bcb7e32954  -s ours

Change-Id: I377b66283b29bb97e02ec796352bc3a5dbea1454
2016-12-08 11:03:45 +00:00
Lorenzo Colitti
33b238bd42 DO NOT MERGE: Move FakeSettingsProvider to a common location. am: b8df76e413 -s ours
am: a84ede299c  -s ours

Change-Id: Ia6f433944c63245436199b8b9b1a022794ab939e
2016-12-08 11:02:57 +00:00
Hugo Benichi
412e89fe9f DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such am: 5d540d1410 -s ours
am: e47b0886ad  -s ours

Change-Id: I803b51cae7b20502d11701cb99ab3816d6995555
2016-12-08 11:02:09 +00:00
Calvin On
573880a198 DO NOT MERGE: Add option to skip and avoid captive portals. am: 1f64f3fd14 -s ours
am: 8006bd5c66  -s ours

Change-Id: I9984984de7f72e23fbc11e972ff851a1d2adc6c1
2016-12-08 11:00:46 +00:00
Hugo Benichi
9c37634688 DO NOT MERGE: ApfFilter: use elapsedRealTime for RA lifetime am: dafc44ea11 -s ours
am: d063978acf  -s ours

Change-Id: Iae654ce24cba1e968f14b8b6cd74446c99135b0c
2016-12-08 11:00:00 +00:00
Hugo Benichi
a63d5e5fd8 DO NOT MERGE: Do not synchronize boolean reads/writes am: 94dcb3c3fd -s ours
am: eb98bc95d2  -s ours

Change-Id: I897ff8b2072a4fcbf42e88d4ad61ffcec2d85331
2016-12-08 10:59:14 +00:00
Hugo Benichi
02f1650458 DO NOT MERGE: ApfFilter: systematically use u8, u16, u32 getters am: 4104ff9220 -s ours
am: 2889968553  -s ours

Change-Id: I935fd216a905688a51d928dada3485a0117dbbf1
2016-12-08 10:58:28 +00:00
Hugo Benichi
046c5a3119 DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing am: 0668a61d82 -s ours
am: 976ef7538a  -s ours

Change-Id: I10b1ea356622de68d75ee65f8ab4ae937c11171a
2016-12-08 10:57:26 +00:00
Erik Kline
e8dda0f7e4 DO NOT MERGE: Support timeouts for requestNetwork() invocations. am: 3841a48d0a -s ours
am: eb6be2c826  -s ours

Change-Id: Id91b2267ffcd7c66a1be8e01761ffb1d943082d3
2016-12-08 10:56:13 +00:00
Pierre Imai
a8500b7efc DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network. am: accd5fcb79 -s ours
am: 8a73b2896d  -s ours

Change-Id: Ic529525e6671da1b6a85890c8eb40238b07da2b3
2016-12-08 10:54:56 +00:00
Lorenzo Colitti
efd928fe56 DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest.
am: 5bce5a16b1  -s ours

Change-Id: I820b911f737e8b00ff3069505a2412ba9fdf3e1c
2016-12-08 10:13:37 +00:00
Lorenzo Colitti
d1e22a3f07 DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net.
am: 7ceef950a0  -s ours

Change-Id: I866c317dbec720a5ec6c64b1e7e14437d132ce7e
2016-12-08 10:12:57 +00:00
Lorenzo Colitti
bcb7e32954 DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils.
am: 3c295b59f5  -s ours

Change-Id: I72123940742a0ca1418f8c892da82b6bb984f4ae
2016-12-08 10:11:44 +00:00
Lorenzo Colitti
a84ede299c DO NOT MERGE: Move FakeSettingsProvider to a common location.
am: b8df76e413  -s ours

Change-Id: I017a302961d252a3fe4e062a0642b79d64230f54
2016-12-08 10:11:01 +00:00
Hugo Benichi
e47b0886ad DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such
am: 5d540d1410  -s ours

Change-Id: I2bd4e64b397fe2bd6ec8a11b02753c26df1a2000
2016-12-08 10:10:22 +00:00
Calvin On
8006bd5c66 DO NOT MERGE: Add option to skip and avoid captive portals.
am: 1f64f3fd14  -s ours

Change-Id: I549bc49715a6476069f30aa206d8b4d1310fe6c5
2016-12-08 10:09:43 +00:00
Hugo Benichi
d063978acf DO NOT MERGE: ApfFilter: use elapsedRealTime for RA lifetime
am: dafc44ea11  -s ours

Change-Id: Ic80e642dffa4f1246e91aeaa5bdedf450f703ccd
2016-12-08 10:09:05 +00:00
Hugo Benichi
eb98bc95d2 DO NOT MERGE: Do not synchronize boolean reads/writes
am: 94dcb3c3fd  -s ours

Change-Id: If30f221e24c897be9e2fddf66a9d6c9db2b5a431
2016-12-08 10:08:15 +00:00
Hugo Benichi
2889968553 DO NOT MERGE: ApfFilter: systematically use u8, u16, u32 getters
am: 4104ff9220  -s ours

Change-Id: I699a4d4403e21c3ebb59e29c7732dba78eb006d7
2016-12-08 10:07:12 +00:00
Hugo Benichi
976ef7538a DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing
am: 0668a61d82  -s ours

Change-Id: I961d0fd200c1317e1e81657071acf1fe7ae43f6f
2016-12-08 10:06:34 +00:00
Erik Kline
eb6be2c826 DO NOT MERGE: Support timeouts for requestNetwork() invocations.
am: 3841a48d0a  -s ours

Change-Id: Ia0431810a2a2081116bc5c31b4c6a37ab09a69ad
2016-12-08 10:05:58 +00:00
Pierre Imai
8a73b2896d DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network.
am: accd5fcb79  -s ours

Change-Id: Ib54fcd8b268872bc599e2b4dedaa7bbb4d7f8956
2016-12-08 10:05:18 +00:00
Lorenzo Colitti
5bce5a16b1 DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest.
This was broken by the implementation of IPv6 tethering, which
relies on various private classes which end up calling unmockable
final classes like NetworkInterface.

Making everything public like this is almost certainly not the
best way of fixing this test, but on the other hand there is
value to the test continuing to pass.

Test: runtest frameworks-net  # Everything passes.
Test: IPv6 tethering continues to work.

(cherry picked from commit 7e0eeca8ba)

Change-Id: I8a3cf466871c026f4ae0f5cfa73071338cdf5b7e
2016-12-08 17:13:36 +09:00
Lorenzo Colitti
7ceef950a0 DO NOT MERGE: 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 ecc986d430)

Change-Id: I993eeaa5dec001c39389023f355f506129b356e7
2016-12-08 17:13:35 +09:00
Lorenzo Colitti
3c295b59f5 DO NOT MERGE: 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 281a17c958)

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
2016-12-08 17:13:35 +09:00
Lorenzo Colitti
b8df76e413 DO NOT MERGE: Move FakeSettingsProvider to a common location.
(cherry picked from commit 7df1a82802)

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
2016-12-08 17:13:34 +09:00
Hugo Benichi
5d540d1410 DO NOT MERGE: 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 c8c1027762)

Change-Id: I3c702bd981ed80ed606be0fb52d61eb3d7195a6f
2016-12-08 17:13:34 +09:00
Calvin On
1f64f3fd14 DO NOT MERGE: 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 be96da11cc)

Change-Id: I90c0f97fe0e41de4059bceae7b56ab3a70145696
2016-12-08 17:13:33 +09:00
Hugo Benichi
dafc44ea11 DO NOT MERGE: ApfFilter: use elapsedRealTime for RA lifetime
This patch replaces System.currentTimeMillis() with
SystemClock.elapsedRealTime() to make RA lifetime computation more
resilient to various external events inducing jumps in
currentTimeMillis().

Test: ApfTest passes.

(cherry picked from commit 305af8e98a)

Change-Id: If19011fc0c905948f2e42b975cfcc5f8672a95fb
2016-12-08 17:13:33 +09:00
Hugo Benichi
94dcb3c3fd DO NOT MERGE: Do not synchronize boolean reads/writes
This patch removes the synchronization around the private variable
mRunning inside of IpReachabilityMonitor and instead qualifeis the field
as volatile.

Synchronization is not needed for reads/writes on native fields or
object references because they are already guaranteed to be atomic.

Synchronization here was used for enforcing memory visibility across
concurrent threads indirectly through monitor acquire/release.
The volatile keyword achieves this in a more explicit way.

Also, this patch changes the way that probeAll() copies the
IpReachabilityMonitor's mIpWatchList by temporary holding mIpWatchList
keys into an ArrayList instead of a more expensive HashSet. Since Java
HashSet are just degenerated HashMaps, and that key iteration order is
based on key hash, the iteration order over this temporary collection
will be consistent for the same mIpWatchList.

Test: refactoring CL. Existing unit tests still pass.

(cherry picked from commit b0f1186c03)

Change-Id: I48d2b4d837a459150cd431b400ec01b87b48c014
2016-12-08 17:13:32 +09:00
Hugo Benichi
4104ff9220 DO NOT MERGE: ApfFilter: systematically use u8, u16, u32 getters
This patch adds a getUint8 getter for ByteBuffers and changes ApfFilter
to make uses of getUint8/16/32 everywhere.

The return types of getUint16 is also changed from long to int, which
will expand gracefully to long as an unsigned int as it is guaranteed to
be positive after getUint16.

Test: ApfTest passes

(cherry picked from commit 995dd94673)

Change-Id: I606ebc5aedfcacde400d27cc6bc37145769b122c
2016-12-08 17:13:32 +09:00
Hugo Benichi
0668a61d82 DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing
Test: added new unit tests

(cherry picked from commit 8acea76a2b)

Change-Id: I847d7e4895766042043c0bba1c9b9a698a705d87
2016-12-08 17:13:31 +09:00
Erik Kline
3841a48d0a DO NOT MERGE: Support timeouts for requestNetwork() invocations.
(cherry-pick of 06c3ef1367)
(cherry picked from commit 57faba9ec7)

Bug: 21414325
Change-Id: I1a58823a372154589f972b98c4c428eab0e0523e
2016-12-08 17:13:01 +09:00
Pierre Imai
accd5fcb79 DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is
specified for a given network.

Bug: 10705136

(cherry picked from commit 54f0d9edbf)

Change-Id: I89e2fdfbbfa981d435a2974422d9d9c009872d76
2016-12-08 16:49:22 +09:00
Android Build Merger (Role)
430e097e3f Merge "Revert "Fix vulnerability in MemoryIntArray" am: 1f06508bc6 am: 64b5725900 am: 60357eb6bd am: 590b77da13 am: 061d2b6cad" into nyc-mr2-dev-plus-aosp 2016-12-08 02:49:47 +00:00
Svetoslav Ganov
90cf2c30df Revert "Fix vulnerability in MemoryIntArray" am: 1f06508bc6 am: 64b5725900 am: 60357eb6bd am: 590b77da13
am: 061d2b6cad

Change-Id: I23693c48099398e0d2760f5be984879fd9b513db
2016-12-08 02:48:58 +00:00