Commit Graph

301 Commits

Author SHA1 Message Date
Erik Kline
32179ff815 Program offload-exempt local prefixes into the HAL
Additionally:
    - move mOffloadController into MasterTetherSM

Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - observed calls to the HAL setLocalPrefixes in tethering log
Bug: 29337859
Bug: 32163131
Change-Id: Ifaf23c6179ead9de6ccfcf41e0c203025153167b
2017-07-13 13:45:49 +09:00
Erik Kline
c87cd41184 Restructure use of absent tether_offload_disabled setting
This restructures the fetching of the default disposition such
that we disable (and enable) the feature with only a single
character change.

Additionally: fix unittests with proper use of FakeSettingsProvider.

Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passed with developer enabled and disabled
Bug: 29337859
Bug: 32163131
Bug: 63250751

Change-Id: Ib32489d07778465134bca52c589baddbd78ab129
2017-07-11 23:46:58 +09:00
Erik Kline
c438e306cc Switch to USB_CONFIGURED as the primary USB readiness signal
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - USB tethering on and off works as expected
Bug: 32163131
Bug: 36216864
Bug: 62147658
Bug: 62552150
Change-Id: Ia8f7f3616f1358b0427386ce8aff26899e03ac07
2017-07-05 00:36:04 +09:00
Erik Kline
3a5278f2c4 Pass all offload-exempt prefixes into OffloadController
Additionally:
    - eliminate useless TetherMasterUtilState

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks passes
Bug: 29337859
Bug: 32163131

Merged-In: I6adcdbd6a4f14bd2cdaa056cfc0cf9c573a165b9
Merged-In: I5e689bcf5dd048ee9f9bd0c32b16d7c2e4c0268d
Merged-In: Ifd3817bd4569682d77a70f8192432391a573f6d8
Merged-In: I1ea57fbe322e26246f1d8b459519f18be1297467
Change-Id: I0482ac9dd9e8ba558b253643dbc01875ce9475ef
(cherry picked from commit be8ee08f5d)
2017-07-03 18:01:44 +09:00
Erik Kline
0aecb6ad44 Merge "Create a TetherInterfaceStateMachine when told the interface name." into oc-dev
am: be7657b038

Change-Id: Ie34a3c7aa39c9b70602236f4d4a4d5548566dd51
2017-06-22 17:36:12 +00:00
Erik Kline
a9cde8b4fb Create a TetherInterfaceStateMachine when told the interface name.
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131
Bug: 62343300

Merged-In: I542e013aa19fefd3443588c9a81ee59cd669ab6f
Merged-In: I973bdc5b540cce66a9713cebfd5071ad4a4b0a08
Merged-In: I2104ecf8102c8f9541ee2d3ce6589b0081db4fe3
Change-Id: I2104ecf8102c8f9541ee2d3ce6589b0081db4fe3
(cherry picked from commit b912c50b19)
2017-06-22 18:33:56 +09:00
Erik Kline
1e54351ac0 Always allow Ethernet to be an upstream
If there are any upstream types defined at all, make sure that
either TYPE_ETHERNET is included somewhere within the sorted list
or force it to be at the front.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131
Bug: 36076442

Merged-In: I97737f4c12285f0bbeed0bd2efdfec6fbe95fd03
Merged-In: Id60706e623febcc35063ccb96c797fc4f9a223b1
Merged-In: I97cc3c5ad7dcd4359c28e6aa817856a226a4f8cc
Change-Id: Ie61d1358f73d518de23f6ca48ca2765ca14a1067
(cherry picked from commit 0e61baa0ac)
2017-06-21 16:41:31 +09:00
Erik Kline
7fd696cb57 Make interface IP serving code set LinkProperties
Additionally, clean up awkward IPv6TetheringInterfaceServices
instantiation mechanics.  In future, this class will be absorbed
by TetherInterfaceStateMachine (prior to its renaming to IpServer).

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131

