Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 20b5e087 authored by Jeongsik Mun's avatar Jeongsik Mun Committed by Alex Buynytskyy
Browse files

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
parent 7b0313fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment