summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/ThrottleService.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-07-12 13:57:00 -0700
committerJeff Sharkey <jsharkey@android.com>2011-07-12 13:57:06 -0700
commitd37948f6ed1667d077e0e3a38808f42f981ddcc2 (patch)
tree1eff89e7cfde89a728d4019df9c311e1094b3b01 /services/java/com/android/server/ThrottleService.java
parent1ea4cc64643afb987ad42630eb146b4585647d0a (diff)
downloadframeworks_base-d37948f6ed1667d077e0e3a38808f42f981ddcc2.zip
frameworks_base-d37948f6ed1667d077e0e3a38808f42f981ddcc2.tar.gz
frameworks_base-d37948f6ed1667d077e0e3a38808f42f981ddcc2.tar.bz2
Hide NetworkStatsHistory internals.
Instead of exposing internal storage details, offer getValues() accessor which populates values into a recycled structure. Change-Id: I5228d7099a8f61b2018a435a813435a67dae49b4
Diffstat (limited to 'services/java/com/android/server/ThrottleService.java')
-rw-r--r--services/java/com/android/server/ThrottleService.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java
index 24d4dd3..b8890aa 100644
--- a/services/java/com/android/server/ThrottleService.java
+++ b/services/java/com/android/server/ThrottleService.java
@@ -515,8 +515,9 @@ public class ThrottleService extends IThrottleManager.Stub {
mIface, NetworkStats.UID_ALL, NetworkStats.TAG_NONE);
if (index != -1) {
- incRead = stats.rx[index] - mLastRead;
- incWrite = stats.tx[index] - mLastWrite;
+ final NetworkStats.Entry entry = stats.getValues(index, null);
+ incRead = entry.rxBytes - mLastRead;
+ incWrite = entry.txBytes - mLastWrite;
} else {
// missing iface, assume stats are 0
Slog.w(TAG, "unable to find stats for iface " + mIface);