diff options
author | Jeff Sharkey <jsharkey@google.com> | 2015-10-20 17:48:14 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-10-20 17:48:14 +0000 |
commit | 10338550c42421595896377f68545df1f8a93644 (patch) | |
tree | 385b8398a5f8759e65a6672386676e9552ca87bf | |
parent | 275a235437c3dfe4824cd1ca36aff38c81fa46fb (diff) | |
parent | a8bd650e810178358251e3099f949af8422d5a24 (diff) | |
download | packages_apps_Settings-10338550c42421595896377f68545df1f8a93644.zip packages_apps_Settings-10338550c42421595896377f68545df1f8a93644.tar.gz packages_apps_Settings-10338550c42421595896377f68545df1f8a93644.tar.bz2 |
Merge "Clamp large data usage values." into mnc-dr-dev am: 29b0ea2dbf
am: a8bd650e81
* commit 'a8bd650e810178358251e3099f949af8422d5a24':
Clamp large data usage values.
-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"); |