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

Skip to content
Commit c89319df authored by Atneya Nair's avatar Atneya Nair
Browse files

Add audioserver permission caching

Audioserver upcalls to system_server for permission checks.
This causes deadlocks due to binder threadpool starvation.

Add permission caching functionality to AudioServerPermissionProvider.

We utilize the PermissionManager cache invalidation scheme, which
updates a sysprop whenever permissions might have changed. We maintain a
list of uids for each permission that audioserver is interested in, and
whenever the sysprop is updated, we check if the set of uids which hold
each perm is updated. If so, we push the new set of uids holding the
perm to system server. Ideally we wouldn't iterate over perms cross
uids, but there isn't a more efficient way to aggregate the info. We use
the existing app-id cache to avoid expensive package manager calls.

We should limit the number of permissions that audioserver checks, and
route calls through system server whenever possible, for performance
reasons.

Bug: 338089555
Test: atest AudioServerPermissionProviderTest
Flag: com.android.media.audio.audioserver_permissions

Change-Id: I8b3732a4b15b94cf90e03bb1604c126973288edf
parent 6bf26c72
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