3676 Commits

Author SHA1 Message Date
Hugo Benichi
f238a96172 Merge "Add a method to start the captive portal login app."
am: 30f2544f0c

Change-Id: I7bc42e7f9cbc3635684257b920ea4a1ba7b55740
2017-05-19 02:39:29 +00:00
Hugo Benichi
30f2544f0c Merge "Add a method to start the captive portal login app." 2017-05-19 02:29:21 +00:00
Lorenzo Colitti
3d55c5539c Merge "Add test coverage for explicitlySelected networks."
am: 1bc1936ae9

Change-Id: I42ce887005325eee9fb1a60762cee375cff176a6
2017-05-19 02:15:53 +00:00
Lorenzo Colitti
1bc1936ae9 Merge "Add test coverage for explicitlySelected networks." 2017-05-19 02:05:55 +00:00
Lorenzo Colitti
2965d33afc 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 4734cdbbc38752765376aedb0d5208463674535e)
2017-05-19 00:58:41 +00:00
Erik Kline
96f9371a66 Merge "Expand logging capabilities of Tethering subsystem"
am: 0373340b07

Change-Id: I1381b8457781dcfafe52371a5dc7628282cb8efc
2017-05-18 03:38:43 +00:00
Hugo Benichi
13f0d10115 Merge "Fix NetworkNotificationManagerTest"
am: c13a80deee

Change-Id: I8f02be13da5790d0fd60f04886e87de04c96de08
2017-05-18 03:29:50 +00:00
Treehugger Robot
0373340b07 Merge "Expand logging capabilities of Tethering subsystem" 2017-05-18 03:25:30 +00:00
Hugo Benichi
9fdc903af7 Merge "Move NetworkNotificationManagerTest to tests/net"
am: c01fbf0f0c

Change-Id: I10ce85211ac0305e8d05ca02b58b819297f59bbf
2017-05-18 02:23:12 +00:00
Hugo Benichi
e6181b0c47 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 f8b804be5aeb5d0a36ff88649d7c5ecdc47c3ad1)
2017-05-18 11:08:31 +09:00
Hugo Benichi
c01fbf0f0c Merge "Move NetworkNotificationManagerTest to tests/net" 2017-05-18 02:01:40 +00:00
Erik Kline
7747fd4ce0 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
cd821b231a Merge "Finish moving NetworkStats tests to tests/net"
am: 1ae1b6b960

Change-Id: If85e483d5b44872c10e42ef55ddaf209601c7cfa
2017-05-18 00:27:06 +00:00
Hugo Benichi
1ae1b6b960 Merge "Finish moving NetworkStats tests to tests/net" 2017-05-18 00:09:54 +00:00
Lorenzo Colitti
02cc839411 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
d8ddab6ba5 Move NetworkNotificationManagerTest to tests/net
Bug: 32561414
Test: no functional change
Change-Id: Iad17e3336a4a589da5cf88fd6359323e34b747e1
2017-05-17 22:24:05 +09:00
Hugo Benichi
e7e10303f3 Finish moving NetworkStats tests to tests/net
Follow-up of commit c86013be936f36c61fa0cdfad95141f6de3c6ef7.

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
Erik Kline
f421d60824 Merge "Add tethering offload HAL call via JNI"
am: 8f65e470b0

Change-Id: Ib8403f685371b44f0fdad6d15ae372787d457d13
2017-05-17 07:18:51 +00:00
Erik Kline
5a7c8a0b24 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 58ed1b051bdffd239d92919170a0bb41a4cc197c)
2017-05-17 13:44:25 +09:00
Erik Kline
dd76dd1eea Merge "Fix broken DUN evaluation logic"
am: b0daeeb879

Change-Id: Iae7450ef21485c5a13f45fab570bf658b2da8f28
2017-05-16 08:06:42 +00:00
Erik Kline
54f2f3704e Fix broken DUN evaluation logic
Test: as follows
    - built
    - booted
    - flashed
    - runtest frameworks-net passes
Bug: 32163131
Bug: 38152109
Bug: 38186915
Change-Id: Id4803504e825290d62c0b51a2b9bd664dcef30b1
2017-05-16 15:14:45 +09:00
Hugo Benichi
cc9f695ba0 Merge changes Ie762ce75,I611fd791
am: 21a57f263f

