Do not wait for opportunistic sub to be IN SERVICE for test emergency

isOkToCall assumed that both subscriptions would eventually move to
IN_SERVICE, which is not the case for opportunistic subscriptions.
Do not wait for IN_SERVICE to complete test emergency calls in this
case.

Test: atest FrameworksTelephonyTests
Change-Id: I76ee5a9baabcaa7defa2146a2c153789af026c73
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 498625d..bb142ee 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -481,7 +481,10 @@
                         // it is a test emergency number and we have to wait for the device to move
                         // IN_SERVICE before the call can take place over normal routing.
                         return (phone.getState() == PhoneConstants.State.OFFHOOK)
-                            || serviceState == ServiceState.STATE_IN_SERVICE;
+                                // Do not wait for voice in service on opportunistic SIMs.
+                                || SubscriptionController.getInstance().isOpportunistic(
+                                        phone.getSubId())
+                                || serviceState == ServiceState.STATE_IN_SERVICE;
                     }
                 }
             });