Commit Graph

4322 Commits

Author SHA1 Message Date
Hugo Benichi
2d2b500068 Merge "ConnectivityServiceTest: fix flakyness" am: 8222ec90c6 am: 004f36d5bc
am: eb9d0f16aa

Change-Id: Ic792060aafb5aa8b485054be18c3dba82bb15a3b
2017-05-23 04:56:41 +00:00
Hugo Benichi
8222ec90c6 Merge "ConnectivityServiceTest: fix flakyness" 2017-05-23 04:35:11 +00:00
Hugo Benichi
417fa6fcb4 NsdService: test coverage for client requests.
Adding coverage for:
  - NsdManager client disconnection
  - in-flight request GC

Test: new test passes
Bug: 37013369, 33298084
Bug: 38503832

(cherry picked from commit 0a118cefb8)

Change-Id: I02aca772d88306acae09db739ced7a2b1119b72b
2017-05-23 12:53:55 +09:00
Hugo Benichi
a063d988c6 Merge "Merge "ConnectivityManager: improve argument validation" am: 3ca6c89b37 am: 0187514f74 am: b800e8520e" into oc-dev-plus-aosp
am: dd06c9461b

Change-Id: I2a9ba4202ffca20fa4931680f9e3bf4313dcfb6f
2017-05-23 03:52:00 +00:00
Hugo Benichi
ea0c83ccb7 Merge "ConnectivityManager: improve argument validation" am: 3ca6c89b37 am: 0187514f74
am: b800e8520e

Change-Id: Idfc0938025c633c89f5bfddd88b3721876d085ef
2017-05-23 03:41:52 +00:00
Treehugger Robot
3ca6c89b37 Merge "ConnectivityManager: improve argument validation" 2017-05-23 03:14:29 +00:00
Hugo Benichi
b6c2406c4c ConnectivityManager: simplify callback handler
Bug: 36701874
Test: $ runtest frameworks-net
Change-Id: I4d5f08903a54f8dced7cb6ae86703847b908b784
2017-05-23 10:39:46 +09:00
Hugo Benichi
bc1104b465 ConnectivityManager: improve argument validation
Using Preconditions and dedicated static methods for checking arguments
to improve error stack traces without error messages.

Test: covered by previously added unit test
Bug: 36701874
Change-Id: Id872b2c887a4bca43a8c3644622add1c2ee57c6d
2017-05-23 10:39:45 +09:00
Hugo Benichi
a2a3380def Fix NetworkStatsObserversTest
This patch fixes several spurious unit tests in
NetworkStatsObserversTest by using the updated waitForIdleHandler of
ConnectivityServiceTest. More specifically this fixes the following
tests:
  - testUnregister_knownRequest_releasesCaller
  - testUpdateStats_deviceAccess_notifies
  - testUpdateStats_userAccess_usageSameUser_notifies
  - testUpdateStats_defaultAccess_notifiesSameUid

This patch also removes the dummy message with type -1 sent at the end
of tests in NetworkStatsObserversTest and the associated assert, because
nothing is exercised or asserted immediately after.

This patch also updates NetworkStatsObserversTest to not depend on the
deprecated junit.framework.TestCase.

Bug: 32561414
Test: runtest -x frameworks/base/tests/../NetworkStatsObserversTest.java
Change-Id: I4fc909ee9bacc964c859fa7a3db34f9dc86b89cf
2017-05-23 10:18:41 +09:00
Hugo Benichi
de08c23dc9 Fix NetworkStatsAccessTest
This patch fixes NetworkStatsAccessTest by taking into account
DEVICESUMMARY which was added in commit
3a8b343ce5220086c4f71e63f5d42f2d28434c4b.

Doing $ git revert 3a8b343ce5220086c4f71e63f5d42f2d28434c4b shows that
the existing assertions of NetworkStatsAccessTest passed before that
commit.

This patch also changes NetworkStatsAccessTest to use up-to-date testing
style and not depend on the deprecated junit.framework.TestCase.

Bug: 32561414
Test: runtest -x frameworks/base/../NetworkStatsAccessTest.java
Change-Id: Ib78f137578cf35e1c766b377b7f812a09173c49e
2017-05-23 10:18:41 +09:00
Hugo Benichi
ea4148caa3 ConnectivityServiceTest: fix flakyness
This patch attempts to fix the remaining spurious failures in
ConnectivityServiceTest, which have two causes:
 - waitForIdle() does not take into account the NetworkAgents handlers.
 - the deadlines in testRequestBenchmark are sometimes exceeded.

