summaryrefslogtreecommitdiff
path: root/core/java/android/util/Pools.java
Commit message (Collapse)AuthorAgeFilesLines
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-071-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+11
| | | | | | | | | | | | | | | | | | | For packages: android.util.proto android.util.jar android.util.apk android.util This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ia0f48c244b0fbe33d40d797702a82303648196ed
* PooledLambdaEugene Susla2017-12-051-3/+10
| | | | | | | | | | | This introduces PooledLambda - a way of obtaining lambdas without the allocations overhead. See PooledLambda javadoc for a guide and PooledLambdaSample for code samples of useful usages. Test: ensure samples of PooledLambdaSample work as described. Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
* Simplification of the Pools implementation.Svetoslav Ganov2012-12-131-32/+12
| | | | | | | Now instead of a link list of holder objects the pool is backed by an array of the max size. Change-Id: Iad1f4f2766d42e8c438cc8efbc72e1e5756b0baf
* Adding pool management via the poolable APIs to some classes.Svetoslav Ganov2012-11-301-13/+4
| | | | | | | | | 1. Removed the support for infinite pool size which nobody was using and does not make sense. 2. Update some classes in ViewGroup to use the poolable APIs. Change-Id: Ifdb8c10968cd06fe53085ec9d3d649f7c9a944b7
* Simplification of the poolable management utils.Svetoslav Ganov2012-11-271-11/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before to implement a pool of objects, the pooled class had to implement an interface which was leaking the pool management APIs. This requires hiding APIs - inconvenient at best. Further, each client had to implement the chaining of pooled instances which means adding a couple of member variables which are manipulated by the implemented interface methods. As a consequence the client is aware of how pooling is implemented which is error prone and breaks encapsulation. Now the pool objects are responsible for managing pooling state via reusable wrapper objects and the clients are oblivious of how pooling is done. Creating a thin cached wrapper for each pooled object has minimal performance impact while making the code more maintainable. Actually implementing of the old version of the APIs was taking as much code as implementing the pooling yourself. Also clients had to implement a poolable manager whose responsibility was to create new instances and provide callbacks when an instance is added to or removed from the pool. Now, the clinet class should create a static member for the pool and expose obtain/aquire and release/recycle methods in which it should create a new instance if the pool did not return one and clear the state of the host when it is returned to the pool. Updated the JavaDoc with a best practice. The pooling was composed of several interfaces and classes scattered over a few files, now all this is in a single small file. Update all usages of the pooling APIs in the framework. Also one had to write a poolable manager which Change-Id: Ib8dc286040eb3d7cb7d9668ba76fead05cb97647
* AI 144014: am: CL 144013 Rename PoolFactory to Pools, to follow the ↵Romain Guy2009-04-021-0/+41
java.util convention (Collections, Arrays.) Original author: romainguy Merged from: //branches/donutburger/... Automated import of CL 144014