Change-Id: Ibb291720f6c257a8ead2c039f584f4b3ecc69be5
2017-05-11 12:43:42 +00:00
Hugo Benichi
6e039a13cc ConnectivityManager: unit test for argument validation
Bug: 36701874, 37107940
Test: new test passes
Change-Id: Ie762ce758b3d94052b7438a67fc55bef4690cbbb
2017-05-11 14:15:20 +09:00
Hugo Benichi
cb88323dd2 ConnectivityManager: uses service error codes and exceptions
This patch introduces between ConnectivityManager and
ConnectivityService a mechanism for propagating back to clients
informative errors in the form of error codes and associated custom
runtime exceptions.

Without error code, the service can only throw a limited number of
different exceptions over Binder. Furthermore the throw site stack
traces are always loss. Although for individual instances of a throw,
the error message can be inspected, aggregations of stack traces from
app crashes sanitize error messages and only leaves the stack traces.

This makes debugging dificult for some service calls such as
requestNetwork that can have a variety of failure modes.

In this patch only one failure mode is codified. More can be added later
at a light cost by: 1) defining an error code, 2) defining an
associated exception, 3) mapping the code to the exception. This patch
can serves as a template for doing so.

Test: $ runtest frameworks-net,
      #testNetworkRequestMaximum() detects the new exception type.
Bug:  36556809, 36701874
Change-Id: I611fd7915575c9e418f7149fcdc8a879d2a3716d
2017-05-11 14:15:15 +09:00
Hugo Benichi
76dc14ec88 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks"
am: ba666e0621

Change-Id: I6c25c2f5f95ac2ffefe263b34e95009b9823c254
2017-05-10 00:23:06 +00:00
Hugo Benichi
ba666e0621 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" 2017-05-10 00:07:29 +00:00
Hugo Benichi
e1bb3a14d1 NetworkStatsFactory: fix double accounting on IPv6 only networks
For 464xlat scenarios on IPv6 networks, the clatd interface setup
introduces double counting of apps ipv4 traffic. NetworkStatsFactory was
accounting for this on the tx path, but not on the rx path. Also it did
not accounted for the 20 bytes added by the IPv6 header.

This patch subtract correctly the rx and tx traffic from the root uid on
the underlying interface, and also adds correctly the 20 bytes cost per
packet on the stacked interface for 464xlat traffic.

Test: added several new unit tests, based on synthetic data and real
      data also.
Bug: 33681750
Change-Id: I2675643b220acbc6110179fa937d4c313b6f5e32
2017-05-09 22:46:14 +09:00
Erik Kline
8af8235bca Merge "Refactor and improve logging."
am: c3d41d5093

Change-Id: I8ef193a9ee0f5bf04ae18620c1a68228ed7ed929
2017-05-09 10:40:29 +00:00
Treehugger Robot
c3d41d5093 Merge "Refactor and improve logging." 2017-05-09 10:33:51 +00:00
Paul Duffin
edefe593e3 Merge "Prepare for removal of junit and android.test classes from Android API (step 1)"
am: b2ac85e76d

Change-Id: I2c06dbace44b4578a6cd94cb62a3ae67e558aaaa
2017-05-09 10:29:59 +00:00
Paul Duffin
b2ac85e76d Merge "Prepare for removal of junit and android.test classes from Android API (step 1)" 2017-05-09 10:23:17 +00:00
Erik Kline
1fdc2e23b5 Refactor and improve logging.
Test: as follows
    - build
    - flashed
    - booted
    - "runtest frameworks-net" passed
    - "dumpsys connectivity" shows new log output
Bug: 32163131
Bug: 36504926

Change-Id: I14d6da18660223f7cace156cb6594ee18928a7b0
2017-05-09 17:29:47 +09:00
Hugo Benichi
717238a614 Merge changes I4872f8ba,I92039f29,Iaad13e13
am: 767ac317e2

Change-Id: Ibf618a27b2e5cfb3e8a69528dfecd275b33f0336
2017-05-09 06:14:47 +00:00
Hugo Benichi
ab5bdbf84e NsdService: test coverage for client requests.
Adding coverage for:
  - NsdManager client disconnection
  - in-flight request GC

Test: new test passes
Bug: 37013369, 33298084
Change-Id: I92039f297cf99352bbf4196797933d89c0b819ff
2017-05-09 10:49:33 +09:00
Paul Duffin
702d506d57 Prepare for removal of junit and android.test classes from Android API (step 1)
In preparation for removing junit and android.test classes from
the Android API this change adds explicit dependencies on junit
and/or legacy-android-test to ensure that modules will compile
properly once it is removed.

Care was taken to ensure that any targets that depended,
directly or indirectly, on android-support-test did not also
depend on junit or hamcrest as they conflict with the versions
embedded within android-support-test.

