Create a method for top K targets by using min heap algorithm

This is a in-place sorting method. After sorting, top K targets will be at the first K indexes. Order for other elements will remain same. The method is meant for getting top K ranked targets for Share-sheet.

Bug: 142558305
Test: Passed all unit tests in ResolverActivityTest, ChooserActivityTest
and ResolverListControllerTest
Change-Id: I1b096bb0d7f7bbc102c2fb588c55ace6a20bfc5d
1 file changed