Merge "[MS66] Initialize TrafficStats with context" am: a411d32226 am: 71aca9af8f am: db3f98710b am: 0fd819f75f

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956077

Change-Id: I5c1588157302b236ffa03329cde4f63277026bbf
This commit is contained in:
Junyu Lai
2022-01-22 01:15:07 +00:00
committed by Automerger Merge Worker
5 changed files with 42 additions and 19 deletions

View File

@@ -54,6 +54,7 @@ import android.hardware.display.DisplayManagerInternal;
import android.net.ConnectivityManager;
import android.net.ConnectivityModuleConnector;
import android.net.NetworkStackClient;
import android.net.TrafficStats;
import android.os.BaseBundle;
import android.os.Binder;
import android.os.Build;
@@ -1903,6 +1904,7 @@ public final class SystemServer implements Dumpable {
try {
networkStats = NetworkStatsService.create(context);
ServiceManager.addService(Context.NETWORK_STATS_SERVICE, networkStats);
TrafficStats.init(context);
} catch (Throwable e) {
reportWtf("starting NetworkStats Service", e);
}