Fix sorting issue during emergency call attempt.

Fix the integer overflow/underflow caused by sorting of duplicate phoneaccounts during emergency call attempt. 

Bug: 208267659
Original change:
Merged-In: I3529e4f86ba5690a8c2e72d6103a84c00bf3f358
Change-Id: I3529e4f86ba5690a8c2e72d6103a84c00bf3f358
Test: Added unit test (see
Test: Manual testing performed to confirm that this corrects repro.
(cherry picked from commit e20b83ec9b3dc2bc5a49a666bd057cf45ce99f15)
(cherry picked from commit 4f64285184fbad85a0a554f3cefa821846be8002)
1 file changed