Generate Property Invalidated Cache from annotation.
This CL is generating simple code for PropertyInvalidatedCache. It is to simplify caching implementation. To be used internally in manager classes which are making binder calls to the system server. To use annotate the manager class with @CachedPropertyDefaults. By default it has a maximum capacity of 4 and stores in the "system_server" module. both can be overwritten and will be used as default for each property inside of annotated class, eg: @CachedPropertyDefaults(module = "my_custom_module", max=32) Need static PropertyInvalidatedCache use @CachedProperty() or @CachedProperty(modifiers = {Modifier.STATIC}) in front of a method which calls a binder. Need NON-static PropertyInvalidatedCache use @CachedProperty(modifiers = {}) in front of a method which calls a binder. Need to change the max capacity of cache or give custom API name use @CachedProperty( modifiers = {}, max = 1, apiName = "my_unique_key") in front of a method which calls a binder. Bug: 361730767 Change-Id: I87677d102f62753c6e0707741c154c6b65c28949 Test: atest cached-property-annotation-processor-test Flag: EXEMPT bugfix Ignore-AOSP-First: Should not yet be exposed to AOSP
Loading
Please register or sign in to comment