Add Log.wtf when getSummaryForAllUid NPEs.

This will provide stack trace information from the system process
which should enable us to more easily track down where the crash is
occurring.

Test: Builds locally
Bug: 33427276
Change-Id: I584a568fc038771afb28a534e2eefe2f763ed5e1
This commit is contained in:
Jeff Davidson
2016-12-12 11:55:37 -08:00
parent 2c0dc3e094
commit 39583b53d1

View File

@@ -553,15 +553,21 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
@Override
public NetworkStats getSummaryForAllUid(
NetworkTemplate template, long start, long end, boolean includeTags) {
@NetworkStatsAccess.Level int accessLevel = checkAccessLevel(mCallingPackage);
final NetworkStats stats =
getUidComplete().getSummary(template, start, end, accessLevel);
if (includeTags) {
final NetworkStats tagStats = getUidTagComplete()
.getSummary(template, start, end, accessLevel);
stats.combineAllValues(tagStats);
try {
@NetworkStatsAccess.Level int accessLevel = checkAccessLevel(mCallingPackage);
final NetworkStats stats =
getUidComplete().getSummary(template, start, end, accessLevel);
if (includeTags) {
final NetworkStats tagStats = getUidTagComplete()
.getSummary(template, start, end, accessLevel);
stats.combineAllValues(tagStats);
}
return stats;
} catch (NullPointerException e) {
// TODO: Track down and fix the cause of this crash and remove this catch block.
Slog.wtf(TAG, "NullPointerException in getSummaryForAllUid", e);
throw e;
}
return stats;
}
@Override