To fix the first issue, waitForIdle() is moved to a test level instance
method and also calls waitForIdleHandler on any non null
MockNetworkAgent. This is expected to fix spurious errors for the
following tests:
  - testMobildeDataAlwaysOn
  - testLingering
  - testPacketKeepAlive
  - testMMSonWiFi

To fix the second issue, the deadlines for testRequestBenchmark are
extended by 10ms. Also, the failure message is made more actionable by
providing the total time it took for the operation, instead of printing
the number of dispatches that were achieved before the deadline.

Bug: 32561414
Test: tests pass many times in a row (~500).
Change-Id: Id33c6ac1edfb0b89634fa7789dccb2da237e2709
2017-05-23 10:18:41 +09:00
Hugo Benichi
291d48ad0d Merge "Address ConnectivityManager API comments." am: 37c09c96b9 am: b57db6ef97 am: 08ab9ea526
am: 85c5572cc2

Change-Id: I4ba08fdfca51cbc11866e941dab76f2926f796b1
2017-05-19 23:46:46 +00:00
Hugo Benichi
85c5572cc2 Merge "Address ConnectivityManager API comments." am: 37c09c96b9 am: b57db6ef97
am: 08ab9ea526

Change-Id: I8e5e44043bb7efde3e21650e7edf3f121aff1e6e
2017-05-19 23:36:09 +00:00
Hugo Benichi
37c09c96b9 Merge "Address ConnectivityManager API comments." 2017-05-19 23:05:57 +00:00
Hugo Benichi
37b21cafcb Merge "Add a method to start the captive portal login app." am: a4876e64b8 am: f238a96172 am: 6246ddc338
am: b1dfaef01b

Change-Id: I29f04d352d601da18df193f3f46b2f6ff60d7ffd
2017-05-19 03:05:31 +00:00
Hugo Benichi
b1dfaef01b Merge "Add a method to start the captive portal login app." am: a4876e64b8 am: f238a96172
am: 6246ddc338

Change-Id: I0f5d39394d35d2977c81b704ded1d1119bcf47a7
2017-05-19 02:56:58 +00:00
Lorenzo Colitti
2439b554d5 Merge "Add test coverage for explicitlySelected networks." am: f6db1c5889 am: 3d55c5539c am: b7535c86a0
am: 4f58f0cde4

Change-Id: Ie104d3b939e99f67dd3267e16f6c27c403162453
2017-05-19 02:43:31 +00:00
Lorenzo Colitti
4f58f0cde4 Merge "Add test coverage for explicitlySelected networks." am: f6db1c5889 am: 3d55c5539c
am: b7535c86a0

Change-Id: I4caf9f55edeb51365293558db9d7d028b61c501c
2017-05-19 02:34:58 +00:00
Hugo Benichi
a4876e64b8 Merge "Add a method to start the captive portal login app." 2017-05-19 02:29:21 +00:00
Lorenzo Colitti
f6db1c5889 Merge "Add test coverage for explicitlySelected networks." 2017-05-19 02:05:55 +00:00
Lorenzo Colitti
de1e515306 Add a method to start the captive portal login app.
Bug: 36203355
Bug: 36656914
Test: ConnectivityServiceTest (including new test) passes
Change-Id: Ide82858af67024623560ab79beea27c201b63447
Merged-In: I82a9a9a8da47870ba3f1bbef5941b37e970c844f

(cherry picked from commit 500dbae1b5)
2017-05-19 00:58:41 +00:00
Erik Kline
d24b91c6e9 Merge "Expand logging capabilities of Tethering subsystem" am: 29f9f2d546 am: 96f9371a66 am: 945ff184c2
am: 4d8918ea55

Change-Id: I2644f518304a03da469fb9c2aa01a6d8f1a97901
2017-05-18 04:04:57 +00:00
Erik Kline
4d8918ea55 Merge "Expand logging capabilities of Tethering subsystem" am: 29f9f2d546 am: 96f9371a66
am: 945ff184c2

Change-Id: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
2017-05-18 03:54:30 +00:00
Hugo Benichi
9290b73f9d Merge "Fix NetworkNotificationManagerTest" am: c13a80deee am: 13f0d10115 am: 31c566037b
am: e229dc8bca

