Fix deadlock in AccessCheckDelegateImpl.
We shouldn't call into packages when holding our own lock. We can simply temporarily release our lock when we need to call into packages to get the UID. We only call into packages when needed because there's a non-trivial performance cost if we do that. It's also okay for us to temporarily release our lock in this case because even if mOverridePermissionStates changes while we aren't holding the lock, we'll still return a valid permission check result, as we don't have atomicity guarantee between shell identity and override permission states which are two APIs, and we can accept the small one-time performance penalty of needlessly fetching the UID in the unlikely case there was an override permission state that's now gone. Fixes: 429911389 Flag: EXEMPT bug fix Test: presubmit Change-Id: I5b620285741f101ea933b60be88d4b8808566a74
Loading
Please register or sign in to comment