This does not affect existing classes in framework-tethering.jar
as everything inside android.net is excluded from being jarjar'ed.
It is a preparatory step to adding cronet to framework-tethering.jar
which will use jarjar.
Test: m
Change-Id: I8cc7babaa37f7aef52306a833593dba097fd26db
* changes:
Tethering: deprecate CONNECTIVITY_ACTION on U+ device
Test: add tests to testChooseDunUpstreamByAutomaticMode_*
TetheringTest: separate setup func from chooseDunUpstreamTestCommon
TestTetheringEventCallback may use assertEquals(actual, expected)
but assertEquals(expected, actual).
It is confused while test is failed.
For example:
Code:
callback.expectUpstreamChanged(new Network[] {null} /* expected */);
Before:
java.lang.AssertionError: expected:<100> but was:<null>
After:
java.lang.AssertionError: expected:<null> but was:<100>
Bug: 243516306
Test: atest TetheringTest
Change-Id: I6a987e4dd1cccc5e79da7dda55f194291e0c4a60
This test relies on forceGc to free and finalize the TetheringManager
before perform validation checks. In some test suites, if there were
already too many unused objects accumulated in the system before
running the test, it might take more than 5 seconds to free them.
Increase the maximum retry time to 30 seconds to fix the flakiness.
Bug: 263335396
Test: atest TetheringServiceTest#testTetheringManagerLeak
run the flaky test suite on ABTD with CL
Change-Id: I38bee3d43fbeb278993d113ccbe0645aedc5d75d
Automerger into tm-mainline-prod is currently broken, so this change
uses a Merged-In line that is already present in tm-mainline-prod (and
downstream from it). This means that this change must also be
cherry-picked into internal-master with a slightly different Merged-In
specification.
Test: TH
Merged-In: I555ad1ed687632cfe8a7e30283f80e80956fc1d4
Change-Id: I25096f4cc21923c602d77a66aad248d52b42b18f
A similar option already exists in
packages/modules/Connectivity/Cronet/apex/Android.bp. This is in
preparation of adding cronet to framework-tethering. It is possible that
we only end up using one of the variables but better safe than sorry.
This change will be blocked by the blocked automerger into
tm-mainline-prod. If this continues to be a problem, we might have to
play some tricks with automerger.
Test: TH
Change-Id: I40ba22aba041ec12ec2bf2881df14e6c0ee53b44
Respect the upstream interface mtu instead of always setting
mtu 1500.
Using upstream interface mtu is probably not the best solution
for tether offload pmtu but it at least respects the upstream
interface mtu which may be less than 1500.
Test: manual test
1. Connect to carrier Taiwan Star.
2. Enable tethering and check the mtu 1434 in dumpsys.
IPv4 Upstream: proto [inDstMac] iif(iface) src -> nat ->
dst [outDstMac] pmtu age
udp [02:10:45:32:ef:35] 54(54) 192.168.72.125:39034
-> 15(rmnet1) 100.83.189.11:39034
-> 142.251.43.14:443 [00:00:00:00:00:00] 1434 69657ms
IPv4 Downstream: proto [inDstMac] iif(iface) src -> nat
-> dst [outDstMac] pmtu age
udp [00:00:00:00:00:00] 15(rmnet1) 142.251.43.14:443
-> 54(54) 100.83.189.11:39034
-> 192.168.72.125:39034 [9a:8a:4d:ec:a4:7c] 1434 69633ms
Bug: 262860312
Test: atest BpfCoordinatorTest
Change-Id: Ic6dcb95ed76d5306053e4645b6baebc67ff082cf
Both CONNECTIVITY_ACTION and UpstreamNetworkMonitor monitor the
upstream connection status. The upstream status should be monitored
in one place and deprecated the duplicate one since U+ device.
Once CONNECTIVITY_ACTION is removed, CMD_UPSTREAM_CHANGED won't be
triggered anymore. For non-dun upstream netowrk , upstream
re-evaluation is triggered by EVENT_DEFAULT_SWITCHED and
EVENT_ON_LOST. For dun upstream re-evaluation, re-evaluation is
triggered by EVENT_ON_LINKPROPERTIES and EVENT_ON_LOST.
Changes:
1. Deprecate the CONNECTIVITY_ACTION broadcast.
2. Re-evaluate possible upstream selection on the event
UpstreamNetworkMonitor.EVENT_ON_LOST.
Note that EVENT_DEFAULT_SWITCHED and EVENT_ON_LINKPROPERTIES have
already triggered the upstream re-evaluation and keep as it.
Bug: 257408654
Bug: 257941865
Test: atest ConnectivityCoverageTests
Change-Id: I8b75cfb2fec51fb5bc4e2d13ad6b54daf8efc71e
Prepare to share setup function to more dun network tests.
No operation is changed.
Bug: 257408654
Test: TetheringTest
Change-Id: I29f08d8bc3cf83aa9d03f5d2819a1c67466b7bcc
The legacy upstream selection flow is never called after T. Stop the
related test cases after T also.
Bug: 257408654
Test: atest TetheringTests
Change-Id: I62692bb9a49dde432d31bece41b4cff442a327d1
This establishes the main Wear connection manager class,
and enforces T+ requirement.
Bug: 245972418
Change-Id: Ia60925ce4dc2a25ac61c4b9bae1d022dc74f5b05
Those static method and constants are better to fit in
NetlinkUitls. Replace the usage.
Test: m
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I81e27b8264e39764a44a4ba87344e9ac940d920a
This change introduces a limited library for dependencies on
framework-connectivity from Tethering,
connectivity-internal-api-util, where all classes are annotated with
@RequiresApi(S) to ensure proper API checks are done before usage.
Bug: 245972418
Change-Id: I82bafd9063341adc71d07f0858e6d68283d081f0
This change is part of aosp/2305844 to update
framework-configinfrastructure dependency.
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.
Test: m
bug: 253019048
Change-Id: Iba194c664c1c701e396e7a2a036bd03772644db8
Merged-In: Ic5323c10b7c899fbf9af41444915359f23db17b5
If we run an iterations test, TCP connections opened by previous tests
won't be closed immediately. They will stay in the TIME_WAIT state for
120 seconds before closed. Netfilter socket listens to both
NF_NETLINK_CONNTRACK_NEW and NF_NETLINK_CONNTRACK_DESTROY groups.
There is a tiny time gap between socket creation and sending dump
request to kernel. If an old TCP connection happened to be closed in
this time gap, listening socket would see a DESTROY message before
seeing the NEW messages triggered by dump request.
The current test only parsing the first contrack message in the read
buffer, so it will only find the DESTROY message and ignore all of the
following NEW messages. It does a netfilter socket dump, but does not
check whether the dump produces reasonable output. Now that we have
the ability to parse conntrack messages, do more in-depth checking.
Bug: 254608655
Test: atest ConntrackSocketTest --iteration 500
Change-Id: Icf95adb9d9390d598e9c6bdb4e245c5fce764e3e
This is a preparation for breaking down EthernetTetheringTest into
CTS and MTS tests.
Changes:
1. Separate common methods from EthernetTetheringTest
to EthernetTetheringTestBase.
Before:
EthernetTetheringTest
After:
[base class] [derived class]
EthernetTetheringTestBase +--+ EthernetTetheringTest
2. No test operation is changed.
Bug: 250552545
Bug: 258637850
Test atest EthernetTetheringTest
Change-Id: I36d205bf6f2a8145d5ac63c620af7528765b22ab
This is a preparation for breaking down EthernetTetheringTest into
CTS and MTS tests.
Changes:
1. Separate common variables from EthernetTetheringTest
to EthernetTetheringTestBase.
Before:
EthernetTetheringTest
After:
[base class] [derived class]
EthernetTetheringTestBase +--+ EthernetTetheringTest
2. Separate EthernetTetheringTest from aosp/2319857
Bug: 250552545
Bug: 258637850
Test atest EthernetTetheringTest
Change-Id: I9bccc558dc8b955055a2927a1a600afd399b264f
This is a preparation for breaking down EthernetTetheringTest into
CTS and MTS tests.
EthernetTetheringTest is going to separate test base class and
derived class. In order to encapsulate base class better, decouple
the following tests which access member variables directly.
- testStaticIpv4
- testLocalOnlyTethering
- testPhysicalEthernet
- testVirtualEthernet
- testVirtualEthernetAlreadyExists
Above tests change to use local veriables instead of class member
variables: mDownstreamReader, mDownstreamIface,
mTetheringEventCallback, mTetheredInterfaceRequester.
This can help to decouple the tests with class member variables and
these class member variables can be private in the
base class EthernetTetheringTestBase since the following commit.
Bug: 250552545
Bug: 258637850
Test atest EthernetTetheringTest
Change-Id: Ifd855571337b34c1dfee5cb2791369de754bc94d
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.
Test: m
bug: 253019048
Change-Id: I29f993342e1baf4e75b30c8d99de10bc087a582b
mRaemon only be created at BaseServingState#enter() and set to null at
BaseServingState#exit(). Thus, updateUpstreamIPv6LinkProperties just be
no-op in InitialState.
Test: atest TetheringTests MtsTetheringTestLatestSdk CtsTetheringTest
Change-Id: I0b8403a2acffb1aa0f40d2ad8721d4eff7c63ff0
isEthernetTetheringSupported() has been not used since
using TetheringManager#isTetheringSupported in aosp/2143272.
Bug: 258637850
Test: EthernetTetheringTest
Change-Id: Ifc560613301393eeadb6df11688944b2dc629c35