summaryrefslogtreecommitdiff
path: root/core/java/android/util/SparseLongArray.java
Commit message (Collapse)AuthorAgeFilesLines
* Add a tracker on background current drains for each uidJing Ji2022-01-251-0/+22
| | | | | | | | | | On detecting excessive battery usage of a background uid, we may move the background restriction of the apps running in this uid to more restrictive levels. Bug: 200326767 Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: I6c2d41e44367a283d8aa9491be683018a80a810c
* Add SparseLongArray.incrementValue()Dmitri Plotnikov2022-01-191-0/+24
| | | | | | | | | | | | | This method is used for accumulation of long values: if the key does not exist, one is created. If one already exists, the passed value is added to the previous value. This method is similar to the existing SparseDoubleArray.incrementValue() method Bug: 215427055 Test: atest FrameworksCoreTests:SparseLongArrayTest Change-Id: I771d9bc2bdd12ca4260b20186ced70f5862b6f56
* Fix typo in SparseLongArrayAdam Bookatz2021-03-171-2/+2
| | | | | | Bug: 182845832 Test: N/A Change-Id: I9178e7962282ab998613f1d1a4df701cc4036dfd
* Add extra comment for implementation.Kweku Adams2019-04-291-0/+2
| | | | | | | | | Add a comment noting that the check to throw the exception is intentionally second so that it's out of the critical path. Bug: 118339123 Test: N/A Change-Id: I36c5ea67579bcd7906f711530392110d9987ffb4
* Gating OutOfBoundsException on targetSdkVersion.Kweku Adams2019-04-261-2/+12
| | | | | | | | | Apps targeting Pie or older will get the old undefined behavior. Apps targeting Q or newer will get the OutOfBoundsException. Bug: 118339123 Test: atest CtsUtilTestCases Change-Id: Ibf5467aadec4a2f76ee180e963afeaf5a8a013a2
* Revert "Revert "Checkng upper bound in *Array classes.""Kweku Adams2019-03-301-0/+8
| | | | | | | | This reverts commit 91ec97056451753d6db55d310fc93fbd93c61cb3. Reason for revert: b/128433495 Change-Id: I4aac43f6aacd594f9c2bf58db9fbc4a1395d8888
* Revert "Checkng upper bound in *Array classes."Paul Scovanner2019-03-121-8/+0
| | | | | | | | This reverts commit 17d453ea85703a5bc26c0669231be4d6f0d8bbac. Reason for revert: b/127750694 Change-Id: I0ffbf0e64109b3ec724e0687a27b231e335f76b4
* Checkng upper bound in *Array classes.Kweku Adams2019-03-051-0/+8
| | | | | | | | | | *Array classes will now throw an IndexOutOfBoundsException if a caller tries to get or set a value for an index that's invalid based on the current size. Bug: 118339123 Test: atest CtsUtilTestCases Change-Id: Iddc9a0c7c89e0ac743b0380049527a1b2dfb434f
* Stop tracking user specific uid cpu time on user stopSuprabh Shukla2017-07-051-0/+17
| | | | | | | | | | | | | | | | Telling kernel module uid_cputime to stop accounting time for uids belonging to a stopped user. Upon user remove, removing uid states for those uids. Test: adb shell am instrument -e class \ com.android.internal.os.BatteryStatsUserLifecycleTests -w \ com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner adb shell am instrument -e class android.util.SparseLongArrayTest -w \ com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Bug: 62390461 Change-Id: Ibe07778465e3d2c13679e4d88d32f7b92fa959d9
* Uses VMRuntime.newUnpaddedArray for ideal array sizesAdam Lesinski2014-03-271-37/+12
| | | | | | Bug:13028925 Change-Id: I0a9301248b10a339afbdc5e4ffe3310ac4fa1fb7
* Fix javadoc typo in SparseArray.Newton Allen2013-11-211-1/+1
| | | | Change-Id: Ie69b2cf96dae95b6ebe7b7797d3755749aec9f35
* Document the order of values returned by keyAt().Flavio Lerda2013-09-081-0/+17
| | | | | | | | | | | The values returned by keyAt() are currently guaranteed to be in ascending order. This is helpful to users of the API to be able to make assumptions about the keys and values when iterating over one of the sparse array implementations. This commit adds documentation about this. Change-Id: I3d7eb78e115ce174f1167b83904b44bf5120b223
* Make ArrayMap public! :)Dianne Hackborn2013-07-161-8/+33
| | | | | | | | | | Also do some tweaking of the various container classes to synchronize them with the support lib and make it easier to copy code between the two. And update activity/fragment to use ArrayMap. Change-Id: I3cfe82392a17119dfc72c3d9961f64e1914f42be
* Update SparseArray docs to be more informative.Dianne Hackborn2013-07-121-2/+12
| | | | Change-Id: I5d8d17d46a69ccdcf6b29f93be3d44addd80ab61
* New ArrayMap class.Dianne Hackborn2013-05-241-29/+16
| | | | | | | | | | | | | | | | | | | | | | | | | This is a new kind of key/value mapping that stores its data as an array, so it doesn't need to create an extra Entry object for every mapping placed in to it. It is also optimized to reduce memory overhead in other ways, by keeping the base object small, being fairly aggressive about keeping the array data structures small, etc. There are some unit and performance tests dropped in to some random places; they will need to be put somewhere else once I decided what we are going to do with this for the next release (for example if we make it public the unit tests should go in to CTS). Switch IntentResolver to using ArrayMap instead of HashMap. Also get rid of a bunch of duplicate implementations of binarySearch, and add an optimization to the various sparse arrays where you can supply an explicit 0 capacity to prevent it from doing an initial array allocation; use this new optimization in a few places where it makes sense. Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
* Unhide SparseLongArrayScott Kennedy2012-11-261-2/+0
| | | | | | Because it's useful. Change-Id: I6c71a49eed2c0c366e8afa874ebbc48cfe816a90
* Adding APIs to enable reporting virtual view hierarchies to accessibility ↵Svetoslav Ganov2011-10-211-0/+247
serivces. Added an interface that is the contract for a client to expose a virtual view hierarchy to accessibility services. Clients impement this interface and set it in the View that is the root of the virtual sub-tree. Adding this finctionality via compostion as opposed to inheritance enables apps to maintain backwards compatibility by setting the accessibility virtual hierarchy provider on the View only if the API version is high enough. bug:5382859 Change-Id: I7e3927b71a5517943c6cb071be2e87fba23132bf