Merge "Do not start conntrack event monitor when running on R" am: c162fc297f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639703 Change-Id: Ib43879926b0b6789025ab2360c8dc0de1f28090f
This commit is contained in:
@@ -426,7 +426,8 @@ public class BpfCoordinator {
|
||||
* See NetlinkMonitor#handlePacket, NetlinkMessage#parseNfMessage.
|
||||
*/
|
||||
public void startMonitoring(@NonNull final IpServer ipServer) {
|
||||
if (!isUsingBpf()) return;
|
||||
// TODO: Wrap conntrackMonitor starting function into mBpfCoordinatorShim.
|
||||
if (!isUsingBpf() || !mDeps.isAtLeastS()) return;
|
||||
|
||||
if (mMonitoringIpServers.contains(ipServer)) {
|
||||
Log.wtf(TAG, "The same downstream " + ipServer.interfaceName()
|
||||
@@ -447,6 +448,9 @@ public class BpfCoordinator {
|
||||
* Note that this can be only called on handler thread.
|
||||
*/
|
||||
public void stopMonitoring(@NonNull final IpServer ipServer) {
|
||||
// TODO: Wrap conntrackMonitor stopping function into mBpfCoordinatorShim.
|
||||
if (!isUsingBpf() || !mDeps.isAtLeastS()) return;
|
||||
|
||||
mMonitoringIpServers.remove(ipServer);
|
||||
|
||||
if (!mMonitoringIpServers.isEmpty()) return;
|
||||
|
||||
@@ -1150,6 +1150,7 @@ public class BpfCoordinatorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
public void testStartStopConntrackMonitoring() throws Exception {
|
||||
setupFunctioningNetdInterface();
|
||||
|
||||
@@ -1170,6 +1171,7 @@ public class BpfCoordinatorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
public void testStartStopConntrackMonitoringWithTwoDownstreamIfaces() throws Exception {
|
||||
setupFunctioningNetdInterface();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user