Commit Graph

3769 Commits

Author SHA1 Message Date
Hugo Benichi
94a2075265 Merge "ConnectivityServiceTest: fix flakyness" am: fd3f172df8 am: 004f36d5bc am: eb9d0f16aa
am: 2244ca0741

Change-Id: I4225fabd1b9af92a7c688e2cfbab3b20e58c53dd
2017-05-23 05:03:12 +00:00
Hugo Benichi
2244ca0741 Merge "ConnectivityServiceTest: fix flakyness" am: fd3f172df8 am: 004f36d5bc
am: eb9d0f16aa

Change-Id: Ic792060aafb5aa8b485054be18c3dba82bb15a3b
2017-05-23 04:56:41 +00:00
Hugo Benichi
fd3f172df8 Merge "ConnectivityServiceTest: fix flakyness" 2017-05-23 04:35:11 +00:00
Hugo Benichi
0a7d45a271 Merge "Merge "ConnectivityManager: improve argument validation" am: bdc00cdaa0 am: 0187514f74 am: b800e8520e" into oc-dev-plus-aosp
am: dd06c9461b

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

Change-Id: Idfc0938025c633c89f5bfddd88b3721876d085ef
2017-05-23 03:41:52 +00:00
Treehugger Robot
bdc00cdaa0 Merge "ConnectivityManager: improve argument validation" 2017-05-23 03:14:29 +00:00
Hugo Benichi
ff4bf6017f 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
bac93e4852 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
e3676f6223 Merge "Address ConnectivityManager API comments." am: a70025781f am: b57db6ef97 am: 08ab9ea526
am: f62523e6dc

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

Change-Id: I8e5e44043bb7efde3e21650e7edf3f121aff1e6e
2017-05-19 23:36:09 +00:00
Hugo Benichi
a70025781f Merge "Address ConnectivityManager API comments." 2017-05-19 23:05:57 +00:00
Hugo Benichi
a2ab54732e Merge "Add a method to start the captive portal login app." am: 9e44f73ed7 am: f238a96172 am: 6246ddc338
am: 5f5f8631ad

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

Change-Id: I0f5d39394d35d2977c81b704ded1d1119bcf47a7
2017-05-19 02:56:58 +00:00
Lorenzo Colitti
358435e4e4 Merge "Add test coverage for explicitlySelected networks." am: 5466a9e14b am: 3d55c5539c am: b7535c86a0
am: aa92f9e874

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

Change-Id: I4caf9f55edeb51365293558db9d7d028b61c501c
2017-05-19 02:34:58 +00:00
Hugo Benichi
9e44f73ed7 Merge "Add a method to start the captive portal login app." 2017-05-19 02:29:21 +00:00
Lorenzo Colitti
5466a9e14b Merge "Add test coverage for explicitlySelected networks." 2017-05-19 02:05:55 +00:00
Lorenzo Colitti
7868c98fea 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 755e796e5e)
2017-05-19 00:58:41 +00:00
Erik Kline
a9da29975b Merge "Expand logging capabilities of Tethering subsystem" am: cbe63224b0 am: 96f9371a66 am: 945ff184c2
am: e40047ec69

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

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

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

Change-Id: Ib880777290f74eaa565839632eb7518642fcc4f3
2017-05-18 03:44:20 +00:00
Treehugger Robot
cbe63224b0 Merge "Expand logging capabilities of Tethering subsystem" 2017-05-18 03:25:30 +00:00
Hugo Benichi
1fb086dd8a Merge "Move NetworkNotificationManagerTest to tests/net" am: c6464fad2f am: 9fdc903af7 am: 777bf77c2c -s ours
am: b0ec728a3c

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

