Add cache to AppOpsController
Reduces the Binder calls from AppOpsControllerImpl to
PackageManager#getPermissionFlags by caching calls for 10s (moltmann@
recommended this expiration time).
Also, modify AppOpsControllerImpl#notifySuscribers to use the bg Thread.
Currently calls to getPermissionFlags only happen in two functions:
* AppOpsControllerImpl#notifySuscribers
* AppOpsControllerImpl#getActiveAppOpsForUser
First one in only called from bg thread and second one is called from a
bg thread from PrivacyItemController.
In a future CL, this calling will be enforced at the entry point
(getActiveAppOpsForUser)
Test: atest PermissionFlagsCacheTest AppOpsControllerTest
Bug: 134687592
Change-Id: I6fa9e2d865bc295f6325935e2df574b8b758214a
4 files changed