Add ThrowableBiConsumer to BpfCoordinatorShim
Change-Id: Iecf001ac6d9f53a64f903f5b8ab069d6be93f50a
This commit is contained in:
@@ -27,14 +27,13 @@ import android.util.SparseArray;
|
||||
import androidx.annotation.NonNull;
|
||||
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.Tether4Value;
|
||||
import com.android.networkstack.tethering.BpfCoordinator.Dependencies;
|
||||
import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule;
|
||||
import com.android.networkstack.tethering.TetherStatsValue;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* Bpf coordinator class for API shims.
|
||||
*/
|
||||
@@ -164,7 +163,7 @@ public class BpfCoordinatorShimImpl
|
||||
|
||||
@Override
|
||||
public void tetherOffloadRuleForEach(boolean downstream,
|
||||
@NonNull BiConsumer<Tether4Key, Tether4Value> action) {
|
||||
@NonNull ThrowingBiConsumer<Tether4Key, Tether4Value> action) {
|
||||
/* no op */
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
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.Tether4Value;
|
||||
import com.android.networkstack.tethering.BpfCoordinator.Dependencies;
|
||||
@@ -47,7 +48,6 @@ import com.android.networkstack.tethering.TetherUpstream6Key;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* Bpf coordinator class for API shims.
|
||||
@@ -410,7 +410,7 @@ public class BpfCoordinatorShimImpl
|
||||
|
||||
@Override
|
||||
public void tetherOffloadRuleForEach(boolean downstream,
|
||||
@NonNull BiConsumer<Tether4Key, Tether4Value> action) {
|
||||
@NonNull ThrowingBiConsumer<Tether4Key, Tether4Value> action) {
|
||||
if (!isInitialized()) return;
|
||||
|
||||
try {
|
||||
|
||||
@@ -22,14 +22,13 @@ import android.util.SparseArray;
|
||||
import androidx.annotation.NonNull;
|
||||
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.Tether4Value;
|
||||
import com.android.networkstack.tethering.BpfCoordinator.Dependencies;
|
||||
import com.android.networkstack.tethering.BpfCoordinator.Ipv6ForwardingRule;
|
||||
import com.android.networkstack.tethering.TetherStatsValue;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* Bpf coordinator class for API shims.
|
||||
*/
|
||||
@@ -163,7 +162,7 @@ public abstract class BpfCoordinatorShim {
|
||||
*/
|
||||
@Nullable
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user