Change-Id: I000077352ab0e1af7209a266be0309607034dbea
2017-05-18 03:50:46 +00:00
Hugo Benichi
e229dc8bca Merge "Fix NetworkNotificationManagerTest" am: c13a80deee am: 13f0d10115
am: 31c566037b

Change-Id: Ib880777290f74eaa565839632eb7518642fcc4f3
2017-05-18 03:44:20 +00:00
Treehugger Robot
29f9f2d546 Merge "Expand logging capabilities of Tethering subsystem" 2017-05-18 03:25:30 +00:00
Hugo Benichi
b3a9b00d50 Merge "Move NetworkNotificationManagerTest to tests/net" am: d44389ec64 am: 9fdc903af7 am: 777bf77c2c -s ours
am: 304db7129a

Change-Id: Ibba873042627166120f4040896c58e96bff2b085
2017-05-18 02:47:54 +00:00
Hugo Benichi
304db7129a Merge "Move NetworkNotificationManagerTest to tests/net" am: d44389ec64 am: 9fdc903af7
am: 777bf77c2c  -s ours

Change-Id: I0f63e4f29228a404ec0dac3571b2474806e4c8d6
2017-05-18 02:40:26 +00:00
Hugo Benichi
343091956d Fix NetworkNotificationManagerTest
The testNotificationsShownAndCleared test was not doing anything
because the list of notification to show was always empty.

This patch fixes this issue and actually makes the test loop on
non-empty collections, and also fixes another ordering issue in
assertions themselves, hidden until now by the first issue.

Bug: 32561414
Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
Merged-In: I4837b1175d7c9133e9156e33acaa1e7e3341cc62
Change-Id: Ia30587bd68a87b83b62f57eeeb28fef7d95dbf81

(cherry picked from commit 9eec272054)
2017-05-18 11:08:31 +09:00
Hugo Benichi
d44389ec64 Merge "Move NetworkNotificationManagerTest to tests/net" 2017-05-18 02:01:40 +00:00
Hugo Benichi
1ed8f6a917 Merge "Finish moving NetworkStats tests to tests/net" am: e1a0562a3f am: cd821b231a am: 544bcbe78e
am: 67615a5906

Change-Id: I663f5ae4f1e15bd39e8ed927ac71958818452967
2017-05-18 00:57:00 +00:00
Hugo Benichi
67615a5906 Merge "Finish moving NetworkStats tests to tests/net" am: e1a0562a3f am: cd821b231a
am: 544bcbe78e

Change-Id: I5d9a01a5804a7cc6289253db09078ede00fc0dc5
2017-05-18 00:48:14 +00:00
Erik Kline
d364a24856 Expand logging capabilities of Tethering subsystem
Introduce a SharedLog that can be shared among all Tethering
components.  All log entries go to the same log, and each includes
its subsystem name.  Additionally, all entries emitted to the
system log shared the same tag, so can easily be watched.

More subsystems can inherit a SharedLog, but to minimize cherry-pick
conflicts we limit ourselves to these changes only.

Test: as follows
    - built
    - flashed
    - booted
    - log output observed via dumpsys
    - runtest frameworks-net passes
Bug: 32163131
Bug: 36988090
Bug: 38218697
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
2017-05-18 09:46:45 +09:00
Hugo Benichi
e1a0562a3f Merge "Finish moving NetworkStats tests to tests/net" 2017-05-18 00:09:54 +00:00
Erik Kline
99a735b79c Merge "Add tethering offload HAL call via JNI" am: 043ad49e0f am: f421d60824 am: c967d56ad7 -s ours
am: 06310ff3c6  -s ours

Change-Id: Iab8e98fdc4d7e4cf682dd4dffec3d64e6cef2556
2017-05-17 18:23:09 +00:00
Erik Kline
06310ff3c6 Merge "Add tethering offload HAL call via JNI" am: 043ad49e0f am: f421d60824
am: c967d56ad7  -s ours

Change-Id: Ic1c1ab0a51459e390e8607217be8f0c6ef0c2bde
2017-05-17 17:37:25 +00:00
Lorenzo Colitti
0bd6e3b946 Add test coverage for explicitlySelected networks.
Also, make all tests start with mobile data always on disabled.

This is because some tests only pass when mobile data always on
is disabled. This doesn't cause any problems when running all
the tests in the file, because these tests are always run after
one or more calls to tearDown, which disables mobile data always
on. However, it does cause issues when those tests are run alone.

