Introduce a new thread in system_server for the PermisisonController
FgThread could be blocked by lock contention for a while especially
during a new user creation. During this time, PermisisonPolicyService
synchronizes permissions and app ops in FgThread. Meanwhile,
PermissionController does async things for initialization. Both use
PackageManager a lot to get package info, which could result in lock
contention and blocking FgThread for a very short duration for each
call to PackageManager. It could delay the user creation or switching.
This CL adds a new thread for PermisisonPolicyService and
PermisisonController to avoid blocking FgThread by lock contention.
This is a roll forward of ag/15373851 with a minor fix for the benchmark.
synchronizePackagePermissionsAndAppOpsForUser kept on FgThread. It is a heavy operation. Dispatched on a PermissionThread, it interferes with user switch. FgThread is busy and schedules it after most of the switch is done.
Bug: 165030092
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t \
com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPermissionGrant
Test: atest UserLifecycleTests#switchUser --iterations
Change-Id: Ia035e4ad8f302af7bde5c1c7fd5ac3aaa6642e96
Loading
Please register or sign in to comment