Merge "Check for bpf support at NetworkStatsService start"
am: 0defa6e72c
Change-Id: Ia2b5c8c7b7185787fee57281727b366752ef887f
This commit is contained in:
@@ -179,6 +179,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
|
||||
private final PowerManager.WakeLock mWakeLock;
|
||||
|
||||
private final boolean mUseBpfTrafficStats;
|
||||
|
||||
private IConnectivityManager mConnManager;
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -328,6 +330,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
mStatsObservers = checkNotNull(statsObservers, "missing NetworkStatsObservers");
|
||||
mSystemDir = checkNotNull(systemDir, "missing systemDir");
|
||||
mBaseDir = checkNotNull(baseDir, "missing baseDir");
|
||||
mUseBpfTrafficStats = new File("/sys/fs/bpf/traffic_uid_stats_map").exists();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -916,7 +919,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
}
|
||||
|
||||
private boolean checkBpfStatsEnable() {
|
||||
return new File("/sys/fs/bpf/traffic_uid_stats_map").exists();
|
||||
return mUseBpfTrafficStats;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user