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

Skip to content
Commit 4914447e authored by Himanshu Gupta's avatar Himanshu Gupta
Browse files

Allowing content uris with cloneUserId to be accessed by parent user.

In some cases a userId maybe appended to the contentUri, to determine
the storage location of the content, ex: `content://10@media/external/images/media/000001.png`

This has started in systemui/screenshot, where ag/19783114 appended the userId of the
foreground user in ScreenShot Content Uris. However, this change gives error while
saving screenshots in cloned apps, as the userId appended is different from the
MediaProvider Process trying to save the content (MP of user 0 is used for clonedProfile).
The error is triggerred from `ContentProvider.validateIncomingUri`

We add the check that if the ContentAuthorityUser shares Media with a parentUser,
and the latter is same as the MP process user, we do not throw the above error.

Bug: b/270350104
Test: Manual verification on device
Change-Id: I62e87c4f04840573138ed59918cc869d1ab12dea
parent 7871be0c
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