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

Skip to content
Commit 5029ea51 authored by Azhara Assanova's avatar Azhara Assanova
Browse files

Implement logging for ContentOrFileUriEventReported

This change covers event type 1
CONTENT_URI_WITHOUT_CALLER_READ_PERMISSION, i.e. when an app launches an
activity with requireContentUriPermissionFromCaller set to "none", and
the launching app passes content URIs it doesn't have permission to
read.

Processing activity launches can happen concurrently, hence it's
important to distinguish which content URIs belong to a specific
activity launch. For that, this change uses Request#hashCode to uniquely
identify launches inside UriGrantsManagerService to collect the required
content URIs for logging. Once the activity launch is completed and the
WindowManager lock is released (to ensure no deadlocking),
ActivityStarter will notify UriGrantsManagerService that the activity
launch has been completed.

If the launch was successful, then UriGrantsManagerService will log the
event and clear the collected content URIs. If the launch was
unsuccessful, then UriGrantsManagerService will simply clear the
collected content URIs.

To collect the content URIs, UriGrantsManagerService uses a new array
map from launch ids to sets of content URIs and guards it by a lock. To
accommodate that, all the methods around
requireContentUriPermissionFromCaller have also been renamed to
indicate whether they should be called in the unlocked or locked state.

Bug: 314273739
Test: statsd_testdrive 933
Flag: EXEMPT metrics
Change-Id: I8a78d8d9d079c93e50de39235e269294aff02884
parent 039abeb9
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