Merged-In: I8b15edbf04c10cd9429da079c6b79352a6740b3b
Merged-In: I39a1744a7fa9b91e3b607429c79f39578e9bde19
Merged-In: I753ab701f2109c0972816724e73119dc1dbc4dca
Change-Id: Ib620e3df182f9f8e2c019aae1cd8981eb0b29376
(cherry picked from commit dd4d582034)
2017-06-20 12:22:31 +09:00
TreeHugger Robot
7284e2a88b Merge "make UpsreamNetworkMonitor the sole source of upstream network information" into oc-dr1-dev 2017-06-19 08:31:38 +00:00
Erik Kline
1185459c41 Fixes for tetheroffload crashes
Now that we can talk to the HALs (with some out of tree CLs and
"setenforce 0"), several crashes were encountered.

Fixes here include:
    - avoid hidl_handle move semantics
    - check HIDL method status return value (isOk())
    - convert Java short port numbers to ints
    - don't pass nulls to HIDL where Strings are required
      (limitations in parceling)

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - "setenforce 0" and start tethering
Bug: 29337859
Bug: 32163131

Change-Id: I91314440c3a04e5f2502579b5f06dac9f25cf0cd
2017-06-16 17:06:05 +09:00
Erik Kline
1e2897dcff make UpsreamNetworkMonitor the sole source of upstream network information
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131

Merged-In: If45443143777e1446c812563742ae8af68d8f73e
Merged-In: Ifeb49f1b19ab36e438763b569c78a335b094f7d0
Merged-In: Idfebb9b79074f21aeccf773cac98aa7839bda9da
Change-Id: I66ce682cf9c31887264a095a4e4638d281d8ed39
(cherry picked from commit 5bbece747f)
2017-06-15 15:28:50 +09:00
Erik Kline
3760999e34 Move findPreferredUpstreamType into UNM
This changes the way in which available networks are found. Previously
Tethering asked ConnectivityService for NetworkInfo and checked for
whether or not it was in state CONNECTED.

Here we use the fact that ConnectivityService will not call UNM's
callbacks' onAvailable() methods until the networks in question have
become connected.

Test: as follows
    - built
    - flashed
    - booted
    - runtest framework-net passed
Bug: 29337859
Bug: 32163131

Merged-In: I9937297727aa1a063e499fccd5833ace229b1e8a
Merged-In: Ifa1a34a1fb32149085421a63cb0f2586d2862d6b
Merged-In: Ia215e55b69b856f5511e5d4f852e39fa6c11462e
Change-Id: I97abe225fdd3accb38bd9168f545445b761a90d8
(cherry picked from commit a1d368af2f)
2017-06-15 15:28:50 +09:00
Erik Kline
a8e2e799a8 Merge IPv6TetheringInterfaceServices into TetherInterfaceStateMachine
Ideally this would have been done immediately after IPv6 tethering code
was made part of an official named release. Getting this in now should
help with the relaying of LinkProperties that is required for offload.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - runtest frameworks-wifi passes
Bug: 29337859
Bug: 32163131

Merged-In: Ib6e6356e6caa469523fc098e850108de97b494e2
Merged-In: Iec52309a56dd38ac9854ce40a792b3b622f0b015
Merged-In: I5eb3c02331aabc033ecfebee2900477c61e1b6f6
Change-Id: I015fa3cb05a15624f9e80b7aa5a871cefef431b7
(cherry picked from commit 94ae4c99c5)
2017-06-14 19:45:34 +09:00
Erik Kline
f3a08b44ed Add additional mocking for Context innards
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - cherry-picked to master and verified there as well
Bug: 32163131
Bug: 32561414

Merged-In: I2695841bfc31280060754132e589af1ca95911da
Merged-In: I9a05f34035a15b233a44d517f2b2426481679974
Change-Id: I0b5b1b12d55547d08c332c7d274f19f0023a7b07
(cherry picked from commit ec37275ec9)
2017-06-11 18:19:22 +09:00
Erik Kline
6e9a10104c Convert IControlsTethering from interface into callback
Additionally:
    - add updateLinkProperties() method to new callback
    - skeletally connect LinkProperties updates through
      to OffloadController