Change-Id: I0f63e4f29228a404ec0dac3571b2474806e4c8d6
2017-05-18 02:40:26 +00:00
Hugo Benichi
08528b224b 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 913556e68e)
2017-05-18 11:08:31 +09:00
Hugo Benichi
c6464fad2f Merge "Move NetworkNotificationManagerTest to tests/net" 2017-05-18 02:01:40 +00:00
Hugo Benichi
9a7a008037 Merge "Finish moving NetworkStats tests to tests/net" am: d72f5f7c9a am: cd821b231a am: 544bcbe78e
am: 5019e0b10f

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

Change-Id: I5d9a01a5804a7cc6289253db09078ede00fc0dc5
2017-05-18 00:48:14 +00:00
Erik Kline
ef8bd29f51 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
d72f5f7c9a Merge "Finish moving NetworkStats tests to tests/net" 2017-05-18 00:09:54 +00:00
Erik Kline
7194d9773f Merge "Add tethering offload HAL call via JNI" am: adb6e7b60b am: f421d60824 am: c967d56ad7 -s ours
am: 1302059404  -s ours

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

Change-Id: Ic1c1ab0a51459e390e8607217be8f0c6ef0c2bde
2017-05-17 17:37:25 +00:00
Lorenzo Colitti
71cd78c2b9 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
256e3db020 Move NetworkNotificationManagerTest to tests/net
Bug: 32561414
Test: no functional change
Change-Id: Iad17e3336a4a589da5cf88fd6359323e34b747e1
2017-05-17 22:24:05 +09:00
Hugo Benichi
57ac13993a Finish moving NetworkStats tests to tests/net
Follow-up of commit 73fbb5303f.

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
60b4db5cda Address ConnectivityManager API comments.
This patch is a cherry pick of the two following commits:
  - 38ea810b27 which addresses several
    issues in the public api of ConnectivityManager.
  - e73017a135 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 38ea810b27)
2017-05-17 21:48:05 +09:00
Treehugger Robot
adb6e7b60b Merge "Add tethering offload HAL call via JNI" 2017-05-17 07:09:15 +00:00
Erik Kline
b18f82a3e8 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
672cf0d785 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 0b08ce4abb)
2017-05-17 13:44:25 +09:00
Erik Kline
b8bf26d5db 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 0b08ce4abb)
2017-05-17 13:41:30 +09:00
Erik Kline
0b08ce4abb 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
c1f0216960 Merge "ConnectivityManager: fix documentation" 2017-05-16 14:31:28 +00:00
Hugo Benichi
6b5df8313d Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207 am: e13c192d0f
am: 5e769511ec

Change-Id: I455d9712ad7f60f7474077435ff977c95b3b48c3
2017-05-16 13:34:37 +00:00
Hugo Benichi
5e769511ec 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
ac78670f57 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
e73017a135 ConnectivityManager: fix documentation
Documentation pointing to the registerNetwork() overload including a
timeout argument was pointing to the version removed by commit
38ea810b27. This makes it impossible to
cherry pick 38ea810b27 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
Hugo Benichi
77ddfa4781 Merge "ConnectivityService: minor formatting change" am: 4c949ee07c am: 9374e0b598 am: 88a3389b2c
am: 172cf14807

Change-Id: I252d293f37d29a53e1b5d913f682c0c16b2a122c
2017-05-15 06:24:57 +00:00
Hugo Benichi
172cf14807 Merge "ConnectivityService: minor formatting change" am: 4c949ee07c am: 9374e0b598
am: 88a3389b2c

Change-Id: I5ce0d4a057edc0512f45d8cbf760bab1d2824183
2017-05-15 06:17:03 +00:00
Hugo Benichi
478587688c ConnectivityService: minor formatting change
This patch adds a space character between "synchronized" and
"(mTheLockVariable)" so that all synchronized block have a consistent
syntax. Basic stats shows that "synchronized (" is x10 time more likely
than "synchronized(".

This facilitates finding all locked sections by grepping.

Test: no semantics changes
Bug: 37119619
Change-Id: Id860700efa85ffebafed11af3a2997bc115d9c03
2017-05-15 01:09:36 +00:00