Refactor security checks to register policies
There is no functional changes in this patch
The checks were much more complex then needed.
The behaviour on empty mix was not explicit, it depended on non trivial behaviour
of anyMatch and allMatch and the code flow.
There was an early positive return leading to the rest of the permission
check to be skipped. Which was correct but prone to bugs if the code was
changed.
The code in general was hard to change without introducing security bug
as well as difficult to review.
Change it to a two part section, first the permissions needed are
determined explicitly.
Then those permissions are checked.
Early return is only used for permission denial.
Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 129948989
Change-Id: I6b4177e47025af983ba6c980d58ea308c4c378f1
Signed-off-by: Kevin Rocard <krocard@google.com>
Loading
Please register or sign in to comment