summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DataUsageSummary.java
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-07 18:49:15 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-07 18:49:15 -0800
commit64e314b61e865919fc8c94165e42dfc5fb7b92f4 (patch)
treeabdadcbf11c325bdf7f79a1ba051043a82909211 /src/com/android/settings/DataUsageSummary.java
parent89ae71c089067d2cd6a3e7304f4126abb57ab9be (diff)
parent46742e0cf933abfcf65be9009cd9262863280c34 (diff)
downloadpackages_apps_Settings-64e314b61e865919fc8c94165e42dfc5fb7b92f4.zip
packages_apps_Settings-64e314b61e865919fc8c94165e42dfc5fb7b92f4.tar.gz
packages_apps_Settings-64e314b61e865919fc8c94165e42dfc5fb7b92f4.tar.bz2
Merge tag 'android-6.0.1_r3' of https://android.googlesource.com/platform/packages/apps/Settings into HEAD
Android 6.0.1 release 3 Change-Id: If54bacef03fc826fd02ca48db5ef3a25c8fc7127
Diffstat (limited to 'src/com/android/settings/DataUsageSummary.java')
-rw-r--r--src/com/android/settings/DataUsageSummary.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index d0b916f..ef12628 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -1174,6 +1174,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
mCycleAdapter.clear();
final Context context = mCycleSpinner.getContext();
+ NetworkStatsHistory.Entry entry = null;
long historyStart = Long.MAX_VALUE;
long historyEnd = Long.MIN_VALUE;
@@ -1196,9 +1197,20 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
final long cycleStart = computeLastCycleBoundary(cycleEnd, policy);
Log.d(TAG, "generating cs=" + cycleStart + " to ce=" + cycleEnd + " waiting for hs="
+ historyStart);
- mCycleAdapter.add(new CycleItem(context, cycleStart, cycleEnd));
+
+ final boolean includeCycle;
+ if (mChartData != null) {
+ entry = mChartData.network.getValues(cycleStart, cycleEnd, entry);
+ includeCycle = (entry.rxBytes + entry.txBytes) > 0;
+ } else {
+ includeCycle = true;
+ }
+
+ if (includeCycle) {
+ mCycleAdapter.add(new CycleItem(context, cycleStart, cycleEnd));
+ hasCycles = true;
+ }
cycleEnd = cycleStart;
- hasCycles = true;
}
// one last cycle entry to modify policy cycle day
@@ -1210,7 +1222,18 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
long cycleEnd = historyEnd;
while (cycleEnd > historyStart) {
final long cycleStart = cycleEnd - (DateUtils.WEEK_IN_MILLIS * 4);
- mCycleAdapter.add(new CycleItem(context, cycleStart, cycleEnd));
+
+ final boolean includeCycle;
+ if (mChartData != null) {
+ entry = mChartData.network.getValues(cycleStart, cycleEnd, entry);
+ includeCycle = (entry.rxBytes + entry.txBytes) > 0;
+ } else {
+ includeCycle = true;
+ }
+
+ if (includeCycle) {
+ mCycleAdapter.add(new CycleItem(context, cycleStart, cycleEnd));
+ }
cycleEnd = cycleStart;
}