diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-07 18:49:15 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-07 18:49:15 -0800 |
commit | 64e314b61e865919fc8c94165e42dfc5fb7b92f4 (patch) | |
tree | abdadcbf11c325bdf7f79a1ba051043a82909211 /src/com/android/settings/widget | |
parent | 89ae71c089067d2cd6a3e7304f4126abb57ab9be (diff) | |
parent | 46742e0cf933abfcf65be9009cd9262863280c34 (diff) | |
download | packages_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/widget')
-rw-r--r-- | src/com/android/settings/widget/ChartDataUsageView.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/settings/widget/ChartDataUsageView.java b/src/com/android/settings/widget/ChartDataUsageView.java index cc9acd6..6fb805b 100644 --- a/src/com/android/settings/widget/ChartDataUsageView.java +++ b/src/com/android/settings/widget/ChartDataUsageView.java @@ -22,6 +22,7 @@ import android.content.Context; import android.content.res.Resources; import android.net.NetworkPolicy; import android.net.NetworkStatsHistory; +import android.net.TrafficStats; import android.os.Handler; import android.os.Message; import android.text.Spannable; @@ -33,6 +34,7 @@ import android.text.format.Formatter.BytesResult; import android.text.format.Time; import android.util.AttributeSet; import android.util.Log; +import android.util.MathUtils; import android.view.MotionEvent; import android.view.View; @@ -535,6 +537,7 @@ public class ChartDataUsageView extends ChartView { @Override public long buildLabel(Resources res, SpannableStringBuilder builder, long value) { + value = MathUtils.constrain(value, 0, TrafficStats.TB_IN_BYTES); final BytesResult result = Formatter.formatBytes(res, value, Formatter.FLAG_SHORTER | Formatter.FLAG_CALCULATE_ROUNDED); setText(builder, sSpanSize, result.value, "^1"); |