Skip to content
Commit 3442aa04 authored by Lee Shombert's avatar Lee Shombert
Browse files

Fix ClassCastException in WatchedIntentResolver

Bug: 187691893

IntentResolver.sortResults() is a generic method that assumes its
argument is a List<IntentFilter>, although this is not explicit in the
data types.  The assumption fails in WatchedIntentResolver, which is
actually holding List<WatchedIntentFilter>.

The change follows the same path as server/firewall/IntentFirewall:
sortResults() is overridden in WatchedIntentResolver to accept the
proper type.  While we are at it, we force the class parameters in
WatchedIntentResolver to be WatchedIntentFilter (because that is
always true).  This means no casting is required to support
sortResults().

Finally, WatchedIntentResolver is moved into the server.pm package,
where it is actually used.  Should the need arise, it can be elevated
back to the server package.

Test: atest
 * CtsContentTestCases:IntentFilterTest
 * CtsDynamicMimeHostTestCases
 * FrameworksServicesTests:AppsFilterTest

Change-Id: Id1546c6711f95e0970c018b0e54cad7f3a8ac4b7
parent be6088d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment