Flush permission cache when we change delegates

Delegates can change the results of permission checks.  This change
assumes that delegate results are not dynamic, but that seems to be
the case in practice. Just in case, re-setting the delegate acts as a
cache flush.

Test: atest UiAutomationTest#testAdoptAllShellPermissions
Bug: b/150265749
Change-Id: I26e7330ebbdeaf2e7e282f3c770b962688aabf41
1 file changed