Test: new test passes 50 times in a row
Test: ConnectivityServiceTest passes
Change-Id: I1eef5d7f5ec5464e0f9a1d7f1130d9ba6dea4557
2017-05-18 00:46:14 +09:00
Hugo Benichi
e9a6b0e100 Move NetworkNotificationManagerTest to tests/net
Bug: 32561414
Test: no functional change
Change-Id: Iad17e3336a4a589da5cf88fd6359323e34b747e1
2017-05-17 22:24:05 +09:00
Hugo Benichi
b9693f313b Finish moving NetworkStats tests to tests/net
Follow-up of commit 4ff3a778ab.

Also add @SmallTest annotation to classes moved to tests/net.

Test: no functional change
Bug: 32561414
Change-Id: I0a0e8865d37ba7bae06ce352d3fc385989adc300
2017-05-17 22:24:05 +09:00
Hugo Benichi
5ac64c51f5 Address ConnectivityManager API comments.
This patch is a cherry pick of the two following commits:
  - 139a48c83c which addresses several
    issues in the public api of ConnectivityManager.
  - 4c11db0fdd which fixes the documentation
    of several methods in ConnectivityManager public api.

Because the first commit change the public api that is referenced in
the documentation fixed by the second commit, it is not possible to one
without the other. In both cases trying to cherry pick only one of them
results in a build error.

The first commit was submitted successfully on an internal branch before
the checks done in the built got stricter.

Bug: 36370941
Test: marlin builds and boots
Change-Id: I86dcf056e6b165e527c3ee88dbabc2764ac09a08
Merged-In: I693ee5270bf186c88c7c5056293519f7237504ff

(cherry picked from commit 139a48c83c)
2017-05-17 21:48:05 +09:00
Treehugger Robot
043ad49e0f Merge "Add tethering offload HAL call via JNI" 2017-05-17 07:09:15 +00:00
Erik Kline
deecb37d61 Merge "Add tethering offload HAL call via JNI" into oc-dev-plus-aosp
am: 652d17e238  -s ours

Change-Id: I7478fbe6c11a8543f96311e936b10d479442c42f
2017-05-17 05:14:06 +00:00
Erik Kline
df11e5b2b5 Add tethering offload HAL call via JNI
Additionally, try to locate java Control interface.

Test: as follows
    - built
    - flashed
    - booted
    - OffloadController log messages observed, but only ever
      "not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Merged-In: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
(cherry picked from commit 8784c80e42)
2017-05-17 13:44:25 +09:00
Erik Kline
f0f891b39b Add tethering offload HAL call via JNI
Additionally, try to locate java Control interface.

Test: as follows
    - built
    - flashed
    - booted
    - OffloadController log messages observed, but only ever
      "not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Merged-In: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
(cherry picked from commit 8784c80e42)
2017-05-17 13:41:30 +09:00
Erik Kline
8784c80e42 Add tethering offload HAL call via JNI
Additionally, try to locate java Control interface.

Test: as follows
    - built
    - flashed
    - booted
    - OffloadController log messages observed, but only ever
      "not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
2017-05-17 11:31:45 +09:00
TreeHugger Robot
91bf2b5197 Merge "ConnectivityManager: fix documentation" 2017-05-16 14:31:28 +00:00
Hugo Benichi
b112d0ecc6 Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207 am: e13c192d0f
am: 216aae5188

Change-Id: I455d9712ad7f60f7474077435ff977c95b3b48c3
2017-05-16 13:34:37 +00:00
Hugo Benichi
216aae5188 Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207
am: e13c192d0f

Change-Id: Ib8368c5a8538914cba2723368c03618401ac159f
2017-05-16 13:25:09 +00:00
Hugo Benichi
5d426da614 Remove unused import in ConnectivityManager
This makes the pre-upload verification pass.

Test: no functional change.
Change-Id: I6beccea10ccfcb39d975cb8f6f34fc9d79f1e170
2017-05-16 11:39:08 +09:00
Hugo Benichi
4c11db0fdd ConnectivityManager: fix documentation
Documentation pointing to the registerNetwork() overload including a
timeout argument was pointing to the version removed by commit
139a48c83c. This makes it impossible to
cherry pick 139a48c83c due to the linter
complaining about unresolvable links.

This patch fixes the documentation to point to the registerNetwork()
with argument types NetworkRequest, NetworkCallback, int, in that order.

Bug: 36370941
Test: no functional change
Change-Id: Ieaf58f81d89fdf63f480fd15e65ed52822fc4f51
2017-05-16 11:36:24 +09:00