Snap for 6371019 from 6f2fc99fbd543302f40049fd6c493a676cda4406 to mainline-release

Change-Id: I077942e37c7aa4ca802240ecbe1b0237249b97ba
This commit is contained in:
android-build-team Robot
2020-04-07 07:12:22 +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;
}
/**