[NFCT.TETHER.3] Migrate tetherOffloadGetStats from netd to mainline

A preparation for updating BPF map in mainline module.

Test: TetheringCoverageTests
Change-Id: Ie73f7b4d9b191e62cfdfe2cfa3360cc7210f17e8
This commit is contained in:
Hungming Chen
2020-12-29 21:15:01 +08:00
parent dd55b91228
commit b350d7589f
10 changed files with 424 additions and 31 deletions

View File

@@ -21,6 +21,8 @@ import android.util.Log;
import androidx.annotation.NonNull;
import com.android.networkstack.tethering.TetherStatsValue;
import java.io.FileDescriptor;
import java.net.Inet6Address;
import java.net.SocketException;
@@ -91,6 +93,13 @@ public class TetheringUtils {
txPackets = tetherStats.txPackets;
}
public ForwardedStats(@NonNull TetherStatsValue tetherStats) {
rxBytes = tetherStats.rxBytes;
rxPackets = tetherStats.rxPackets;
txBytes = tetherStats.txBytes;
txPackets = tetherStats.txPackets;
}
public ForwardedStats(@NonNull ForwardedStats other) {
rxBytes = other.rxBytes;
rxPackets = other.rxPackets;