Skip to content
Commit 935df08b authored by Kevin Rocard's avatar Kevin Rocard
Browse files

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: default avatarKevin Rocard <krocard@google.com>
parent 9637326e
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