To backward compatible existing behavior, make tethering APIs
unsupported synchronously when tethering is disallowed. There
are two APIs register/unregisterTetheringEventCallback still
supported even tethering is disallowed.
This could avoid some existing tests flaky. The test assume
startTethering would fail right away after tethering restricted
apply.
Bug: 184996041
Bug: 239500515
Test: atest TetheringTests
Change-Id: I41ae1d61647c9baf69bcb246965e8d9b4a89b497
When enable/disable tethering quickly, tethering may have stopped
when Ipserver start creatFd().
As tethering iface is down due to tethering stopped, creatFd() will
throw ErrnoException: bind failed: ENODEV (No such device).
When tethering is stopped, this exception is normal, should not
rise WTF.
Bug: 233587050
Test: manual test
Change-Id: I2e200313d1bec2c1e1245e779f3875397127160d
"{@see" aren't rendered properly. Replace them with "See {@link"
or @see depending on the usage.
Bug: 238753273
Test: make doc-comment-check-docs ; Check the doc result
Change-Id: I70cb2f36e7c5fa8102b5949054df5184d755202c
tethering-module-utils-srcs filegroup only contains NetdUtils.java
class, import this class from netd-client static lib instead.
Bug: 238960524
Test: m
Change-Id: I7547c3a3a13e564408cdf8e702f3438530763381
NetworkStack module utils are duplicated to net-utils-device-common-ip,
delete the module utils source code and use net-utils-device-common-ip
instead.
Bug: 235901424
Test: atest TetheringTests
Change-Id: I19fe72a92d6de1084963c2b3a38d094f8da2a91e
There is a bug in TetheringMetrics that the on-going builders would be
cleared when creating new builder. This means if multiple tethering
created at the same time, only latest tethering would have metrics.
Bug: 153942334
Test: atest TetheringTests
Change-Id: I16a66790bc19072d8ffe570348bcbafa91263573
changeInterfaceState only used in enableIpServing which always
pass STATE_TETHERED or STATE_LOCAL_ONLY state. Move it into
enableIpServing directly and remove unused code.
Test: m
Change-Id: I2d91115e588a153ddcb9d61f8e2bc09a09c52d48
Move base64 related bpf map function and constant to f/l/n.
This is preparation for testing BPF map in ClatCoordinator.
Test: atest EthernetTetheringTest
Change-Id: Ieb1e0a0f128c9aa0d7c9f043e90eecf3c61252f5
This is a preparing change.
1) In enableWifiIpServing, replace
ensureIpServerStarted(ifname) +
changeInterfaceState(ifname, ipServingMode)
with enableIpServing(TETHERING_WIFI, ifname, ipServingMode).
And checking whether corresponding wifi or p2p feature is
avaialble before enableWifiIpServing. Note: If the wifi or p2p
feature wasn't supported before, it would still call
changeInterfaceState without ipServer created but
changeInterfaceState would be no-op because there is no
corresponding ipServer for changing state.
2) Splitting enableWifiIpServing into enableWifiIpServing and
enableWifiP2pIpServing.
3) No longer guess the interface name after T. WIFI_AP_STATE_CHANGED
intent should always include ifname and it should be tracked by
mTetherStates. If OEM have modification in wifi framework to send
empty ifname, tethering no longer support this after T.
4) After T, tethering always trust the ifname which pass by wifi or p2p
intent broadcast and treat it as TETHERING_WIFI or
TETHERING_WIFI_P2P. This allow tethering to deprecate wifi/p2p regexs
after T.
Bug: 189410000
Bug: 178116595
Bug: 185451791
Bug: 190145323
Bug: 176048959
Test: atest TetheringTests
Change-Id: Ia5f69ddf2d842536ce0df75eeae57866f56df571
Before T, wifi local only mode won't update onConnectedClientsChanged.
To support updating tethered client information for localOnly hotspot,
register localOnly softap callback to get connected wifi client update.
Bug: 171928468
Test: atest TetheringTests
Change-Id: I0e974feea9497809ea02a4138c7b9c2c584a8a45
Fill in downstream type, upstream type, error code and user type to NetworkTetheringReported.
Bug: 153942334
Test: m, flash and boot
Test: atest TetheringMetricsTest
Change-Id: I6ba7d9e512b1ada519f44f9f3a95667e4b0f03c0
Make that tethering dumpsys can choose which map to dump.
The related functions in BpfCoordinator and its test are refactored
into template functions. This is used in the following commits which
will dump stats map for testing.
Bug: 227159997
Test: atest TetheringCoverageTests
Change-Id: I23d747543d16a971773c132b60227eb3f42efe25
This new callback could tell caller Tethering is supported for what tethering
types.
Bug: 184996041
Test: atest TetheringTests
atest EthernetTetheringTest
CTS-Coverage-Bug: 223340235
Change-Id: Ib80ed8d7f73f4a098b8965db186d24d8cf1884d3
EthernetTetheringTest needs to parse BPF map content for bpf stats
tests. Move the struct class files to common libs.
Compare TetherStats{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.
$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java
17c17
< package com.android.networkstack.tethering;
Bug: 227159997
Test: atest TetheringCoverageTests
Change-Id: I87193cb6409b4d19c72184011d7e99275800dab1
Add new rro configuration which can be used to make the p2p dhcp
prefix length larger to reserve the address range outside of leases
subnet prefix length for EAPOL-Key feature. This configuration only
valid if its value larger than dhcp server address prefix length and
config_tether_enable_legacy_wifi_p2p_dedicated_ip is true.
E.g.:leaseSubnetPrefixLength = 25, p2p static address = 192.168.49.1/24
dhcp range: 192.168.49.0 ~ 192.168.49.127 (192.168.49.1/25), reserved
192.168.49.128 ~ 192.168.49.255 for EAPOL-Key feature.
Bug: 170056953
Test: atest TetheringTests
Change-Id: I1319efd871796da7234383a29ab64a1623101ae7
also remove the redundant constructor definition in
test key/value class builder.
Test: atest TetheringCoverageTests
Change-Id: Icf93d4f196846c82c3a1c2b2b8697f4a5156ea92
When KEY_CARRIER_SUPPORTS_TETHERING_BOOL=false, it will behave as if
entitlement check failed and a system notifcation shows up if user
tries to turn on tethering from Settings UI.
Bug: 161206517
Test: manual
Change-Id: I78da390ecb0c8f4f68285ef16da80653f136c11e
There is U32 added in frameworks/libs/net. Use shared one to avoid
duplicated code.
Bug: 215095957
Test: m
Change-Id: I861bc2f65ea947a908de2ec83e9b137d3342c8ce
Currently if wifi, usb and bluetooth tethering is not supported,
isTetheringSupported would return false. Then ethernet, ncm tethering
and wifi p2p would also not be supported anymore. Make
isTetheringSupported respect all tethering downstreams after T.
Also remove redundant code:
1. tethering always has upstream configuration, checking whether has
upstream configuration for isTetheringSupported is useless.
2. Remove TetheringDependencies#isTetheringSupported because it don't
have any caller.
Test: atest TetheringTests
Change-Id: I3db5ce410c064d37c9e9e704fce2a2b68705834e
This is a no-op CL that passing whole TetheringConfiguration to IpServer
to reduce the number of IpServer constructor parameters.
Bug: 170056953
Test: atest TetheringTests
Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9