When user restriction turns on, all tethering functions should
be disabled. But tethering functions still work after
restrication is on. Because tethering request would be removed
from mActiveTetheringRequests after starting tethering that
will result in Tethering#isTetheringActive() always returns
false. Thus, update the design to check tethered interface to
ensure that any of tethering function is working.
Bug: 169596583
Test: atest TetheringTests
Test: Manually test that tethering function would be disabled
and notification would show to user after restriction
was on.
Change-Id: Icb9649a5ecdec2d029ac763b5b9b80042ad50eb9
Tethering is updatable apex module that was launched in R, hence it and
all it dependencies should specify min_sdk_version <= 30.
Test: m
Bug: 171668006
Bug: 171330443
Change-Id: Ic91cf96dda6419d1038b0329b920f9cd24482aef
Merged-In: Ic91cf96dda6419d1038b0329b920f9cd24482aef
(cherry picked from commit bee20e84f8)
(cherry picked from commit 1fe1e539e1)
Tethering unit test would verify the interfaction between DadProxy and
IpServer. Since DadProxy only available in S+, the test would fail if it
build with R sdk.
Bug: 171936270
Test: atest TetheringTests in both R and S
Change-Id: Ia73d4aa59d01400d1ccfd3fdc1b721e269cae952
1. Add the missing countdown() in the test callback
2. Add ensureWifiConnected() to prevent no available network problem.
3. Increase the timeout for awaiting private DNS setting because
current one might not be enough.
Bug: 168027339
Test atest
Change-Id: I91190d8644ff7a7dfaf4fa3f2d43c17f67dfac11
Migration of frameworks/base/packages/Tethering is complete, removing
the OWNERS block.
This reverts commit 1623eb61d5.
BUG: 167962976
Test: TH
Change-Id: Ic89c084604788b4d41cf854e5015c8ce7791c64d
add AppModeFull@ to MultinetworkApiTest since CHANGE_NETWORK_STATE
could not be granted in instant mode.
CHANGE_NETWORK_STATE is required to select networks that are up but
not in the foreground, for example, the mobile network after the linger
timer has expired.
Bug: 168809106
Test: atest MultinetworkApiTest
atest MultinetworkApiTest --instant
Signed-off-by: Weilun Du <wdu@google.com>
Change-Id: I37ca1a0f58d1c2ab57f8cd4489c2cfb13b0f2d39
Also explicitly hold ACCESS_WIFI_STATE permission to avoid
no permission problem when using WifiManager#getScanResults
without shell identity.
Fix: 169219565
Test: "atest CtsTetheringTest" in cuttlefish and phyical device
Change-Id: I3d8fa7e8882bf96f61f3316a70efdf991addbcb2
Exempt-From-Owner-Approval: this change only adds the tests to
general-tests.zip, doesn't change any test behavior.
Bug: 171481522
Test: none
Change-Id: I1711237f00572d57f611dcd16ec9ad345a0b5b3b
The apache HTTP library is part of the platform core APIs, which are
separate from the core networking APIs.
cts/tests/tests/net is planned to move to a separate git project to put
it closer to the associated connectivity module code.
Bug: 170371348
Test: m cts && cts-tradefed run cts -m CtsApacheHttpTestCases
Change-Id: I49972b21755235e280c75eec40db14f3db974ca1
WifiManager#connect is implemented with a oneway binder call, so it may
return before the permission check. The previous code could drop shell
permissions before the check is performed.
Use WifiManager.ActionListener to wait for the operation to end before
dropping permissions.
Also refactor current usages of various "run as shell" utilities to use
TestPermissionUtil.runAsShell, which is the "standard" utility used in
connectivity tests (both in CTS and in other tests).
Bug: 170371191
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest
Change-Id: I0f47c455f2c1596a887abab7d35146d8557d736a
Also add MtsTetheringTest which only run if tethering mainline
module is installed.
Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
Change-Id: I434dda81eb5fab700d873a8ff3429b4222f0c7e6
The downstream do not be tracked if PrivateAddressCoordinator just
return cached address. Then, PrivateAddressCoordinator would not notify
that downstream if conflict happen.
Also remove the null check in getDownstreamPrefix because:
- An IpServer is only added to mDownstreams by requestDownstreamAddress.
- That method will only add the IpServer to mDownstreams if it has an
IPv4 address.
- As soon as that method returns, the IpServer sets mIpv4Address to the
address that was returned.
- When an IpServer is torn down, mIpv4Address is set to null after
releaseDownstream is called.
So it should never be possible for this to return null.
Bug: 168169687
Test: atest CtsTetheringTest
atest TetheringTests
Change-Id: Ide5206b013acdc499344e1c839a830c5b245af41
Modules shouldn't have TestApis, as documented in go/android-api-types.
Additionally, nothing depends on these TestApis existing.
Bug: 170395679
Test: m checkapi
Change-Id: I6e2c8298e90b4b54f0264be974d036fa08cd5632
Merged-In: I6e2c8298e90b4b54f0264be974d036fa08cd5632
This test catch the regression introduced in r.android.com/1432958.
Bug: 1432958
Test: atest TetheringTest
Change-Id: Id0c1afb5563954ffee1f598a3a5de6a245d77a0e
Currently tethering only pick prefix from 192.168.0.0/16. There is no
aviable tethering address if the upstream address is 192.168.x.y/16.
This change allow tethering to pick prefix from any private address
rnages. Now it still pick from 192.168.0.0/16 only to avoid behavior
change. Will have follow up commit to change the configuration.
Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
atest CtsTetheringTest
Change-Id: Ib6304eb8b4788e9196d0af48e72f00a6bda73a5f
The test had TODOs to address to use IpUtils and NetworkStackConstants
classes once they were moved to frameworks/libs/net. This is now done,
so using the new classes.
Bug: 158042941
Test: atest TetheringPrivilegedTests
Change-Id: I536b4506dbc3b42547ba9cb4e7c3c7a3e9459dd1