Update permission checks for dual permission mode.

Callers must hold both the old and new permissions, so that we can
handle obscure cases like when an app targets Q but was installed on
a device that was originally running on P before being upgraded to Q.

Bug: 126785920, 126788266
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Exempt-From-Owner-Approval: trivial tests
Change-Id: I7e474738053c0d7fb9e1a9a77911927558f9f051
7 files changed