Adjust map names due to new bpfloader

With the new loader support added. The bpf map format is defined by bpf
kernel program as well. Change the netd bpf program to the new format.

Test: CtsUsageStatsTestCases
Bug: 112334572
Change-Id: I34e38e0a8cf0cca54dc52ec897771452f9d90525
This commit is contained in:
Chenbo Feng
2018-12-22 13:20:31 -08:00
parent ab3b396c45
commit 150dc6f187
2 changed files with 3 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ import static android.net.NetworkStats.SET_ALL;
import static android.net.NetworkStats.TAG_ALL;
import static android.net.NetworkStats.TAG_NONE;
import static android.net.NetworkStats.UID_ALL;
import static com.android.server.NetworkManagementSocketTagger.kernelToTag;
import android.annotation.Nullable;
@@ -33,10 +34,8 @@ import com.android.internal.util.ProcFileReader;
import libcore.io.IoUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.net.ProtocolException;
import java.util.Arrays;
@@ -127,7 +126,7 @@ public class NetworkStatsFactory {
}
public NetworkStatsFactory() {
this(new File("/proc/"), new File("/sys/fs/bpf/traffic_uid_stats_map").exists());
this(new File("/proc/"), new File("/sys/fs/bpf/map_netd_app_uid_stats_map").exists());
}
@VisibleForTesting