Merge "simplify tcpTx/RxPackets" into main
This commit is contained in:
@@ -683,33 +683,13 @@ public class TrafficStats {
|
|||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public static long getMobileTcpRxPackets() {
|
public static long getMobileTcpRxPackets() {
|
||||||
long total = 0;
|
return UNSUPPORTED;
|
||||||
for (String iface : getMobileIfaces()) {
|
|
||||||
long stat = UNSUPPORTED;
|
|
||||||
try {
|
|
||||||
stat = getStatsService().getIfaceStats(iface, TYPE_TCP_RX_PACKETS);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
throw e.rethrowFromSystemServer();
|
|
||||||
}
|
|
||||||
total += addIfSupported(stat);
|
|
||||||
}
|
|
||||||
return total;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public static long getMobileTcpTxPackets() {
|
public static long getMobileTcpTxPackets() {
|
||||||
long total = 0;
|
return UNSUPPORTED;
|
||||||
for (String iface : getMobileIfaces()) {
|
|
||||||
long stat = UNSUPPORTED;
|
|
||||||
try {
|
|
||||||
stat = getStatsService().getIfaceStats(iface, TYPE_TCP_TX_PACKETS);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
throw e.rethrowFromSystemServer();
|
|
||||||
}
|
|
||||||
total += addIfSupported(stat);
|
|
||||||
}
|
|
||||||
return total;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user