Merge "Avoid NPE when missing network stats." into ics-mr1

This commit is contained in:
Jeff Sharkey
2011-12-12 20:19:27 -08:00
committed by Android (Google) Code Review

View File

@@ -1060,8 +1060,10 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
}
// clear UID from current stats snapshot
mLastPollUidSnapshot = mLastPollUidSnapshot.withoutUid(uid);
mLastPollNetworkXtSnapshot = computeNetworkXtSnapshotFromUid(mLastPollUidSnapshot);
if (mLastPollUidSnapshot != null) {
mLastPollUidSnapshot = mLastPollUidSnapshot.withoutUid(uid);
mLastPollNetworkXtSnapshot = computeNetworkXtSnapshotFromUid(mLastPollUidSnapshot);
}
// clear kernel stats associated with UID
resetKernelUidStats(uid);