Update Intent#resolveTypeIfNeeded() for intent filter matching

With the change ag/15315839, explicit intents also have to match the
declared intent filters. The existing implementation of
resolveTypeIfNeeded() assumes all explicit intents will always be
delivered and will skip resolving types for content:// uris. Update the
implementation to only skip resolution if the intent is bound to the
same app it was created, or the caller is either root or the system.

Bug: 196573010
Test: atest CtsContentTestCases:PackageManagerTest
Change-Id: Ic3b51c68fd971422242db42af35e13f691d65c07
1 file changed