summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-05-04 12:53:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-04 12:53:14 -0700
commitbb1492f7fae9fbcdfcb02b6f8475fd98a236c244 (patch)
tree752e470605f10d16b0e761ae2517cb82520a077a /core/java
parentc065a8af1561544f1557e3f5036e45a4be4a6d7e (diff)
parentac3fcb1590e1da21324c13ce237ec48f2bf488bf (diff)
Merge "Reduce persist threshold for lower warning/limit." into jb-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/INetworkStatsService.aidl2
-rw-r--r--core/java/android/util/MathUtils.java4
2 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/net/INetworkStatsService.aidl b/core/java/android/net/INetworkStatsService.aidl
index 08d4c6cbf4ab..b7b87318554c 100644
--- a/core/java/android/net/INetworkStatsService.aidl
+++ b/core/java/android/net/INetworkStatsService.aidl
@@ -42,5 +42,7 @@ interface INetworkStatsService {
void setUidForeground(int uid, boolean uidForeground);
/** Force update of statistics. */
void forceUpdate();
+ /** Advise persistance threshold; may be overridden internally. */
+ void advisePersistThreshold(long thresholdBytes);
}
diff --git a/core/java/android/util/MathUtils.java b/core/java/android/util/MathUtils.java
index b35dd1eac0de..13a692ea18c9 100644
--- a/core/java/android/util/MathUtils.java
+++ b/core/java/android/util/MathUtils.java
@@ -39,6 +39,10 @@ public final class MathUtils {
return amount < low ? low : (amount > high ? high : amount);
}
+ public static long constrain(long amount, long low, long high) {
+ return amount < low ? low : (amount > high ? high : amount);
+ }
+
public static float constrain(float amount, float low, float high) {
return amount < low ? low : (amount > high ? high : amount);
}