Bug: 30188076
Test: make checkbuild
Change-Id: Ice80a29b420061f5d0af6eb46426455abf890e5e
Merged-In: Ifc3ee3dc804074a3c572bf2600cfb1fe1b6fa749
2017-05-08 19:33:27 +01:00
Hugo Benichi
60182dbe4e Merge "NsdManager: add test coverage for discoverServices()"
am: 3e21b1745c

Change-Id: I0fd1d8e6ea3264a96b144c6701200f7b0be5f9c4
2017-05-02 08:54:46 +00:00
Treehugger Robot
3e21b1745c Merge "NsdManager: add test coverage for discoverServices()" 2017-05-02 08:44:29 +00:00
Hugo Benichi
bc57faa1ac Merge "NsdManager: unit test coverage for servive registration"
am: b0e408450c

Change-Id: I0b47ad5a1ccee4a2efb169d717b512a46ad4ecc2
2017-05-02 06:35:11 +00:00
Treehugger Robot
b0e408450c Merge "NsdManager: unit test coverage for servive registration" 2017-05-02 06:27:10 +00:00
Hugo Benichi
93f4591684 NsdManager: add test coverage for discoverServices()
Test: added new tests
Bug: 37013369, 33298084
Change-Id: If6c1113ee1bd4690db90abd5a61c3e229c827aec
2017-05-02 15:26:33 +09:00
Hugo Benichi
8c5eeb0afc NsdManager: unit test coverage for servive registration
This patch adds test coverage for NsdManager#registerService() and
NsdManager#unregisterService(). This test shows a potential defect in
the api: if unregisterService() fails, the associated listener is always
unregistered from NsdManager. If the service initially registered is
still registered, this potentially make it impossible to unregister.

Test: added new unit test
Bug: 37013369, 33298084
Change-Id: Ia089b6d2f2a349907a8b29d9a3acd7f59e177887
2017-05-02 13:31:24 +09:00
Erik Kline
241a7f15f2 Merge "Notify WifiManager of interface state changes"
am: 8e97274186

Change-Id: I6e9594805f9f55da53cf29e322829b1d2ff2f058
2017-04-28 08:04:31 +00:00
Erik Kline
216af6d3fe Notify WifiManager of interface state changes
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
      (except for an unrelated IpConnectivityMetricsTest error)
Bug: 31466854
Bug: 32163131
Change-Id: I702ea79eb2c02604761e4e1ebcd5f9e445178efb
2017-04-28 13:46:41 +09:00
Hugo Benichi
d97e358f7a Merge "NsdManager: unit tests for argument validation"
am: 3cff7deecb

Change-Id: I24d3bda00236fe8c49df0ea7f53109625b3b4f9d
2017-04-27 12:44:35 +00:00
Hugo Benichi
47748b754c Merge "NsdService: disentangle NativeDaemonConnector from ctor"
am: fa97f11b20

Change-Id: I4e5dc9df1f4de256b34c0140ea5ae7ec1bb6fce6
2017-04-27 12:39:00 +00:00
Hugo Benichi
52d9e733ae NsdManager: unit tests for argument validation
Test: new tests pass.
Bug: 37013369, 33298084
Change-Id: Ia514d2bbd967d46fed54e379f319b572ade22c62
2017-04-27 16:35:48 +09:00
Hugo Benichi
1fac3191c7 NsdService: disentangle NativeDaemonConnector from ctor
This patch disentangles the creation of NativeDaemonConnector from the
creation of NsdService by introducing a wrapper type DaemonConnection.

This allows to mock this dependency in unit tests.

Test: enhanced previously introduced new tests.
Bug: 37013369, 33298084
Change-Id: I894b7cddfc509f86d0134d214c88c063b81b5e0a
2017-04-27 16:35:30 +09:00
Hugo Benichi
dd53c962b2 Merge "NsdService: bootstrap unit tests"
am: 7ca060aa95

Change-Id: I3ce2d85afb5e085c8c49731f3d18a96d17542271
2017-04-27 05:34:05 +00:00
Hugo Benichi
7ca060aa95 Merge "NsdService: bootstrap unit tests" 2017-04-27 05:22:54 +00:00
Etan Cohen
3c6305cc55 Merge "[AWARE] Add UID checking to WifiAwareNetworkSpecifier"
am: 2fd19ffa06

Change-Id: I8e4a38b113d6e8f81bc382715dda5c279771e454
2017-04-25 13:27:22 +00:00