Fix inability to make emergency call when call in progress on multi-sim.

When there is only a single sim in the 2nd sim slot on a multisim device,
if it not possible to make an emergency call when there is an ongoing
call on that sim.

The root cause of the problem is that getPhoneForAccount returns the
default phone if we are making an emergency call.  In this case, the
default phone is sim 1, and it is out of service due to the fact that
sim 2 is in use for an ongoing call.

The fix for this is 2-part:
1. We will always use the accountHandle associated with the call (the
CreateConnectionProcessor in Telecom has emergency calling logic which
assigns this phone account in the first place, so it is reasonable to
assume that it is a good first attempt).
2. If the phone for that phone account is not in service and this is an
emergency call, we will use the "getFirstPhoneForEmergencyCall()" method
to find an in service phone on which to attempt the call (this is
existing code which was orphaned at some point).  That code will fall
back to the getDefaultPhone() if no in service phone is found.

Bug: 22776038
Change-Id: I398ff5d7c4c278a2c8385cb7e32cc3e4116028a9
1 file changed