TODOs liberally sprinkled through out.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Merged-In: I178130e65db4fef26d62ea7eaa9a52f7e8103432
Merged-In: I832d77747de7517513c22d36fff4a2fa2bb95154
Change-Id: I631d17b26be153534551a1615931fc98b598b953
(cherry picked from commit ab6439b0f8)
2017-06-11 18:08:03 +09:00
Erik Kline
e7d7699381 Delete legacy "wifi interface name guessing" behaviour
am: 9e22554068

Change-Id: Iecb4498c004a45403213d6e4bd7b6f8725334646
2017-06-08 13:32:57 +00:00
Erik Kline
9e22554068 Delete legacy "wifi interface name guessing" behaviour
Now that Wi-Fi always passes us the AP interface name (and mode)
we no longer need to guess which interface on which we're supposed
to be starting IP serving (either tethering or local-only hotspot).

Test: as follows
    - built
    - flashed
    - booted
    - TetheringTest passes
Bug: 32163131
Bug: 62343300

Change-Id: I6019410ee5adff4929690d35ba09294765fcd6a4
2017-06-08 18:51:33 +09:00
Erik Kline
6ce08f623c Merge "Support setting upstream parameters." am: faf8d67749 am: 4e5024131b
am: e2018a407a

Change-Id: I8e0f7188ff29b2fd7c34fd2a340c8b4abaac2be7
2017-06-06 05:16:27 +00:00
Erik Kline
4e5024131b Merge "Support setting upstream parameters."
am: faf8d67749

Change-Id: I0be9ad265fa664f0ce6e1e098996b46c88317b97
2017-06-06 04:54:04 +00:00
Erik Kline
7990aef63b Support setting upstream parameters.
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: Id88cae4beed7d38aec3d29a0e2f59a5c7e6a9a4e
2017-06-06 12:02:13 +09:00
Erik Kline
1454ee750e Handle Wi-Fi passing explicit interface name and AP/IP mode
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 31466854
Bug: 32163131
Bug: 62018531
Bug: 62076211
Merged-In: I599813c4b4d866623344df56f62ed6a40b4025d6
Merged-In: I8f1d172a3514e4fb9230af9e09aeaf638f03091c
Change-Id: I3557a9c14f4e9f1de1869084566a179003d98ffe
(cherry picked from commit 2efb827f61)
2017-06-02 22:43:34 +09:00
Erik Kline
729c31c2e9 Merge "Handle Wi-Fi passing explicit interface name and AP/IP mode" am: 3478ff8c9e am: 1536453059
am: 00956c4f7c

Change-Id: I599813c4b4d866623344df56f62ed6a40b4025d6
2017-06-02 05:39:23 +00:00
Erik Kline
1536453059 Merge "Handle Wi-Fi passing explicit interface name and AP/IP mode"
am: 3478ff8c9e

Change-Id: I489f7e6b8ca4af584879a4c9e8f00570da6e400c
2017-06-02 05:26:49 +00:00
Erik Kline
2efb827f61 Handle Wi-Fi passing explicit interface name and AP/IP mode
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 31466854
Bug: 32163131
Bug: 62076211
Change-Id: I3557a9c14f4e9f1de1869084566a179003d98ffe
2017-06-02 12:21:15 +09:00
Erik Kline
9d2abb4b40 Merge "Add a tethering offload settings kill switch" am: 7cf3086f37 am: 503a6952b2
am: 03941982dc

Change-Id: I7e15919817c59579ff6e7b28e858f13c3090ee5c
2017-06-01 08:10:51 +00:00
Erik Kline
503a6952b2 Merge "Add a tethering offload settings kill switch"
am: 7cf3086f37

