Merge "Check Phone\'s ServiceState to see if it accepts Emergency Calls" into nyc-dev
am: 707f5e8

* commit '707f5e8d2f66131ff9b811eaaa6e262d0fab92d7':
  Check Phone's ServiceState to see if it accepts Emergency Calls

Change-Id: Iee57d09ca46fdea663ec481092f4ff5955a45c8c
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 91ee5a0..40e4ef9 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -617,7 +617,8 @@
             if (phone == null)
                 continue;
 
-            if (ServiceState.STATE_IN_SERVICE == phone.getServiceState().getState()) {
+            if (ServiceState.STATE_IN_SERVICE == phone.getServiceState().getState() ||
+                    phone.getServiceState().isEmergencyOnly()) {
                 // the slot has the radio on & state is in service. This will be quicker,
                 // so just shortcut and use this option.
                 Log.d(this, "getFirstPhoneForEmergencyCall, radio on & in service, slotId:" + i);