diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/net/INetworkStatsService.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/util/MathUtils.java | 4 |
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); } |
