There is pollingConnector thread which start polling connector if
TetheringManager is created earlier than TetheringService started(during
device boot up). TetheringManager won't be GCed if pollingConnector
thread do not finish its task yet.
Bug: 177265744
Bug: 191798390
Bug: 187972579
Test: atest TetheringServiceTest
Change-Id: Id8c7d10c5172e1d5de460c5311ff9c20261facef
TetheringCallbackInteranl is inner class which explicitly reference
TetheringManager object. This causes TetheringManager can't be GC. Using
static nested class which has its own lifecycle and weak reference
TetheringManager object.
Still have a leak inside Tethering that TetheringCallbackInternal is
never unregistered. Currently it rely on binder died to remove the
reference, which usually happen in kill process. If process keep alive,
the TetheringCallbackInternal would not be freed even TetheringManager is
gone. Will have follow CL to fix this.
Bug: 177265744
Bug: 191798390
Bug: 187972579
Test: 1. lunch Settings with ON/OFF tethering, dump java heap.
2. close Settings and restart Settings again, dump java heap.
3. Compare java heap between step 1 and step 2.
Change-Id: I0e2a21b7988115098a033a581cd98da8bffe2791
This is a no-op CL which add TetheringTester and move runDhcp related
logic to it.
Test: atest EthernetTetheringTest
Change-Id: Ib1c5647b2bd5a1b27c976450d3aa265aff8f5b70
- Rename the conntrack destination port check function
- Use CollectionUtils.contains to check the denied ports
- Add tests for the streams with ftp and pptp tcp port are
not able to be offloaded
Bug: 195914327
Test: atest TetheringCoverageTests
Change-Id: I7e2591bea1f6db46271efb0c30970fb8d4efe1e4
This test fails on devices where physical Ethernet interfaces are
available but marked restricted, like cuttlefish.
Bug: 197462993
Test: test-only change
Change-Id: I15c991b2e43e2d5e823dcdcfbd74adfd9b2f6f08
Use exact alarm to fix entilement recheck delay problem while device
asleep.
Bug: 195370891
Test: atest TehteringTests
Change-Id: I409e603bf2b990657551e1140b50f69640c328d8
Needed because an invalid file descriptor should notify the caller to
stop using the object.
Bug: 190523685
Test: atest BpfMaptest
Change-Id: I70fb08b54b1c0caa4be4e3f07b59bf4f2397f39d
Using jarjar on intermediate libraries causes issues when they are
combined with other libraries that use different jarjar rules, as the
resulting binary may contain multiple incompatible copies of the
classes. Instead, jarjar should be used on the final artifact, after
combining the libraries.
Ensure NetworkStackJarJarRules is not applied on intermediate libraries
like TetheringIntegrationTestsLib, but instead apply it on
TetheringIntegrationTests or CtsTetheringTest.
Bug: 192535368
Test: atest TetheringCoverageTests TetheringIntegrationTests \
CtsTetheringTest
Change-Id: I248a533651984de81f676336c0e74e3788610bbb
Use CollectionUtils instead, which avoids using a hidden API.
Avoiding hidden API usage in tests is good in general, but this also
helps avoid jarjar problems where the com.android.internal.util package
is jarjared to some other package as some of its classes are included
in the module, and ArrayUtils cannot be found in the renamed package.
Bug: 192535368
Test: atest TetheringTest
Change-Id: I54dc8f6429d132a953ab1a674fe349fba4335936
Also ignore DadProxyTest before S because it is only enabled from S.
To using ignore test rule, replace AndroidJunit with DevSdkIgnoreRunner.
It is fine because the we don't use the test UI (e.g. running test in UI
thread).
Test: atest TetheringPrivilegedTests
Change-Id: I701ee877520f78ded2394adbae1f4d9dd612d700
After moving all netlink-client stuff to frameworks/libs/net/common
and build it as an individual library, deprecate the netlink-client
lib and use net-utils-device-common-netlink instead.
Due to that the package name of netlink lib has changed, also update the
package name used in Tethering and ConnectivityService module.
Bug: 192535368
Test: atest TetheringTests TetheringIntegrationTests
Change-Id: Ic2078caf67a640836d98c5a2e4ca89939adcb896
This reverts commit a5c742be69.
Reason for revert:
Stop releasing this commit because it needs more test coverage.
Bug: 190783768
Bug: 192804833
Change-Id: I6e6b40b0f6207ed197d01bfabb616f1afa31fb70
Test: atest TetheringCoverageTests
This reverts commit 299a81157c.
Reason for revert:
Stop releasing this commit because it needs more test coverage.
Bug: 190783768
Bug: 192804833
Change-Id: I6a0d93e04814ae73e1ec7d6fd4df19e1d2787207
Test: atest TetheringCoverageTests
Bpf offload do not support VCN network yet, don't start bpf offload
if the interface is ipsec*.
Bug: 191178945
Test: atest TetheringTests
Change-Id: I1ad8cededddec42f45b08aaa31d583c548d105f0
Needed because a payload data packet may have gone through
non-offload path, before we added offload rules, and that this
may result in in-kernel conntrack state being in ESTABLISHED
but pending ACK (ie. UNACKED) state. But the in-kernel conntrack
might never see the ACK because we just added offload rules.
As such after adding the rules we need to force the timeout back
to the normal ESTABLISHED timeout of 5 days.
Issue: the timeout is set to unacknowledged 300s (countdwon to 298s)
$ adb shell cat /proc/net/nf_conntrack
ipv4 2 tcp 6 298 ESTABLISHED src=192.168.244.128
dst=140.112.8.116 sport=45694 dport=443 ..
Test: atest TetheringCoverageTests
Manual check:
$ adb shell cat /proc/net/nf_conntrack
ipv4 2 tcp 6 431988 ESTABLISHED src=192.168.40.162
dst=140.112.8.116 sport=40774 dport=443 ..
Bug: 190783768
Bug: 192804833
Change-Id: I8c34e85e26c9d976e5e2b85473db75ff46d8abd4
This is a preparation for only update the tcp timeout while
adding rules. Also add slack time for updating UDP timeout
interval.
Bug: 190783768
Bug: 192804833
Test: atest TetheringCoverageTests
Change-Id: I3151b531e6581e257f3cfa39ad2fcf1650358b3d