summaryrefslogtreecommitdiff
path: root/core/java/android/os/IpcDataCache.java
Commit message (Collapse)AuthorAgeFilesLines
* Helper classes for IpcDataCache clientsLee Shombert2022-04-111-4/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 227653108 This adds a helper class that can reduce much of the boilerplate in code that uses IpcDataCache (or the internal-only variant, PropertyInvalidatedCache). See the changes to DevicePolicyManager for example usage. Two PropertyInvalidatedCaches APIs are exposed for testing. The method createPropertyName() is changed so that apis like "Foo" are converted to "foo", not "_foo". Unit tests for the new behavior are added to IpcDataCacheTest. This was manually tested by dumping the cache info from builds with and without this change. Special attention is paid to the DevicePolicyManager caches. The same caches were found (as identified by their key and api) and the caches were enabled/disabled the same. In the course of testing, multiple instances of DevicePolicyManager caches were observed. Cache performance is better if the caches are static; making them static will be addressed in b/228452829. Test: * atest FrameworksCoreTests:IpcDataCacheTest * atest FrameworksCoreTests:PropertyInvalidatedCacheTests * atest FrameworksServicesTests:DevicePolicyConstantsTest * atest FrameworksServicesTests:DevicePolicyEventLoggerTest * atest FrameworksServicesTests:DevicePolicyManagerServiceMigrationTest * atest FrameworksServicesTests:DevicePolicyManagerTest * atest FrameworksServicesTests:EnterpriseSpecificIdCalculatorTest * atest FrameworksServicesTests:OverlayPackagesProviderTest * atest FrameworksServicesTests:OwnersTest * atest FrameworksServicesTests:PolicyVersionUpgraderTest * atest FrameworksServicesTests:SecurityEventTest * atest FrameworksServicesTests:SystemUpdatePolicyTest * atest FrameworksServicesTests:TransferOwnershipMetadataManagerTest * atest MixedDeviceOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile * atest MixedDeviceOwnerTest#testSetKeyguardDisabledFeatures * atest MixedManagedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile * atest MixedManagedProfileOwnerTest#testNetworkLoggingDelegate * atest MixedManagedProfileOwnerTest#testSetKeyguardDisabledFeatures * atest OrgOwnedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile * atest OrgOwnedProfileOwnerTest#testNetworkLoggingDelegate * atest OrgOwnedProfileOwnerTest#testSetKeyguardDisabledFeatures * atest android.devicepolicy.cts.DevicePolicyManagerTest * atest android.devicepolicy.cts.NetworkLoggingTest * atest com.android.cts.devicepolicy.DeviceOwnerTest#testAdminActionBookkeeping Change-Id: I2f4fe4ed25db5fb3100334b9d2ce748ee928c10d
* Formally define allowable IpcDataCache modulesLee Shombert2022-03-181-4/+25
| | | | | | | | | | | | | | | | Bug: 219609105 The allowable IpcDataCache modules are formally defined as a @StringDef. There is no change to the system APIs. A future change may subdivide the SYSTEM module into small, feature-specific modules, such as package manager and user manager. Test: * atest FrameworksCoreTests:IpcDataCacheTest * atest CtsOsTestCases:IpcDataCacheTest Change-Id: I15e358723a36b76c384ccfb70bed63e80d57c4c7
* Create os/IpcDataCacheLee Shombert2022-03-071-0/+364
Bug: 219609105 Create os/IpcDataCache as a subclass of PropertyInvalidatedCache. The APIs in the new class are the SystemApi for mainline modules. Note that IpcDataCache.invalidateCache(String) is a new system API, relative to the list in PropertyInvalidateCache. The new API is static, which is the most common use case for invalidateCache calls. The corresponding CTS test is updated in the next review. However, it is also cloned into the current unit test. Test: * atest FrameworksCoreTests:PropertyInvalidatedCacheTests * atest FrameworksCoreTests:IpcDataCacheTest Change-Id: I83ce97a4154b9065e0686ee99a25c90f955366ff