Add ThrowableBiConsumer to BpfCoordinatorShim

Change-Id: Iecf001ac6d9f53a64f903f5b8ab069d6be93f50a
This commit is contained in:
Tyler Wear
2022-02-09 16:25:14 -08:00
parent c05d86b850
commit 6d80f10bb3
3 changed files with 6 additions and 8 deletions

View File

@@ -27,14 +27,13 @@ import android.util.SparseArray;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.android.net.module.util.IBpfMap.ThrowingBiConsumer;
import com.android.net.module.util.bpf.Tether4Key; import com.android.net.module.util.bpf.Tether4Key;
import com.android.net.module.util.bpf.Tether4Value; import com.android.net.module.util.bpf.Tether4Value;
import com.android.networkstack.tethering.BpfCoordinator.Dependencies; import com.android.networkstack.tethering.BpfCoordinator.Dependencies;
import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule; import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule;
import com.android.networkstack.tethering.TetherStatsValue; import com.android.networkstack.tethering.TetherStatsValue;
import java.util.function.BiConsumer;
/** /**
* Bpf coordinator class for API shims. * Bpf coordinator class for API shims.
*/ */
@@ -164,7 +163,7 @@ public class BpfCoordinatorShimImpl
@Override @Override
public void tetherOffloadRuleForEach(boolean downstream, public void tetherOffloadRuleForEach(boolean downstream,
@NonNull BiConsumer<Tether4Key, Tether4Value> action) { @NonNull ThrowingBiConsumer<Tether4Key, Tether4Value> action) {
/* no op */ /* no op */
} }

View File

@@ -30,6 +30,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.android.net.module.util.BpfMap; import com.android.net.module.util.BpfMap;
import com.android.net.module.util.IBpfMap.ThrowingBiConsumer;
import com.android.net.module.util.bpf.Tether4Key; import com.android.net.module.util.bpf.Tether4Key;
import com.android.net.module.util.bpf.Tether4Value; import com.android.net.module.util.bpf.Tether4Value;
import com.android.networkstack.tethering.BpfCoordinator.Dependencies; import com.android.networkstack.tethering.BpfCoordinator.Dependencies;
@@ -47,7 +48,6 @@ import com.android.networkstack.tethering.TetherUpstream6Key;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.IOException; import java.io.IOException;
import java.util.function.BiConsumer;
/** /**
* Bpf coordinator class for API shims. * Bpf coordinator class for API shims.
@@ -410,7 +410,7 @@ public class BpfCoordinatorShimImpl
@Override @Override
public void tetherOffloadRuleForEach(boolean downstream, public void tetherOffloadRuleForEach(boolean downstream,
@NonNull BiConsumer<Tether4Key, Tether4Value> action) { @NonNull ThrowingBiConsumer<Tether4Key, Tether4Value> action) {
if (!isInitialized()) return; if (!isInitialized()) return;
try { try {

View File

@@ -22,14 +22,13 @@ import android.util.SparseArray;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.android.net.module.util.IBpfMap.ThrowingBiConsumer;
import com.android.net.module.util.bpf.Tether4Key; import com.android.net.module.util.bpf.Tether4Key;
import com.android.net.module.util.bpf.Tether4Value; import com.android.net.module.util.bpf.Tether4Value;
import com.android.networkstack.tethering.BpfCoordinator.Dependencies; import com.android.networkstack.tethering.BpfCoordinator.Dependencies;
import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule; import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule;
import com.android.networkstack.tethering.TetherStatsValue; import com.android.networkstack.tethering.TetherStatsValue;
import java.util.function.BiConsumer;
/** /**
* Bpf coordinator class for API shims. * Bpf coordinator class for API shims.
*/ */
@@ -163,7 +162,7 @@ public abstract class BpfCoordinatorShim {
*/ */
@Nullable @Nullable
public abstract void tetherOffloadRuleForEach(boolean downstream, public abstract void tetherOffloadRuleForEach(boolean downstream,
@NonNull BiConsumer<Tether4Key, Tether4Value> action); @NonNull ThrowingBiConsumer<Tether4Key, Tether4Value> action);
/** /**
* Whether there is currently any IPv4 rule on the specified upstream. * Whether there is currently any IPv4 rule on the specified upstream.