Change-Id: I13264b4ae23c8754b61ff46cafbb1b5f31bd14a3
2017-06-01 07:59:11 +00:00
Erik Kline
92c4db04e5 Add a tethering offload settings kill switch
Check for tether_offload_disabled (defaulting to false if not present)
before starting the OffloadController.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: Ifcc0eb1a41f09ad9e717c9252d2d55e69789669b
2017-05-31 20:33:05 +09:00
Hugo Benichi
913d39aafe Merge "ConnectivityServiceTest: more tweaks to testRequestBenchmark" am: 76efbb30f5 am: 5f046cb614
am: 7bbdfcd8eb

Change-Id: I96c39ca1899768d039a108426fb04655aaf8d55f
2017-05-31 04:10:03 +00:00
Hugo Benichi
5f046cb614 Merge "ConnectivityServiceTest: more tweaks to testRequestBenchmark"
am: 76efbb30f5

Change-Id: I2c7e714af44c31a101fd58be6ebcc540fffd65a1
2017-05-31 03:52:05 +00:00
Hugo Benichi
02f8f9c830 ConnectivityServiceTest: more tweaks to testRequestBenchmark
Recent continuous testing runs indicates that commit 849b81b7 did not
completely fixed the issue with testRequestBenchmark.

This patch changes the name of the test to not include "test" and
removes @SmallTest annotation, which should do the job of @Ignore while
ConnectivityServiceTest still extends AndroidTestCase.

In addition timeouts are adjusted to take into account recent failures
observed.

This is the last pending action before turning on FrameworksNetTests on
presubmits.

Bug: 32561414
Test: no functional change
Change-Id: I56ef334e19e99e5a3483418330e5f0ccd6eb31bb
2017-05-31 10:23:42 +09:00
Erik Kline
3f5f551042 Merge "Minor improvement in logging in TetheringConfiguration" am: 39ce589f0b am: 8211c36db9
am: 1315903420

Change-Id: I77b4db07f2a43a576146537ae2ab72d2d0ebdde6
2017-05-28 11:31:32 +00:00
Erik Kline
8211c36db9 Merge "Minor improvement in logging in TetheringConfiguration"
am: 39ce589f0b

Change-Id: I1d61308cf21f3c4ebcc37f78bdd102f96a676462
2017-05-28 11:16:32 +00:00
Erik Kline
6bd7453206 Minor improvement in logging in TetheringConfiguration
Test: as follows
    - built
    - booted
    - flashed
    - runtest frameworks-net passes
    - dumpsys connectivity shows expected output
Bug: 32163131
Bug: 36504926
Bug: 36988090
Bug: 38152109
Bug: 38186915
Bug: 38218697
Change-Id: I4a2129d780dfec7bca693486a100ea3c78465430
2017-05-28 18:05:23 +09:00
Erik Kline
aa75fc4ec9 Merge "Support registration of offload control callbacks." am: 7ee96625c2 am: 66cc06c2c7
am: 96c6d201f4

Change-Id: Ie3c4b0929ccf311b4f02fffe0908571cbbb7d772
2017-05-26 10:29:13 +00:00
Erik Kline
66cc06c2c7 Merge "Support registration of offload control callbacks."
am: 7ee96625c2

Change-Id: Ica4f51762b577e3868e87622df3963cd89daacae
2017-05-26 10:16:26 +00:00
Erik Kline
f4b6e34fc0 Support registration of offload control callbacks.
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: I054cdf6a277c77e4cbf5c81145446a9be1c5fe39
2017-05-26 16:47:04 +09:00
Hugo Benichi
6923028613 Merge changes If4deb106,Ib25d7658 am: 0388f0e47b am: 41a57af66a
am: ae278410f5

Change-Id: I4fa34b647e7b2408d4493cfb148ae7d8c24bd6e8
2017-05-26 00:58:27 +00:00
Hugo Benichi
41a57af66a Merge changes If4deb106,Ib25d7658
am: 0388f0e47b

