Commit a92214a1 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Fix NullPointerException in Data Breakdown Difference UMA

Bug: 852120
Change-Id: I11844f1785fa3f6bd6e19ed28ea8dfe25f3dd11f
Reviewed-on: https://chromium-review.googlesource.com/1099042
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Reviewed-by: default avatarDoug Arnett <dougarnett@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566950}
parent e477e1f0
......@@ -288,6 +288,13 @@ public class DataReductionStatsPreference extends Preference {
mStartDatePhrase = formatDate(context, start);
mEndDatePhrase = formatDate(context, end);
DataReductionProxyUma.dataReductionProxyUserViewedSavings(
compressedTotalBytes, originalTotalBytes);
// Here to the end of the method checks for a difference in the reported data breakdown. If
// mSiteBreakdownItems is null, return early.
if (mSiteBreakdownItems == null) return;
long breakdownSavingsTotal = 0;
long breakdownUsageTotal = 0;
for (DataReductionDataUseItem item : mSiteBreakdownItems) {
......@@ -301,8 +308,6 @@ public class DataReductionStatsPreference extends Preference {
final int usageDiffPercent =
(int) (usageDiff / (breakdownUsageTotal + compressedTotalBytes) * 100);
DataReductionProxyUma.dataReductionProxyUserViewedSavings(
compressedTotalBytes, originalTotalBytes);
DataReductionProxyUma.dataReductionProxyUserViewedSavingsDifference(
savingsDiffPercent, usageDiffPercent);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment