1. Correct the API annotation.
2. The entry deletion failure causes the exception in cleanTestMap().
3. Use AtomicInteger to be the counter in the lambda.
Test: atest BpfMapTest
Change-Id: I4a56038881a38bda993ef5303b71f0e2a99f03d1
BT tethering is the only user of #tether and #untether API.
Enable BT tethering may fail by race between interface status change
and #tether call. In starting BT tethering flow, tethering may receive
pan interface DOWN and UP then PanService call #tether to request for
processing its pan interface. Tethering put interface status change
event into handler queue but it process #tether and #unether calls
right away without order them by queue. It makes tethering handle
binder call #tether before pan interface DOWN even DOWN event arrived
eailer. This cause BT tethering bring down by interface DOWN event
unexpectedly. Although this still can't fix all the race cases of
tethering, but at lesat this could fix the race mentioned above.
Bug: 173310882
Test: manual ON/OFF bt tethering
atest TetheringTests
Change-Id: I2411378aa36ad4371cca12423bb65542cb8df7a1
mForwardedDownstreams is the set of downstreams who wanted upstream.
In other word, it don't contains localOnly tethering(e.g. local only
hotspot, wifi p2p tethering). Changing the list from mForwardedDownstreams
to mNotifyList make both tethered and localOnly tethering have connected
clients callback.
Bug: 172290164
Test: atest TetheringTests
Change-Id: I58fdb28efc616b00d63a1c237ea93aee4d8f2dcd
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 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
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
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
Make the IP subnet persistent if it do not conflict with upstream.
It allow client to reuse its IP that usually reduce DHCP procedure.
Bug: 168169687
Test: atest TetheringTests
Change-Id: Iddc5304730dce7b11c5d124b7eddce057d752bbd
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.
Bug: 168868607
Test: m && atest NetworkStaticLibTests
Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c
r.android.com/1424920 changed the code but forgot to update the
unit test.
Also fix some lint errors.
Bug: 149109043
Test: atest TetheringTests TetheringPrivilegedTests
Change-Id: I53ca4b9877dcb4a759dee6ec63133653315d826f
Add the netfilter generic message header to
the netlink req. This is needed so the kernel
won't ignore the request for invalid params.
Bug: 149109043
Test: ConntrackSocketTest
Change-Id: I1757fdeb11a0cac5821021a22323cbd74fe22bdc
If vpn app make its netmask as 0, PrivateAddressCoordinator
would not able to find suitable address for tethering downstream.
Since tethering do not support vpn as upstream, just ignore vpn
in PrivateAddressCoordinator.
Bug: 166365863
Test: atest TetheringTests
atest CtsTetheringTest
Change-Id: Iabe265467044fea9fa437674ca29ffc7bcdefe3b
NetworkInterface#getByName can not get the interface without IP addresses.
When setIncludeTestInterfaces(true) is called, the interface will be
placed in client mode, which will delete the link-local address. So calling
NetworkInterface#getByName to get test interface may not work before
switching to server mode.
Bug: 168215721
Test: atest CtsTethering
Change-Id: Ice8adcce1c4b2c86bd219c701b2afa9ba2339f24
frameworks-base-testutils is unused in tethering integration tests, so
the dependency can be removed.
That test library also contains test classes, so removing the dependency
allows tethering tests to stop running the associated tests.
Also add jarjar rules to the unit tests to zap (remove) the test classes
from the output APK. Ideally the unit tests should stop depending on
that library too (TestableLooper can be used instead of TestLooper), or
the frameworks-base-testutils library should stop including test
classes.
Bug: 167968946
Test: m CtsTetheringTest TetheringTests
Change-Id: Ie950ce5b6181e388a7f71da430fd2dd8ada32e49
This patch is still needed and should go in now that the
error is fixed.
The patch was submitted into rvc-dev and is already in
rvc-dev-plus-aosp (patch in in ag/11923559, revert
skipped in ag/12072199). A follow-up will remove the
unused services.net-module-wifi target.
Test: originally tested in aosp/1324109
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I1074eedb0b0f156a1135e11210ec102de15ea674
Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
Some exsting applications may expect wifi p2p use legacy
"192.168.49.1/24" address. Have a configuration for wifi p2p to
decide whether to use legacy dedicated address or random address.
Bug: 161520826
Test: atest TetheringTests
Change-Id: If79973416a6780ee19ee785c65772b1a2dc1fbf7
All PendingIntent included activity and broadcast should set
FLAG_IMMUTABLE flag.
Bug: 156353008
Test: atest TetheringTests
Change-Id: I4592e914b67ecb8865d7de47797423f27e9ff840
If dhcp server is obsolete, explicitly stop it to shut down its thread.
Bug: 161418295
Test: atest CtsTetheringTest
Change-Id: Ic5b876bd23711ec8d832879a7baee0495246b218
Create TetheringPrivilegedTests which have MAINLINE_NETWORK_STACK
permission, the test can perform various network-related operations
which need CAP_NET_RAW and CAP_NET_ADMIN capabilities.
Bug: 145490751
Test: make TetheringPrivilegedTests
Change-Id: Ic205e5183e066766377c63336d9c5171d4875c6a