Snap for 6370344 from d5729ebc66f333af206c96e81f9e1c18129d7f83 to rvc-release

Change-Id: Ia051ce889de0ccce3eb4d428daee4e33d7f23046
This commit is contained in:
android-build-team Robot
2020-04-07 02:05:37 +00:00

View File

@@ -1195,18 +1195,24 @@ public final class NetworkStats implements Parcelable {
/**
* Remove all rows that match one of specified UIDs.
* This mutates the original structure in place.
* @hide
*/
public void removeUids(int[] uids) {
int nextOutputEntry = 0;
for (int i = 0; i < size; i++) {
if (!ArrayUtils.contains(uids, uid[i])) {
maybeCopyEntry(nextOutputEntry, i);
nextOutputEntry++;
}
}
filter(e -> !ArrayUtils.contains(uids, e.uid));
}
size = nextOutputEntry;
/**
* Remove all rows that match one of specified UIDs.
* @return the result object.
* @hide
*/
@NonNull
public NetworkStats removeEmptyEntries() {
final NetworkStats ret = this.clone();
ret.filter(e -> e.rxBytes != 0 || e.rxPackets != 0 || e.txBytes != 0 || e.txPackets != 0
|| e.operations != 0);
return ret;
}
/**