java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage
at android.os.StrictMode.onUntaggedSocket(StrictMode.java:2010)
at com.android.server.NetworkManagementSocketTagger.tag(NetworkManagementSocketTagger.java:78)
at libcore.io.BlockGuardOs.tagSocket(BlockGuardOs.java:47)
at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:66)
at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:188)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:416)
at java.net.ServerSocket.implAccept(ServerSocket.java:547)
at java.net.ServerSocket.accept(ServerSocket.java:515)
at org.nanohttpd.protocols.http.NanoHTTPD$ServerRunnable.run(NanoHTTPD.java:1476)
at java.lang.Thread.run(Thread.java:764)
It should be enough to add TrafficStats.setThreadStatsTag("NanoHTTPD$ServerRunnable".hashCode()); to ServerRunnable.run
and TrafficStats.setThreadStatsTag("NanoHTTPD.Start".hashCode()); to NanoHTTPD.Start.
(requires import android.net.TrafficStats;)
It should be enough to add
TrafficStats.setThreadStatsTag("NanoHTTPD$ServerRunnable".hashCode());
toServerRunnable.run
andTrafficStats.setThreadStatsTag("NanoHTTPD.Start".hashCode());
toNanoHTTPD.Start
. (requiresimport android.net.TrafficStats;
)