Adding a way to communicate user space for AppOp changes.
Currently, AppOpps Manager just provides package name to its
upstream listeners, which detemine the correct app by utiliing
context bound package manager APIs.
However, this gives issues for MediaProvider, as root user and
clone user both share the MediaProvider of root user,
providing no way for MP process to know if an AppOp was intended
for root user or cloned user app.
By adding a new hidden API which takes userId and is overridden
by MP, we can convey the desired userId to MP process.
Using this userId, MP can clear media_grants for correct userId
(user 0 or cloned user), in case a corresponding app_op is recieved.
For other impl, the original functionality of not getting userId
is retained.
Test: atest CtsAppOpsTestCases CtsAppOps2TestCases
Bug: 278843665, 278644253
Change-Id: I7ff844dae27757492f31c795432600cab48b2bb5
1 file changed