Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release

Change-Id: Id08fdcae21e3ceb54e893a9ed11da6e67c889895
This commit is contained in:
Bill Yi
2018-11-28 18:45:59 -08:00
2 changed files with 15 additions and 1 deletions

View File

@@ -329,6 +329,14 @@ public class TrafficStats {
/**
* Remove any statistics parameters from the given {@link Socket}.
* <p>
* In Android 8.1 (API level 27) and lower, a socket is automatically
* untagged when it's sent to another process using binder IPC with a
* {@code ParcelFileDescriptor} container. In Android 9.0 (API level 28)
* and higher, the socket tag is kept when the socket is sent to another
* process using binder IPC. You can mimic the previous behavior by
* calling {@code untagSocket()} before sending the socket to another
* process.
*/
public static void untagSocket(Socket socket) throws SocketException {
SocketTagger.get().untag(socket);

View File

@@ -941,7 +941,13 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
@Override
public long getIfaceStats(String iface, int type) {
return nativeGetIfaceStat(iface, type, checkBpfStatsEnable());
// eBPF code doesn't provide per-interface TCP counters. Use xt_qtaguid for now.
// TODO: delete getMobileTcp(Rx|Tx)Packets entirely. See b/110443385 .
if (type == TYPE_TCP_TX_PACKETS || type == TYPE_TCP_RX_PACKETS) {
return nativeGetIfaceStat(iface, type, false);
} else {
return nativeGetIfaceStat(iface, type, checkBpfStatsEnable());
}
}
@Override