Skip to content
Commit fdd45a5c authored by Lee Shombert's avatar Lee Shombert
Browse files

Put a binder cache on DevicePolicyManager APIs

Bug: 190489030

Put a binder cache in front of IDevicePolicyManager APIs.  The
following APIs are cached:
 * getKeyguardDisabledFeatures()
 * hasDeviceOwner()
 * getProfileOwnerOrDeviceOwnerSupervisionComponent()
 * isOrganizationOwnedDeviceWithManagedProfile()
 * getDeviceOwnerOrganizationName()
 * getOrganizationNameForUser()
 * isNetworkLoggingEnabled()

The caches use a shared key which means that all are invalidated at
the same time.  This is slightly less efficient than API-specific
invalidation but it greatly simplifies the invalidation logic in the
server.  The cost of invalidating all caches at the same time is small
if invalidation happens infrequently (less than one an hour, on
average).

The test classes are modified to disable caches in the local process.

Test:
 * 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

Change-Id: Iead8644cb413b45f3b6f3da81ff00a61788941a2
parent 2ec1d951
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment