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
Loading
Please register or sign in to comment