Change-Id: Id10b2a80388aff2307cefd95ffb5f2b4df5fbdc3
2017-05-26 00:43:06 +00:00
Hugo Benichi
849b81b7ab @Ignore ConnectivityServiceTest#testRequestBenchmark
Ignore the last remaining test in ConnectivityServiceTest with spurious
failures. testRequestBenchmark has some intrinsic chances of failure due
to the fact it attempts to assert elapsed time durations against a
reference target.

Bug: 32561414
Test: no functional change
Change-Id: Ib25d76581b47997b2ef84df3e6a9fd9224b85d92
2017-05-26 07:18:15 +09:00
Erik Kline
292b65a6f1 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
Merged-In: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
Merged-In: I2644f518304a03da469fb9c2aa01a6d8f1a97901
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
(cherry picked from commit 7747fd4ce0)
2017-05-24 19:52:51 +09:00
Hugo Benichi
ea095c3e92 Merge "Move NsdServiceTest to correct directory" am: 0a76f99621 am: ca9fcb79f6
am: ecf4267889

Change-Id: Ib4e100fc8219b58ab7850407735a444dad3ec153
2017-05-24 07:15:09 +00:00
Hugo Benichi
ca9fcb79f6 Merge "Move NsdServiceTest to correct directory"
am: 0a76f99621

Change-Id: I37b614bec6dc4a9da55024c534dbfc9459e2764a
2017-05-24 06:59:02 +00:00
Treehugger Robot
0a76f99621 Merge "Move NsdServiceTest to correct directory" 2017-05-24 06:47:30 +00:00
Hugo Benichi
523d466b91 Move NsdServiceTest to correct directory
Test: no functional change
Bug: 62044295
Change-Id: Iad3af646e8d252f84978d1a367878a78c2869982
2017-05-24 14:18:48 +09:00
Jayachandran C
0223c80846 Merge "Fix up upstream interface types for case DUN_UNSPECIFIED"
am: 485d103083

Change-Id: I8e7c513b206cbc5f19d582ec48e529ce067e2aa9
2017-05-24 02:01:12 +00:00
Jayachandran C
5805982027 Fix up upstream interface types for case DUN_UNSPECIFIED
The existing logic will add TYPE_MOBILE and TYPE_MOBILE_HIPRI
even if the carrier config has TYPE_DUN for DUN_UNSPECIFIED.

A check is added not to modify the upstream interface types
if there is already a cellular interface type. Add TYPE_MOBILE
and TYPE_MOBILE_HIPRI if there is no cellular types found.

Test: Hotspot on Verizon and T-Mobile US.
      Verified the requestNetwork has the DUN capability.

Bug: 38186915
Change-Id: I74fc5c791fee2885bf66df8975e92c2b48f1668c
2017-05-23 14:02:46 -07:00
Jayachandran Chinnakkannu
128898d7e1 Merge "Fix up upstream interface types for case DUN_UNSPECIFIED" into oc-dev
am: be67aefca2

Change-Id: Ibfee591728c5cf01d8e11b7ccf2418194d398b59
2017-05-23 20:51:30 +00:00
Hugo Benichi
ef55f6c6cf Merge "Fix NetworkStatsObserversTest" am: 0dc35fa969 am: 25282c3e38
am: 814351c843

Change-Id: Ice4bb8de4267cba7a15a60838e165fab5ebade72
2017-05-23 14:18:30 +00:00
Hugo Benichi
25282c3e38 Merge "Fix NetworkStatsObserversTest"
am: 0dc35fa969

Change-Id: I9b4e83b4e437089ea500d82990e59558ff55e02a
2017-05-23 11:37:37 +00:00
Hugo Benichi
e6f44606ef Merge "Fix NetworkStatsAccessTest" am: ec1f25a4ba am: cdb75d321b
am: 85afabc4ec

Change-Id: I60f9d8867655a6aa24ee192c772d4c26a96c9bcd
2017-05-23 07:02:54 +00:00