diff options
| author | Jing Ji <jji@google.com> | 2022-01-14 11:50:51 -0800 |
|---|---|---|
| committer | Jing Ji <jji@google.com> | 2022-01-25 15:23:26 -0800 |
| commit | 7271a9845b747b2c9396c16e25615dece25a0791 (patch) | |
| tree | f2a8eff66a923cd5639dd9a7fd0174e792182d33 /core/java/android/util/SparseDoubleArray.java | |
| parent | ccaf79d27b15a8d4032169c2210d01e5771b972b (diff) | |
Exempt certain app behaviors for their background battery usage
If the app is hosting media playback or location foreground services,
or has active media session, the background battery usage during that
will be excluded from the abusive background battery usage monitoring.
Bug: 200326767
Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: I7ddeffe3490608ee3f005af6f4722270756085a3
Diffstat (limited to 'core/java/android/util/SparseDoubleArray.java')
| -rw-r--r-- | core/java/android/util/SparseDoubleArray.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/util/SparseDoubleArray.java b/core/java/android/util/SparseDoubleArray.java index cb51f7ac13b7..ee2e3ce3e0ee 100644 --- a/core/java/android/util/SparseDoubleArray.java +++ b/core/java/android/util/SparseDoubleArray.java @@ -169,6 +169,20 @@ public class SparseDoubleArray implements Cloneable { } /** + * Removes the mapping at the given index. + */ + public void removeAt(int index) { + mValues.removeAt(index); + } + + /** + * Removes the mapping from the specified key, if there was any. + */ + public void delete(int key) { + mValues.delete(key); + } + + /** * Removes all key-value mappings from this SparseDoubleArray. */ public void clear() { |
